Commit b8af88fc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

glx: reorder to avoid forward declarations

parent f0a14143
......@@ -35,18 +35,6 @@
#include <vlc_vout_window.h>
#include <vlc_xlib.h>
static int Open (vlc_object_t *);
static void Close (vlc_object_t *);
vlc_module_begin ()
set_shortname (N_("GLX"))
set_description (N_("GLX extension for OpenGL"))
set_category (CAT_VIDEO)
set_subcategory (SUBCAT_VIDEO_VOUT)
set_capability ("opengl", 20)
set_callbacks (Open, Close)
vlc_module_end ()
typedef struct vlc_gl_sys_t
{
Display *display;
......@@ -54,10 +42,38 @@ typedef struct vlc_gl_sys_t
GLXContext ctx;
} vlc_gl_sys_t;
static int MakeCurrent (vlc_gl_t *);
static void ReleaseCurrent (vlc_gl_t *);
static void SwapBuffers (vlc_gl_t *);
static void *GetSymbol(vlc_gl_t *, const char *);
static int MakeCurrent (vlc_gl_t *gl)
{
vlc_gl_sys_t *sys = gl->sys;
if (!glXMakeContextCurrent (sys->display, sys->win, sys->win, sys->ctx))
return VLC_EGENERIC;
return VLC_SUCCESS;
}
static void ReleaseCurrent (vlc_gl_t *gl)
{
vlc_gl_sys_t *sys = gl->sys;
glXMakeContextCurrent (sys->display, None, None, NULL);
}
static void SwapBuffers (vlc_gl_t *gl)
{
vlc_gl_sys_t *sys = gl->sys;
glXSwapBuffers (sys->display, sys->win);
}
static void *GetSymbol(vlc_gl_t *gl, const char *procname)
{
(void) gl;
#ifdef GLX_ARB_get_proc_address
return glXGetProcAddressARB ((const GLubyte *)procname);
#else
return NULL;
#endif
}
static bool CheckGLX (vlc_object_t *vd, Display *dpy)
{
......@@ -242,35 +258,11 @@ static void Close (vlc_object_t *obj)
free (sys);
}
static int MakeCurrent (vlc_gl_t *gl)
{
vlc_gl_sys_t *sys = gl->sys;
if (!glXMakeContextCurrent (sys->display, sys->win, sys->win, sys->ctx))
return VLC_EGENERIC;
return VLC_SUCCESS;
}
static void ReleaseCurrent (vlc_gl_t *gl)
{
vlc_gl_sys_t *sys = gl->sys;
glXMakeContextCurrent (sys->display, None, None, NULL);
}
static void SwapBuffers (vlc_gl_t *gl)
{
vlc_gl_sys_t *sys = gl->sys;
glXSwapBuffers (sys->display, sys->win);
}
static void *GetSymbol(vlc_gl_t *gl, const char *procname)
{
(void) gl;
#ifdef GLX_ARB_get_proc_address
return glXGetProcAddressARB ((const GLubyte *)procname);
#else
return NULL;
#endif
}
vlc_module_begin ()
set_shortname (N_("GLX"))
set_description (N_("GLX extension for OpenGL"))
set_category (CAT_VIDEO)
set_subcategory (SUBCAT_VIDEO_VOUT)
set_capability ("opengl", 20)
set_callbacks (Open, Close)
vlc_module_end ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment