Game Development Reference
In-Depth Information
Now the usage of OpenGL is entirely transparent, and our application is completely unaware
of what lavor of OpenGL is actually in use. Look at the OpenGL3.cpp ile:
#include <stdlib.h>
#include "LGL.h"
sLGLAPI* LGL3 = NULL;
void OnDrawFrame()
{
LGL3->glClearColor( 1.0, 0.0, 0.0, 0.0 );
LGL3->glClear( GL_COLOR_BUFFER_BIT );
}
This code runs identically on Windows and Android.
There's moreā€¦
The Android version of the 2_OpenGLES2 example can be built with the following commands:
>ndk-build
>ant copy-common-media debug
Running the app will paint the entire screen in red, and output the surface size into the
system log:
W/GLView ( 3581): creating OpenGL ES 2.0 context
I/App13 ( 3581): SurfaceSize: 1196 x 720
There are other differences in OpenGL 3 Core Proile, OpenGL ES 2, and OpenGL ES 3 that
cannot be abstracted by mimicking all of the API function calls. This includes different syntax
of GLSL shaders, and the mandatory usage of vertex array objects (VAO) in OpenGL 3.2 Core
Proile, which are absent from OpenGL ES 2.
See also
F Unifying the GLSL 3 and GLSL ES 2 shaders
F Manipulating geometry
F Unifying vertex arrays
F Creating a wrapper for textures
 
Search WWH ::




Custom Search