- fprintf(stderr, "EGL error %d (%s): %s\n", e, eglErrorToString(e), what);
- exit(1);
+ die("EGL error %d (%s): %s\n", e, eglErrorToString(e), what);
EGLint eglMajor, eglMinor;
display = eglGetDisplay(xDisplay);
if (display == EGL_NO_DISPLAY)
EGLint eglMajor, eglMinor;
display = eglGetDisplay(xDisplay);
if (display == EGL_NO_DISPLAY)
printf("Using EGL version: %d.%d\n", eglMajor, eglMinor);
if (eglMajor == 1 && eglMinor < 3) {
// Choosing the GL context version requires EGL 1.3
printf("Using EGL version: %d.%d\n", eglMajor, eglMinor);
if (eglMajor == 1 && eglMinor < 3) {
// Choosing the GL context version requires EGL 1.3
// get an appropriate config
EGLConfig configs[1];
EGLint count;
if (eglChooseConfig(display, configAttribs, configs, 1, &count) == EGL_FALSE){
// get an appropriate config
EGLConfig configs[1];
EGLint count;
if (eglChooseConfig(display, configAttribs, configs, 1, &count) == EGL_FALSE){
// create an EGL context and use it with the surface
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
if (context == EGL_NO_CONTEXT)
// create an EGL context and use it with the surface
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs);
if (context == EGL_NO_CONTEXT)
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
printf("Using GL version: %s\n", glGetString(GL_VERSION));
// initialise GL utilities
resolveFunctionPointers(eglGetProcAddress);
printf("Using GL version: %s\n", glGetString(GL_VERSION));
// initialise GL utilities
resolveFunctionPointers(eglGetProcAddress);
{
assert(context != EGL_NO_CONTEXT); // this implies the display is also initialized
if (eglSwapBuffers(display, surface) == EGL_FALSE)
{
assert(context != EGL_NO_CONTEXT); // this implies the display is also initialized
if (eglSwapBuffers(display, surface) == EGL_FALSE)
- fprintf(stderr, "Cannot set swap interval to %d, must not be negative\n", i);
- exit(1);
+ die("Cannot set swap interval to %d, must not be negative\n", i);
}
EGLint val;
eglGetConfigAttrib(display, config, EGL_MAX_SWAP_INTERVAL, &val);
if (i > val) {
}
EGLint val;
eglGetConfigAttrib(display, config, EGL_MAX_SWAP_INTERVAL, &val);
if (i > val) {
- fprintf(stderr, "Cannot set swap interval to %d, maximum supported value is %d\n", i, val);
- exit(1);
+ die("Cannot set swap interval to %d, maximum supported value is %d\n", i, val);