Loading opengl/tests/gl2_jni/Android.mk +0 −2 Original line number Original line Diff line number Diff line Loading @@ -44,8 +44,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE := libgl2jni LOCAL_MODULE := libgl2jni LOCAL_ARM_MODE := arm LOCAL_PRELINK_MODULE := false LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY) Loading opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIView.java +12 −7 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,7 @@ import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL10; /** /** * An implementation of SurfaceView that uses the dedicated surface for * An implementation of SurfaceView that uses the dedicated surface for * displaying an OpenGL animation. This allows the animation to run in a * displaying an OpenGL animation. This allows the animation to run in a Loading @@ -67,13 +68,14 @@ class GL2JNIView extends GLSurfaceView { private void init() { private void init() { setEGLContextFactory(new ContextFactory()); setEGLContextFactory(new ContextFactory()); // setEGLConfigChooser(new ConfigChooser()); setEGLConfigChooser(new ConfigChooser()); setRenderer(new Renderer()); setRenderer(new Renderer()); } } private static class ContextFactory implements GLSurfaceView.EGLContextFactory { private static class ContextFactory implements GLSurfaceView.EGLContextFactory { private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { Log.w(TAG, "creating OpenGL ES 2.0 context"); checkEglError("Before eglCreateContext", egl); checkEglError("Before eglCreateContext", egl); int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); Loading @@ -97,8 +99,10 @@ class GL2JNIView extends GLSurfaceView { private static int EGL_OPENGL_ES2_BIT = 4; private static int EGL_OPENGL_ES2_BIT = 4; private static int[] s_configAttribs2 = private static int[] s_configAttribs2 = { { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_RED_SIZE, 4, // EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_GREEN_SIZE, 4, EGL10.EGL_BLUE_SIZE, 4, EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE EGL10.EGL_NONE }; }; public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { Loading @@ -108,12 +112,13 @@ class GL2JNIView extends GLSurfaceView { int numConfigs = num_config[0]; int numConfigs = num_config[0]; Log.w(TAG, String.format("Found %d configurations", numConfigs)); if (numConfigs <= 0) { if (numConfigs <= 0) { throw new IllegalArgumentException("No configs match configSpec"); throw new IllegalArgumentException("No configs match configSpec"); } } EGLConfig[] configs = new EGLConfig[numConfigs]; EGLConfig[] configs = new EGLConfig[numConfigs]; egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config); egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config); return configs[0]; return configs[0s]; } } } } Loading opengl/tests/gl2_jni/jni/gl_code.cpp +13 −13 File changed.Contains only whitespace changes. Show changes Loading
opengl/tests/gl2_jni/Android.mk +0 −2 Original line number Original line Diff line number Diff line Loading @@ -44,8 +44,6 @@ LOCAL_SHARED_LIBRARIES := \ LOCAL_MODULE := libgl2jni LOCAL_MODULE := libgl2jni LOCAL_ARM_MODE := arm LOCAL_PRELINK_MODULE := false LOCAL_PRELINK_MODULE := false include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY) Loading
opengl/tests/gl2_jni/src/com/android/gl2jni/GL2JNIView.java +12 −7 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,7 @@ import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLContext; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.egl.EGLDisplay; import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL10; /** /** * An implementation of SurfaceView that uses the dedicated surface for * An implementation of SurfaceView that uses the dedicated surface for * displaying an OpenGL animation. This allows the animation to run in a * displaying an OpenGL animation. This allows the animation to run in a Loading @@ -67,13 +68,14 @@ class GL2JNIView extends GLSurfaceView { private void init() { private void init() { setEGLContextFactory(new ContextFactory()); setEGLContextFactory(new ContextFactory()); // setEGLConfigChooser(new ConfigChooser()); setEGLConfigChooser(new ConfigChooser()); setRenderer(new Renderer()); setRenderer(new Renderer()); } } private static class ContextFactory implements GLSurfaceView.EGLContextFactory { private static class ContextFactory implements GLSurfaceView.EGLContextFactory { private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098; public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) { Log.w(TAG, "creating OpenGL ES 2.0 context"); checkEglError("Before eglCreateContext", egl); checkEglError("Before eglCreateContext", egl); int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE }; EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list); Loading @@ -97,8 +99,10 @@ class GL2JNIView extends GLSurfaceView { private static int EGL_OPENGL_ES2_BIT = 4; private static int EGL_OPENGL_ES2_BIT = 4; private static int[] s_configAttribs2 = private static int[] s_configAttribs2 = { { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_RED_SIZE, 4, // EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_GREEN_SIZE, 4, EGL10.EGL_BLUE_SIZE, 4, EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL10.EGL_NONE EGL10.EGL_NONE }; }; public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) { Loading @@ -108,12 +112,13 @@ class GL2JNIView extends GLSurfaceView { int numConfigs = num_config[0]; int numConfigs = num_config[0]; Log.w(TAG, String.format("Found %d configurations", numConfigs)); if (numConfigs <= 0) { if (numConfigs <= 0) { throw new IllegalArgumentException("No configs match configSpec"); throw new IllegalArgumentException("No configs match configSpec"); } } EGLConfig[] configs = new EGLConfig[numConfigs]; EGLConfig[] configs = new EGLConfig[numConfigs]; egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config); egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config); return configs[0]; return configs[0s]; } } } } Loading
opengl/tests/gl2_jni/jni/gl_code.cpp +13 −13 File changed.Contains only whitespace changes. Show changes