src/video/x11/SDL_x11opengles.h
changeset 7659 ac4ce59c40e7
parent 6885 700f1b25f77f
child 7986 ffb7bf531644
equal deleted inserted replaced
7658:4033ba4fcc31 7659:ac4ce59c40e7
    21 #include "SDL_config.h"
    21 #include "SDL_config.h"
    22 
    22 
    23 #ifndef _SDL_x11opengles_h
    23 #ifndef _SDL_x11opengles_h
    24 #define _SDL_x11opengles_h
    24 #define _SDL_x11opengles_h
    25 
    25 
    26 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
    26 #if SDL_VIDEO_OPENGL_EGL
    27 #include <GLES/gl.h>
       
    28 #include <GLES/egl.h>
       
    29 #include <dlfcn.h>
       
    30 #if defined(__OpenBSD__) && !defined(__ELF__)
       
    31 #define dlsym(x,y) dlsym(x, "_" y)
       
    32 #endif
       
    33 
    27 
    34 #include "../SDL_sysvideo.h"
    28 #include "../SDL_sysvideo.h"
       
    29 #include "../SDL_egl.h"
    35 
    30 
    36 typedef struct SDL_PrivateGLESData
    31 typedef struct SDL_PrivateGLESData
    37 {
    32 {
    38     XVisualInfo *egl_visualinfo;
       
    39     void *egl_dll_handle;
       
    40     EGLDisplay egl_display;
       
    41     EGLContext egl_context;     /* Current GLES context */
       
    42     EGLSurface egl_surface;
       
    43     EGLConfig egl_config;
       
    44     int egl_swapinterval;
       
    45 
       
    46       EGLDisplay(*eglGetDisplay) (NativeDisplayType display);
       
    47       EGLBoolean(*eglInitialize) (EGLDisplay dpy, EGLint * major,
       
    48                                   EGLint * minor);
       
    49       EGLBoolean(*eglTerminate) (EGLDisplay dpy);
       
    50 
       
    51     void *(*eglGetProcAddress) (const char * procName);
       
    52 
       
    53       EGLBoolean(*eglChooseConfig) (EGLDisplay dpy,
       
    54                                     const EGLint * attrib_list,
       
    55                                     EGLConfig * configs,
       
    56                                     EGLint config_size, EGLint * num_config);
       
    57 
       
    58       EGLContext(*eglCreateContext) (EGLDisplay dpy,
       
    59                                      EGLConfig config,
       
    60                                      EGLContext share_list,
       
    61                                      const EGLint * attrib_list);
       
    62 
       
    63       EGLBoolean(*eglDestroyContext) (EGLDisplay dpy, EGLContext ctx);
       
    64 
       
    65       EGLSurface(*eglCreateWindowSurface) (EGLDisplay dpy,
       
    66                                            EGLConfig config,
       
    67                                            NativeWindowType window,
       
    68                                            const EGLint * attrib_list);
       
    69       EGLBoolean(*eglDestroySurface) (EGLDisplay dpy, EGLSurface surface);
       
    70 
       
    71       EGLBoolean(*eglMakeCurrent) (EGLDisplay dpy, EGLSurface draw,
       
    72                                    EGLSurface read, EGLContext ctx);
       
    73 
       
    74       EGLBoolean(*eglSwapBuffers) (EGLDisplay dpy, EGLSurface draw);
       
    75 
       
    76       EGLBoolean(*eglSwapInterval) (EGLDisplay dpy, EGLint interval);
       
    77 
       
    78     const char *(*eglQueryString) (EGLDisplay dpy, EGLint name);
       
    79 
       
    80       EGLBoolean(*eglGetConfigAttrib) (EGLDisplay dpy, EGLConfig config,
       
    81                                        EGLint attribute, EGLint * value);
       
    82 
       
    83 } SDL_PrivateGLESData;
    33 } SDL_PrivateGLESData;
    84 
    34 
    85 /* OpenGLES functions */
    35 /* OpenGLES functions */
       
    36 #define X11_GLES_GetAttribute SDL_EGL_GetAttribute
       
    37 #define X11_GLES_GetProcAddress SDL_EGL_GetProcAddress
       
    38 #define X11_GLES_UnloadLibrary SDL_EGL_UnloadLibrary
       
    39 #define X11_GLES_SetSwapInterval SDL_EGL_SetSwapInterval
       
    40 #define X11_GLES_GetSwapInterval SDL_EGL_GetSwapInterval
       
    41 #define X11_GLES_DeleteContext SDL_EGL_DeleteContext
       
    42 
       
    43 extern int X11_GLES_LoadLibrary(_THIS, const char *path);
       
    44 extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
    86 extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
    45 extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
    87 extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
    46 extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
    88 extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window,
    47 extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context);
    89                                 SDL_GLContext context);
       
    90 extern int X11_GLES_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
       
    91 extern int X11_GLES_LoadLibrary(_THIS, const char *path);
       
    92 extern void *X11_GLES_GetProcAddress(_THIS, const char *proc);
       
    93 extern void X11_GLES_UnloadLibrary(_THIS);
       
    94 
    48 
    95 extern int X11_GLES_SetSwapInterval(_THIS, int interval);
    49 #endif /* SDL_VIDEO_OPENGL_EGL */
    96 extern int X11_GLES_GetSwapInterval(_THIS);
       
    97 extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
       
    98 extern void X11_GLES_DeleteContext(_THIS, SDL_GLContext context);
       
    99 
       
   100 #endif /* SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2 */
       
   101 
    50 
   102 #endif /* _SDL_x11opengles_h */
    51 #endif /* _SDL_x11opengles_h */
   103 
    52 
   104 /* vi: set ts=4 sw=4 expandtab: */
    53 /* vi: set ts=4 sw=4 expandtab: */