background preloader

OpenGL issues

Facebook Twitter

Android - SurfaceView flashes black on load. Java - [Cocos2d]How to Create bitmap from GlSurfaceView. Hardware Acceleration. Beginning in Android 3.0 (API level 11), the Android 2D rendering pipeline supports hardware acceleration, meaning that all drawing operations that are performed on a View's canvas use the GPU. Because of the increased resources required to enable hardware acceleration, your app will consume more RAM. Hardware acceleration is enabled by default if your Target API level is >=14, but can also be explicitly enabled. If your application uses only standard views and Drawables, turning it on globally should not cause any adverse drawing effects. However, because hardware acceleration is not supported for all of the 2D drawing operations, turning it on might affect some of your custom views or drawing calls. Problems usually manifest themselves as invisible elements, exceptions, or wrongly rendered pixels. To remedy this, Android gives you the option to enable or disable hardware acceleration at multiple levels.

See Controlling Hardware Acceleration. Controlling Hardware Acceleration View level. Android displays black rectangles instead of drawable images after opening openGL context. Android OpenGL ES 1.1 poor performance under ICS - eglSwapBuffers taking 60+ms. Introducing GLSurfaceView. GLSurfaceView is a new API class in Android 1.5. GLSurfaceView makes OpenGL ES applications easier to write by: Providing the glue code to connect OpenGL ES to the View system.Providing the glue code to make OpenGL ES work with the Activity life-cycle.Making it easy to choose an appropriate frame buffer pixel format.Creating and managing a separate rendering thread to enable smooth animation.Providing easy-to-use debugging tools for tracing OpenGL ES API calls and checking for errors.

GLSurfaceView is a good base for building an application that uses OpenGL ES for part or all of its rendering. A 2D or 3D action game would be a good candidate, as would a 2D or 3D data visualization application such as Google Maps StreetView. The Simplest GLSurfaceView Application Here's the source code to the simplest possible OpenGL ES application: package com.example.android.apis.graphics; import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.opengles.GL10; How about User Input? Workaround to losing the OpenGL context when Android pauses.

How to make GLSurfaceView show smoothly - Google Groupes. How to get OpenGL screenshot ? Useful programing hint.