23 #if SDL_VIDEO_DRIVER_DIRECTFB
27 #if SDL_DIRECTFB_OPENGL
32 #include <directfbgl.h>
36 #if SDL_DIRECTFB_OPENGL
42 DirectFB_GLContext *firstgl;
49 #define OPENGL_REQUIRS_DLOPEN
50 #if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
52 #define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
53 #define GL_LoadFunction dlsym
54 #define GL_UnloadObject dlclose
56 #define GL_LoadObject SDL_LoadObject
57 #define GL_LoadFunction SDL_LoadFunction
58 #define GL_UnloadObject SDL_UnloadObject
61 static void DirectFB_GL_UnloadLibrary(
_THIS);
64 DirectFB_GL_Initialize(
_THIS)
82 if (DirectFB_GL_LoadLibrary(
_this,
NULL) < 0) {
95 DirectFB_GL_Shutdown(
_THIS)
101 DirectFB_GL_UnloadLibrary(
_this);
108 DirectFB_GL_LoadLibrary(
_THIS,
const char *
path)
126 handle = GL_LoadObject(path);
127 if (handle ==
NULL) {
151 DirectFB_GL_UnloadLibrary(
_THIS)
160 SDL_DFB_ERR(
"Error #%d trying to unload library.\n", ret);
171 DirectFB_GL_GetProcAddress(
_THIS,
const char *proc)
176 return GL_LoadFunction(handle, proc);
190 if (!context->context)
193 context->is_locked = 0;
194 context->sdl_window = window;
201 if (DirectFB_GL_MakeCurrent(
_this, window, context) < 0) {
202 DirectFB_GL_DeleteContext(
_this, context);
215 DirectFB_GLContext *
ctx = (DirectFB_GLContext *) context;
216 DirectFB_GLContext *
p;
238 DirectFB_GL_SetSwapInterval(
_THIS,
int interval)
244 DirectFB_GL_GetSwapInterval(
_THIS)
254 DirectFB_GLContext *
p;
258 region.x2 = window->
w;
259 region.y2 = window->
h;
262 if (devdata->glFinish)
264 else if (devdata->glFlush)
269 if (p->sdl_window == window && p->is_locked)
275 SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,
NULL, DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC ));
284 DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
285 DirectFB_GLContext *
p;
291 for (p =
_this->
gl_data->firstgl; p && p->next != ctx; p = p->next)
304 DirectFB_GLContext *
p;
307 if (p->sdl_window == window)
318 DirectFB_GLContext *
p;
321 if (p->sdl_window == window)
334 DirectFB_GLContext *
p;
337 if (p->sdl_window == window)
338 DirectFB_GL_DeleteContext(
_this, p);
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size)
DECLSPEC void SDLCALL SDL_free(void *mem)
void * SDL_GLContext
An opaque handle to an OpenGL context.
GLsizei const GLchar *const * path
#define SDL_DFB_RELEASE(x)
struct SDL_GLDriverData * gl_data
static SDL_VideoDevice * _this
DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen)
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
#define SDL_OutOfMemory()
#define SDL_DFB_ALLOC_CLEAR(r, s)
#define SDL_DFB_ERR(x...)
#define SDL_DFB_CHECKERR(x...)
#define SDL_arraysize(array)
#define SDL_DFB_WINDOWDATA(win)
#define SDL_DFB_CHECK(x...)
#define SDL_DFB_DEBUG(x...)
DECLSPEC char *SDLCALL SDL_getenv(const char *name)
EGLImageKHR EGLint EGLint * handle
struct SDL_VideoDevice::@87 gl_config
#define SDL_Unsupported()