21 #include "../../SDL_internal.h" 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) {
150 DirectFB_GL_UnloadLibrary(
_THIS)
155 SDL_DFB_ERR(
"Error #%d trying to unload library.\n", ret);
164 DirectFB_GL_GetProcAddress(
_THIS,
const char *proc)
169 return GL_LoadFunction(handle, proc);
183 if (!context->context)
186 context->is_locked = 0;
187 context->sdl_window =
window;
194 if (DirectFB_GL_MakeCurrent(
_this, window, context) < 0) {
195 DirectFB_GL_DeleteContext(
_this, context);
208 DirectFB_GLContext *
ctx = (DirectFB_GLContext *) context;
209 DirectFB_GLContext *
p;
231 DirectFB_GL_SetSwapInterval(
_THIS,
int interval)
237 DirectFB_GL_GetSwapInterval(
_THIS)
246 DirectFB_GLContext *
p;
249 if (devdata->glFinish)
251 else if (devdata->glFlush)
256 if (p->sdl_window == window && p->is_locked)
262 SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,
NULL, DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC ));
271 DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
272 DirectFB_GLContext *
p;
278 for (p =
_this->
gl_data->firstgl; p && p->next != ctx; p = p->next)
291 DirectFB_GLContext *
p;
294 if (p->sdl_window == window)
305 DirectFB_GLContext *
p;
308 if (p->sdl_window == window)
321 DirectFB_GLContext *
p;
324 if (p->sdl_window == window)
325 DirectFB_GL_DeleteContext(
_this, p);
GLAPI void GLAPIENTRY glFinish(void)
#define SDL_DFB_RELEASE(x)
struct SDL_GLDriverData * gl_data
static SDL_VideoDevice * _this
void * SDL_GLContext
An opaque handle to an OpenGL context.
GLAPI void GLAPIENTRY glFlush(void)
EGLImageKHR EGLint EGLint * handle
#define SDL_OutOfMemory()
#define SDL_DFB_ALLOC_CLEAR(r, s)
#define SDL_DFB_ERR(x...)
#define SDL_DFB_CHECKERR(x...)
#define SDL_DFB_WINDOWDATA(win)
EGLSurface EGLNativeWindowType * window
#define SDL_DFB_CHECK(x...)
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
The type used to identify a window.
#define SDL_DFB_DEBUG(x...)
#define SDL_arraysize(array)
GLsizei const GLchar *const * path
struct SDL_VideoDevice::@34 gl_config
#define SDL_Unsupported()