We will not go into all the details about the OpenGL ES programming here, and will instead focus on a minimal application (App3
) that should initialize the GLView
in Java; create fragment and vertex programs, create and fill the vertex array consisting of two triangles that form a single quadrilateral, and then render them with a texture, which is updated from g_FrameBuffer
contents. This is it—just draw the offscreen framebuffer. The following is the code to draw the full-screen quad textured with the offscreen buffer content:
These attribute variables are declared in a vertex shader. See the value of g_vShaderStr[]
in the preceding code.
We also need a few JNI callbacks. The first one handles the surface size changes, as seen in the following code:
Disable mip-mapping through the following code:
The second callback does the actual frame rendering:
Invoke our frame rendering callback through the following code: