Graphics Reference
In-Depth Information
Example 2-1
Hello_Triangle.c Example (continued)
int esMain( ESContext *esContext )
{
esContext->userData = malloc ( sizeof( UserData ) );
esCreateWindow ( esContext, "Hello Triangle", 320, 240,
ES_WINDOW_RGB );
if ( !Init ( esContext ) )
return GL_FALSE;
esRegisterShutdownFunc( esContext, Shutdown );
esRegisterDrawFunc ( esContext, Draw );
return GL_TRUE;
}
The remainder of this chapter describes the code in this example. If you
run the Hello Triangle example, you should see the window shown in
Figure 2-1. Instructions on how to build and run the sample code for
Windows, Linux, Android 4.3+, and iOS are provided in Chapter 16,
“OpenGL ES Platforms.” Please refer to the instructions in that chapter for
your platform to get up and running with the sample code.
Figure 2-1
Hello Triangle Example
The standard GL3 ( GLES3/gl3.h ) and EGL ( EGL/egl.h ) header files
provided by Khronos are used as an interface to OpenGL ES 3.0 and EGL.
The OpenGL ES 3.0 examples are organized in the following directories:
Common /—Contains the OpenGL ES 3.0 Framework project, code, and
the emulator.
chapter_x /—Contains the example programs for each chapter.
 
 
Search WWH ::




Custom Search