Graphics Reference
In-Depth Information
EGLContext context = eglCreateContext ( display, config,
EGL_NO_CONTEXT,
contextAttribs);
if ( context == EGL_NO_CONTEXT )
{
return EGL_FALSE;
}
if ( !eglMakeCurrent ( display, window, window, context ) )
{
return EGL_FALSE;
}
return EGL_TRUE;
}
This code would be similar if an application made the call in Example 3-8
to open a 512 × 512 window.
Example 3-8
Creating a Window Using the
esUtil
Library
ESContext esContext;
const char* title = "OpenGL ES Application Window Title";
if (esCreateWindow(&esContext, title, 512, 512,
ES_WINDOW_RGB | ES_WINDOW_DEPTH))
{
// Window creation failed
}
The last parameter to
esCreateWindow
specifies the characteristics we
want in our window, and specifies as a bitmask of the following values:
•
ES_WINDOW_RGB
—Specify an RGB-based color buffer.
•
ES_WINDOW_ALPHA
—Allocate a destination alpha buffer.
•
ES_WINDOW_DEPTH
—Allocate a depth buffer.
•
ES_WINDOW_STENCIL
—Allocate a stencil buffer.
•
ES_WINDOW_MULTISAMPLE
—Allocate a multisample buffer.