]> git.cworth.org Git - apitrace/commitdiff
Cast native types to EGL types when calling EGL functions.
authorAlexandros Frantzis <alexandros.frantzis@linaro.org>
Fri, 2 Dec 2011 12:22:56 +0000 (14:22 +0200)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 3 Dec 2011 10:02:04 +0000 (10:02 +0000)
This is needed to resolve build failures on some platforms that support
various EGL backends and, therefore, native types.  Note that we can't
use reinterpret_cast<>() as the types involved are not necessarily
pointers or integers e.g. they can be typedef-ed types.

glws_egl_xlib.cpp

index d614d7883882bb96060e957032d7c61a36d11a30..d1277058c4c9fddc5b607ed99aa4f6c9fdccb42e 100644 (file)
@@ -137,7 +137,7 @@ public:
         eglWaitNative(EGL_CORE_NATIVE_ENGINE);
 
         EGLConfig config = static_cast<const EglVisual *>(visual)->config;
-        surface = eglCreateWindowSurface(eglDisplay, config, window, NULL);
+        surface = eglCreateWindowSurface(eglDisplay, config, (EGLNativeWindowType)window, NULL);
     }
 
     void waitForEvent(int type) {
@@ -245,7 +245,7 @@ init(void) {
 
     screen = DefaultScreen(display);
 
-    eglDisplay = eglGetDisplay(display);
+    eglDisplay = eglGetDisplay((EGLNativeDisplayType)display);
     if (eglDisplay == EGL_NO_DISPLAY) {
         std::cerr << "error: unable to get EGL display\n";
         XCloseDisplay(display);