com.badlogic.gdx.Graphics.getGLVersion()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(132)

本文整理了Java中com.badlogic.gdx.Graphics.getGLVersion()方法的一些代码示例,展示了Graphics.getGLVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graphics.getGLVersion()方法的具体详情如下:
包路径:com.badlogic.gdx.Graphics
类名称:Graphics
方法名:getGLVersion

Graphics.getGLVersion介绍

暂无

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
public void prepare () {
  if (isPrepared) throw new GdxRuntimeException("Already prepared");
  if (!isGpuOnly) {
    int amountOfFloats = 4;
    if (Gdx.graphics.getGLVersion().getType().equals(GLVersion.Type.OpenGL)) {
      if (internalFormat == GL30.GL_RGBA16F || internalFormat ==  GL30.GL_RGBA32F) amountOfFloats = 4;
      if (internalFormat == GL30.GL_RGB16F || internalFormat ==  GL30.GL_RGB32F) amountOfFloats = 3;
      if (internalFormat == GL30.GL_RG16F || internalFormat ==  GL30.GL_RG32F) amountOfFloats = 2;
      if (internalFormat == GL30.GL_R16F || internalFormat ==  GL30.GL_R32F) amountOfFloats = 1;
    }
    this.buffer = BufferUtils.newFloatBuffer(width * height * amountOfFloats);
  }
  isPrepared = true;
}

代码示例来源:origin: libgdx/libgdx

@Override
public void prepare () {
  if (isPrepared) throw new GdxRuntimeException("Already prepared");
  if (!isGpuOnly) {
    int amountOfFloats = 4;
    if (Gdx.graphics.getGLVersion().getType().equals(GLVersion.Type.OpenGL)) {
      if (internalFormat == GL30.GL_RGBA16F || internalFormat ==  GL30.GL_RGBA32F) amountOfFloats = 4;
      if (internalFormat == GL30.GL_RGB16F || internalFormat ==  GL30.GL_RGB32F) amountOfFloats = 3;
      if (internalFormat == GL30.GL_RG16F || internalFormat ==  GL30.GL_RG32F) amountOfFloats = 2;
      if (internalFormat == GL30.GL_R16F || internalFormat ==  GL30.GL_R32F) amountOfFloats = 1;
    }
    this.buffer = BufferUtils.newFloatBuffer(width * height * amountOfFloats);
  }
  isPrepared = true;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

@Override
public void prepare () {
  if (isPrepared) throw new GdxRuntimeException("Already prepared");
  if (!isGpuOnly) {
    int amountOfFloats = 4;
    if (Gdx.graphics.getGLVersion().getType().equals(GLVersion.Type.OpenGL)) {
      if (internalFormat == GL30.GL_RGBA16F || internalFormat ==  GL30.GL_RGBA32F) amountOfFloats = 4;
      if (internalFormat == GL30.GL_RGB16F || internalFormat ==  GL30.GL_RGB32F) amountOfFloats = 3;
      if (internalFormat == GL30.GL_RG16F || internalFormat ==  GL30.GL_RG32F) amountOfFloats = 2;
      if (internalFormat == GL30.GL_R16F || internalFormat ==  GL30.GL_R32F) amountOfFloats = 1;
    }
    this.buffer = BufferUtils.newFloatBuffer(width * height * amountOfFloats);
  }
  isPrepared = true;
}

相关文章