[vlc-commits] glx: reorder to avoid forward declarations

Rémi Denis-Courmont git at videolan.org
Sat Sep 13 17:15:59 CEST 2014


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep 13 17:04:48 2014 +0300| [b8af88fc12116a94c1abb54acacd355d32438d70] | committer: Rémi Denis-Courmont

glx: reorder to avoid forward declarations

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b8af88fc12116a94c1abb54acacd355d32438d70
---

 modules/video_output/glx.c |   88 ++++++++++++++++++++------------------------
 1 file changed, 40 insertions(+), 48 deletions(-)

diff --git a/modules/video_output/glx.c b/modules/video_output/glx.c
index 9fc13f5..36bb628 100644
--- a/modules/video_output/glx.c
+++ b/modules/video_output/glx.c
@@ -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 ()



More information about the vlc-commits mailing list