Tuesday, May 24, 2011

eglInitialize example c c++ objc

Name:  
eglInitialize - initialize an EGL display connection

C Specification
EGLBoolean eglInitialize(EGLDisplay display,
    EGLint * major,
    EGLint * minor)

Parameters
display
Specifies the EGL display connection to initialize.
major
Returns the major version number of the EGL implementation. May be NULL.
minor
Returns the minor version number of the EGL implementation. May be NULL.

Description
eglInitialize initialized the EGL display connection obtained with eglGetDisplay. Initializing an already initialized EGL display connection has no effect besides returning the version numbers.
major and minor do not return values if they are specified as NULL.
Use eglTerminate to release resources associated with an EGL display connection.

Errors
EGL_FALSE is returned if eglInitialize fails, EGL_TRUE otherwise. major and minor are not modified when EGL_FALSE is returned.
EGL_BAD_DISPLAY is generated if display is not an EGL display connection.
EGL_NOT_INITIALIZED is generated if display cannot be initialized.

Copyright
Copyright © 2003 Silicon Graphics, Inc.
This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

See Also
eglGetDisplay, eglTerminate

Examples

Example 4.1 shows a default display:
EGLDisplay sEGLDisplay;
// EGL init.
sEGLDisplay = eglGetDisplay((EGLNativeDisplayType) EGL_DEFAULT_DISPLAY);
eglInitialize(sEGLDisplay, NULL, NULL);

Example 4.2 shows a default display:
EGLDisplay sEGLDisplay;
// Window
...
// Create Window
sWindow = CreateWindowEx(... 
// EGL init.
sEGLDisplay = eglGetDisplay(GetDC(sWindow));
eglInitialize(sEGLDisplay, NULL, NULL);