예제 #1
0
  public static void enableExtensions(final GL10 pGL, final RenderOptions pRenderOptions) {
    final String version = pGL.glGetString(GL10.GL_VERSION);
    final String renderer = pGL.glGetString(GL10.GL_RENDERER);
    final String extensions = pGL.glGetString(GL10.GL_EXTENSIONS);

    Debug.d("RENDERER: " + renderer);
    Debug.d("VERSION: " + version);
    Debug.d("EXTENSIONS: " + extensions);

    final boolean isOpenGL10 = version.contains("1.0");
    final boolean isOpenGL2X = version.contains("2.");
    final boolean isSoftwareRenderer = renderer.contains("PixelFlinger");
    final boolean isVBOCapable = extensions.contains("_vertex_buffer_object");
    final boolean isDrawTextureCapable = extensions.contains("draw_texture");
    final boolean isTextureNonPowerOfTwoCapable = extensions.contains("texture_npot");

    GLHelper.EXTENSIONS_VERTEXBUFFEROBJECTS =
        !pRenderOptions.isDisableExtensionVertexBufferObjects()
            && !isSoftwareRenderer
            && (isVBOCapable || !isOpenGL10);
    GLHelper.EXTENSIONS_DRAWTEXTURE =
        !pRenderOptions.isDisableExtensionVertexBufferObjects()
            && (isDrawTextureCapable || !isOpenGL10);
    GLHelper.EXTENSIONS_TEXTURE_NON_POWER_OF_TWO = isTextureNonPowerOfTwoCapable || isOpenGL2X;

    GLHelper.hackBrokenDevices();
    Debug.d("EXTENSIONS_VERXTEXBUFFEROBJECTS = " + GLHelper.EXTENSIONS_VERTEXBUFFEROBJECTS);
    Debug.d("EXTENSIONS_DRAWTEXTURE = " + GLHelper.EXTENSIONS_DRAWTEXTURE);
  }
 private void log(final String pMessage) {
   Debug.d(pMessage);
 }