File style cleanup for the SDL 2.0 release
This commit is contained in:
parent
2ac8624930
commit
0cb6385637
376 changed files with 17562 additions and 17773 deletions
|
@ -40,7 +40,7 @@ struct SDL_GLDriverData
|
|||
int gl_active; /* to stop switching drivers while we have a valid context */
|
||||
int initialized;
|
||||
DirectFB_GLContext *firstgl; /* linked list */
|
||||
|
||||
|
||||
/* OpenGL */
|
||||
void (*glFinish) (void);
|
||||
void (*glFlush) (void);
|
||||
|
@ -49,13 +49,13 @@ struct SDL_GLDriverData
|
|||
#define OPENGL_REQUIRS_DLOPEN
|
||||
#if defined(OPENGL_REQUIRS_DLOPEN) && defined(SDL_LOADSO_DLOPEN)
|
||||
#include <dlfcn.h>
|
||||
#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
|
||||
#define GL_LoadFunction dlsym
|
||||
#define GL_UnloadObject dlclose
|
||||
#define GL_LoadObject(X) dlopen(X, (RTLD_NOW|RTLD_GLOBAL))
|
||||
#define GL_LoadFunction dlsym
|
||||
#define GL_UnloadObject dlclose
|
||||
#else
|
||||
#define GL_LoadObject SDL_LoadObject
|
||||
#define GL_LoadFunction SDL_LoadFunction
|
||||
#define GL_UnloadObject SDL_UnloadObject
|
||||
#define GL_LoadObject SDL_LoadObject
|
||||
#define GL_LoadFunction SDL_LoadFunction
|
||||
#define GL_UnloadObject SDL_UnloadObject
|
||||
#endif
|
||||
|
||||
static void DirectFB_GL_UnloadLibrary(_THIS);
|
||||
|
@ -107,8 +107,6 @@ DirectFB_GL_Shutdown(_THIS)
|
|||
int
|
||||
DirectFB_GL_LoadLibrary(_THIS, const char *path)
|
||||
{
|
||||
//SDL_DFB_DEVICEDATA(_this);
|
||||
|
||||
void *handle = NULL;
|
||||
|
||||
SDL_DFB_DEBUG("Loadlibrary : %s\n", path);
|
||||
|
@ -181,7 +179,6 @@ DirectFB_GL_GetProcAddress(_THIS, const char *proc)
|
|||
SDL_GLContext
|
||||
DirectFB_GL_CreateContext(_THIS, SDL_Window * window)
|
||||
{
|
||||
//SDL_DFB_DEVICEDATA(_this);
|
||||
SDL_DFB_WINDOWDATA(window);
|
||||
DirectFB_GLContext *context;
|
||||
|
||||
|
@ -195,7 +192,7 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window)
|
|||
|
||||
context->is_locked = 0;
|
||||
context->sdl_window = window;
|
||||
|
||||
|
||||
context->next = _this->gl_data->firstgl;
|
||||
_this->gl_data->firstgl = context;
|
||||
|
||||
|
@ -215,7 +212,6 @@ DirectFB_GL_CreateContext(_THIS, SDL_Window * window)
|
|||
int
|
||||
DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
|
||||
{
|
||||
//SDL_DFB_WINDOWDATA(window);
|
||||
DirectFB_GLContext *ctx = (DirectFB_GLContext *) context;
|
||||
DirectFB_GLContext *p;
|
||||
|
||||
|
@ -225,7 +221,7 @@ DirectFB_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
|
|||
SDL_DFB_CHECKERR(p->context->Unlock(p->context));
|
||||
p->is_locked = 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (ctx != NULL) {
|
||||
|
@ -253,7 +249,6 @@ DirectFB_GL_GetSwapInterval(_THIS)
|
|||
void
|
||||
DirectFB_GL_SwapWindow(_THIS, SDL_Window * window)
|
||||
{
|
||||
//SDL_DFB_DEVICEDATA(_this);
|
||||
SDL_DFB_WINDOWDATA(window);
|
||||
DFBRegion region;
|
||||
DirectFB_GLContext *p;
|
||||
|
@ -270,20 +265,14 @@ DirectFB_GL_SwapWindow(_THIS, SDL_Window * window)
|
|||
devdata->glFlush();
|
||||
#endif
|
||||
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window && p->is_locked)
|
||||
{
|
||||
SDL_DFB_CHECKERR(p->context->Unlock(p->context));
|
||||
p->is_locked = 0;
|
||||
}
|
||||
}
|
||||
|
||||
SDL_DFB_CHECKERR(windata->window_surface->Flip(windata->window_surface,NULL, DSFLIP_PIPELINE |DSFLIP_BLIT | DSFLIP_ONSYNC ));
|
||||
|
||||
//if (windata->gl_context) {
|
||||
//SDL_DFB_CHECKERR(windata->surface->Flip(windata->surface,NULL, DSFLIP_ONSYNC));
|
||||
//SDL_DFB_CHECKERR(windata->gl_context->context->Lock(windata->gl_context->context));
|
||||
//}
|
||||
|
||||
return;
|
||||
error:
|
||||
return;
|
||||
|
@ -313,14 +302,14 @@ void
|
|||
DirectFB_GL_FreeWindowContexts(_THIS, SDL_Window * window)
|
||||
{
|
||||
DirectFB_GLContext *p;
|
||||
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window)
|
||||
{
|
||||
if (p->is_locked)
|
||||
SDL_DFB_CHECK(p->context->Unlock(p->context));
|
||||
SDL_DFB_RELEASE(p->context);
|
||||
}
|
||||
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window)
|
||||
{
|
||||
if (p->is_locked)
|
||||
SDL_DFB_CHECK(p->context->Unlock(p->context));
|
||||
SDL_DFB_RELEASE(p->context);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -328,15 +317,15 @@ DirectFB_GL_ReAllocWindowContexts(_THIS, SDL_Window * window)
|
|||
{
|
||||
DirectFB_GLContext *p;
|
||||
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window)
|
||||
{
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window)
|
||||
{
|
||||
SDL_DFB_WINDOWDATA(window);
|
||||
SDL_DFB_CHECK(windata->surface->GetGL(windata->surface,
|
||||
&p->context));
|
||||
if (p->is_locked)
|
||||
SDL_DFB_CHECK(p->context->Lock(p->context));
|
||||
}
|
||||
SDL_DFB_CHECK(windata->surface->GetGL(windata->surface,
|
||||
&p->context));
|
||||
if (p->is_locked)
|
||||
SDL_DFB_CHECK(p->context->Lock(p->context));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -344,9 +333,9 @@ DirectFB_GL_DestroyWindowContexts(_THIS, SDL_Window * window)
|
|||
{
|
||||
DirectFB_GLContext *p;
|
||||
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window)
|
||||
DirectFB_GL_DeleteContext(_this, p);
|
||||
for (p = _this->gl_data->firstgl; p != NULL; p = p->next)
|
||||
if (p->sdl_window == window)
|
||||
DirectFB_GL_DeleteContext(_this, p);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue