April 2015
Beginner to intermediate
494 pages
10h 26m
English
Let's rewrite our
GraphicsManager to initialize an OpenGL ES context:
jni/GraphicsManager.hpp by performing the following:EGL/egl.h to bind OpenGL ES to the Android platform and GLES2/gl2.h to render graphicsstop() to unbind the OpenGL rendering context and free graphics resources when you're leaving the activityEGLDisplay, EGLSurface, and EGLContext member variables, which represent handles to system resources, as shown here:... #include "Types.hpp" #include <android_native_app_glue.h> #include <GLES2/gl2.h> #include <EGL/egl.h> ... class GraphicsManager { public: ... status start(); void stop(); status update(); private: ... int32_t mRenderWidth; int32_t mRenderHeight; ...