PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/project/jni/sdl-1.3/src/video/x11/SDL_x11opengles.h

https://github.com/aichunyu/FFPlayer
C Header | 94 lines | 56 code | 17 blank | 21 comment | 1 complexity | 5cbee507d6803e93e3b95263bcf5a221 MD5 | raw file
 1/*
 2  Simple DirectMedia Layer
 3  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
 4
 5  This software is provided 'as-is', without any express or implied
 6  warranty.  In no event will the authors be held liable for any damages
 7  arising from the use of this software.
 8
 9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12
13  1. The origin of this software must not be misrepresented; you must not
14     claim that you wrote the original software. If you use this software
15     in a product, an acknowledgment in the product documentation would be
16     appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18     misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20*/
21
22#include <GLES/gl.h>
23#include <GLES/egl.h>
24#include <dlfcn.h>
25#if defined(__OpenBSD__) && !defined(__ELF__)
26#define dlsym(x,y) dlsym(x, "_" y)
27#endif
28
29#include "../SDL_sysvideo.h"
30
31typedef struct SDL_PrivateGLESData
32{
33    int egl_active;             /* to stop switching drivers while we have a valid context */
34    XVisualInfo *egl_visualinfo;
35    void *egl_dll_handle;
36    EGLDisplay egl_display;
37    EGLContext egl_context;     /* Current GLES context */
38    EGLSurface egl_surface;
39    EGLConfig egl_config;
40    int egl_swapinterval;
41
42      EGLDisplay(*eglGetDisplay) (NativeDisplayType display);
43      EGLBoolean(*eglInitialize) (EGLDisplay dpy, EGLint * major,
44                                  EGLint * minor);
45      EGLBoolean(*eglTerminate) (EGLDisplay dpy);
46
47    void *(*eglGetProcAddress) (const char * procName);
48
49      EGLBoolean(*eglChooseConfig) (EGLDisplay dpy,
50                                    const EGLint * attrib_list,
51                                    EGLConfig * configs,
52                                    EGLint config_size, EGLint * num_config);
53
54      EGLContext(*eglCreateContext) (EGLDisplay dpy,
55                                     EGLConfig config,
56                                     EGLContext share_list,
57                                     const EGLint * attrib_list);
58
59      EGLBoolean(*eglDestroyContext) (EGLDisplay dpy, EGLContext ctx);
60
61      EGLSurface(*eglCreateWindowSurface) (EGLDisplay dpy,
62                                           EGLConfig config,
63                                           NativeWindowType window,
64                                           const EGLint * attrib_list);
65      EGLBoolean(*eglDestroySurface) (EGLDisplay dpy, EGLSurface surface);
66
67      EGLBoolean(*eglMakeCurrent) (EGLDisplay dpy, EGLSurface draw,
68                                   EGLSurface read, EGLContext ctx);
69
70      EGLBoolean(*eglSwapBuffers) (EGLDisplay dpy, EGLSurface draw);
71
72      EGLBoolean(*eglSwapInterval) (EGLDisplay dpy, EGLint interval);
73
74    const char *(*eglQueryString) (EGLDisplay dpy, EGLint name);
75
76      EGLBoolean(*eglGetConfigAttrib) (EGLDisplay dpy, EGLConfig config,
77                                       EGLint attribute, EGLint * value);
78
79} SDL_PrivateGLESData;
80
81/* OpenGLES functions */
82extern SDL_GLContext X11_GLES_CreateContext(_THIS, SDL_Window * window);
83extern XVisualInfo *X11_GLES_GetVisual(_THIS, Display * display, int screen);
84extern int X11_GLES_MakeCurrent(_THIS, SDL_Window * window,
85                                SDL_GLContext context);
86extern int X11_GLES_GetAttribute(_THIS, SDL_GLattr attrib, int *value);
87extern int X11_GLES_LoadLibrary(_THIS, const char *path);
88extern void *X11_GLES_GetProcAddress(_THIS, const char *proc);
89extern void X11_GLES_UnloadLibrary(_THIS);
90
91extern int X11_GLES_SetSwapInterval(_THIS, int interval);
92extern int X11_GLES_GetSwapInterval(_THIS);
93extern void X11_GLES_SwapWindow(_THIS, SDL_Window * window);
94extern void X11_GLES_DeleteContext(_THIS, SDL_GLContext context);