src/video/x11/SDL_x11opengles.h
changeset 7659 ac4ce59c40e7
parent 6885 700f1b25f77f
child 7986 ffb7bf531644
     1.1 --- a/src/video/x11/SDL_x11opengles.h	Mon Aug 19 11:02:44 2013 -0400
     1.2 +++ b/src/video/x11/SDL_x11opengles.h	Mon Aug 19 16:29:46 2013 -0300
     1.3 @@ -23,81 +23,30 @@
     1.4  #ifndef _SDL_x11opengles_h
     1.5  #define _SDL_x11opengles_h
     1.6  
     1.7 -#if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
     1.8 -#include <GLES/gl.h>
     1.9 -#include <GLES/egl.h>
    1.10 -#include <dlfcn.h>
    1.11 -#if defined(__OpenBSD__) && !defined(__ELF__)
    1.12 -#define dlsym(x,y) dlsym(x, "_" y)
    1.13 -#endif
    1.14 +#if SDL_VIDEO_OPENGL_EGL
    1.15  
    1.16  #include "../SDL_sysvideo.h"
    1.17 +#include "../SDL_egl.h"
    1.18  
    1.19  typedef struct SDL_PrivateGLESData
    1.20  {
    1.21 -    XVisualInfo *egl_visualinfo;
    1.22 -    void *egl_dll_handle;
    1.23 -    EGLDisplay egl_display;
    1.24 -    EGLContext egl_context;     /* Current GLES context */
    1.25 -    EGLSurface egl_surface;
    1.26 -    EGLConfig egl_config;
    1.27 -    int egl_swapinterval;
    1.28 -
    1.29 -      EGLDisplay(*eglGetDisplay) (NativeDisplayType display);
    1.30 -      EGLBoolean(*eglInitialize) (EGLDisplay dpy, EGLint * major,
    1.31 -                                  EGLint * minor);
    1.32 -      EGLBoolean(*eglTerminate) (EGLDisplay dpy);
    1.33 -
    1.34 -    void *(*eglGetProcAddress) (const char * procName);
    1.35 -
    1.36 -      EGLBoolean(*eglChooseConfig) (EGLDisplay dpy,
    1.37 -                                    const EGLint * attrib_list,
    1.38 -                                    EGLConfig * configs,
    1.39 -                                    EGLint config_size, EGLint * num_config);
    1.40 -
    1.41 -      EGLContext(*eglCreateContext) (EGLDisplay dpy,
    1.42 -                                     EGLConfig config,
    1.43 -                                     EGLContext share_list,
    1.44 -                                     const EGLint * attrib_list);
    1.45 -
    1.46 -      EGLBoolean(*eglDestroyContext) (EGLDisplay dpy, EGLContext ctx);
    1.47 -
    1.48 -      EGLSurface(*eglCreateWindowSurface) (EGLDisplay dpy,
    1.49 -                                           EGLConfig config,
    1.50 -                                           NativeWindowType window,
    1.51 -                                           const EGLint * attrib_list);
    1.52 -      EGLBoolean(*eglDestroySurface) (EGLDisplay dpy, EGLSurface surface);
    1.53 -
    1.54 -      EGLBoolean(*eglMakeCurrent) (EGLDisplay dpy, EGLSurface draw,
    1.55 -                                   EGLSurface read, EGLContext ctx);
    1.56 -
    1.57 -      EGLBoolean(*eglSwapBuffers) (EGLDisplay dpy, EGLSurface draw);
    1.58 -
    1.59 -      EGLBoolean(*eglSwapInterval) (EGLDisplay dpy, EGLint interval);
    1.60 -
    1.61 -    const char *(*eglQueryString) (EGLDisplay dpy, EGLint name);
    1.62 -
    1.63 -      EGLBoolean(*eglGetConfigAttrib) (EGLDisplay dpy, EGLConfig config,
    1.64 -                                       EGLint attribute, EGLint * value);
    1.65 -
    1.66  } SDL_PrivateGLESData;
    1.67  
    1.68  /* OpenGLES functions */
    1.69 +#define X11_GLES_GetAttribute SDL_EGL_GetAttribute
    1.70 +#define X11_GLES_GetProcAddress SDL_EGL_GetProcAddress
    1.71 +#define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
    1.72 +#define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
    1.73 +#define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
    1.74 +#define X11_GLES_DeleteContext SDL_EGL_DeleteContext
    1.75 +
    1.76 +extern int X11_GLES_LoadLibrary(_THIS, const char *path);
    1.77 +extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
    1.78  extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
    1.79 -extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
    1.80 -extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window,
    1.81 -                                SDL_GLContext context);
    1.82 -extern int X11_GLES_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
    1.83 -extern int X11_GLES_LoadLibrary(_THIS, const char *path);
    1.84 -extern void *X11_GLES_GetProcAddress(_THIS, const char *proc);
    1.85 -extern void X11_GLES_UnloadLibrary(_THIS);
    1.86 +extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
    1.87 +extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
    1.88  
    1.89 -extern int X11_GLES_SetSwapInterval(_THIS, int interval);
    1.90 -extern int X11_GLES_GetSwapInterval(_THIS);
    1.91 -extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
    1.92 -extern void X11_GLES_DeleteContext(_THIS, SDL_GLContext context);
    1.93 -
    1.94 -#endif /* SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 */
    1.95 +#endif /* SDL_VIDEO_OPENGL_EGL */
    1.96  
    1.97  #endif /* _SDL_x11opengles_h */
    1.98