summaryrefslogtreecommitdiffstats
path: root/video/out/gl_common.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-01 15:55:08 +0100
committerwm4 <wm4@nowhere>2013-03-28 21:46:17 +0100
commit16e951c2cdfa6710f0d5cc77b513e0f2a5f1377d (patch)
tree8c5d12be204f0f03437041b31cf7fb7272101b7f /video/out/gl_common.h
parent3374a43998f183b585640de0a588db2431ed87ae (diff)
downloadmpv-16e951c2cdfa6710f0d5cc77b513e0f2a5f1377d.tar.bz2
mpv-16e951c2cdfa6710f0d5cc77b513e0f2a5f1377d.tar.xz
gl_common: split into platform specific files
Do this instead of stuffing all x11/cocoa/win32/wayland specific code into gl_common.c. The cocoa specific parts could probably go directly into cocoa_common.m, possibly same with wayland. Also redo how the list of backends is managed. Get rid of the GLTYPE_ constants. Instead of having a big switch() on GLTYPE_, each backend entry has a function pointer to setup the MPGLContext callback (e.g. mpgl_set_backend_x11()).
Diffstat (limited to 'video/out/gl_common.h')
-rw-r--r--video/out/gl_common.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/video/out/gl_common.h b/video/out/gl_common.h
index 0150e9319c..1f28d87855 100644
--- a/video/out/gl_common.h
+++ b/video/out/gl_common.h
@@ -73,14 +73,6 @@ void glEnable3DLeft(GL *gl, int type);
void glEnable3DRight(GL *gl, int type);
void glDisable3D(GL *gl, int type);
-enum MPGLType {
- GLTYPE_AUTO,
- GLTYPE_COCOA,
- GLTYPE_W32,
- GLTYPE_X11,
- GLTYPE_WAYLAND,
-};
-
enum {
MPGL_CAP_GL = (1 << 0), // GL was successfully loaded
MPGL_CAP_GL_LEGACY = (1 << 1), // GL 1.1 (but not 3.x)
@@ -104,7 +96,6 @@ enum {
typedef struct MPGLContext {
GL *gl;
- enum MPGLType type;
struct vo *vo;
// Bit size of each component in the created framebuffer. 0 if unknown.
@@ -142,9 +133,7 @@ typedef struct MPGLContext {
void *priv;
} MPGLContext;
-int mpgl_find_backend(const char *name);
-
-MPGLContext *mpgl_init(enum MPGLType type, struct vo *vo);
+MPGLContext *mpgl_init(struct vo *vo, const char *backend_name);
void mpgl_uninit(MPGLContext *ctx);
// Create a VO window and create a GL context on it.
@@ -155,6 +144,18 @@ void mpgl_uninit(MPGLContext *ctx);
bool mpgl_config_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width,
uint32_t d_height, uint32_t flags);
+int mpgl_find_backend(const char *name);
+
+void mpgl_set_backend_cocoa(MPGLContext *ctx);
+void mpgl_set_backend_w32(MPGLContext *ctx);
+void mpgl_set_backend_x11(MPGLContext *ctx);
+void mpgl_set_backend_wayland(MPGLContext *ctx);
+
+void *mp_getdladdr(const char *s);
+
+void mpgl_load_functions(GL *gl, void *(*getProcAddress)(const GLubyte *),
+ const char *ext2);
+
// print a multi line string with line numbers (e.g. for shader sources)
// mod, lev: module and log level, as in mp_msg()
void mp_log_source(int mod, int lev, const char *src);