summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvo/gl_common.c508
-rw-r--r--libvo/gl_common.h158
-rw-r--r--libvo/matrixview.c156
-rw-r--r--libvo/vo_gl.c284
-rw-r--r--libvo/vo_gl2.c38
5 files changed, 572 insertions, 572 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 8895a07781..4933f87a3e 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -35,57 +35,57 @@
#include "gl_common.h"
#include "csputils.h"
-void (GLAPIENTRY *Begin)(GLenum);
-void (GLAPIENTRY *End)(void);
-void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei);
-void (GLAPIENTRY *MatrixMode)(GLenum);
-void (GLAPIENTRY *LoadIdentity)(void);
-void (GLAPIENTRY *Translated)(double, double, double);
-void (GLAPIENTRY *Scaled)(double, double, double);
-void (GLAPIENTRY *Ortho)(double, double, double, double, double, double);
-void (GLAPIENTRY *Frustum)(double, double, double, double, double, double);
-void (GLAPIENTRY *PushMatrix)(void);
-void (GLAPIENTRY *PopMatrix)(void);
-void (GLAPIENTRY *Clear)(GLbitfield);
-GLuint (GLAPIENTRY *GenLists)(GLsizei);
-void (GLAPIENTRY *DeleteLists)(GLuint, GLsizei);
-void (GLAPIENTRY *NewList)(GLuint, GLenum);
-void (GLAPIENTRY *EndList)(void);
-void (GLAPIENTRY *CallList)(GLuint);
-void (GLAPIENTRY *CallLists)(GLsizei, GLenum, const GLvoid *);
-void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *);
-void (GLAPIENTRY *DeleteTextures)(GLsizei, const GLuint *);
-void (GLAPIENTRY *TexEnvf)(GLenum, GLenum, GLfloat);
-void (GLAPIENTRY *TexEnvi)(GLenum, GLenum, GLint);
-void (GLAPIENTRY *Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
-void (GLAPIENTRY *Color3f)(GLfloat, GLfloat, GLfloat);
-void (GLAPIENTRY *Color4f)(GLfloat, GLfloat, GLfloat, GLfloat);
-void (GLAPIENTRY *ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
-void (GLAPIENTRY *ClearDepth)(GLclampd);
-void (GLAPIENTRY *DepthFunc)(GLenum);
-void (GLAPIENTRY *Enable)(GLenum);
-void (GLAPIENTRY *Disable)(GLenum);
-const GLubyte *(GLAPIENTRY *GetString)(GLenum);
-void (GLAPIENTRY *DrawBuffer)(GLenum);
-void (GLAPIENTRY *DepthMask)(GLboolean);
-void (GLAPIENTRY *BlendFunc)(GLenum, GLenum);
-void (GLAPIENTRY *Flush)(void);
-void (GLAPIENTRY *Finish)(void);
-void (GLAPIENTRY *PixelStorei)(GLenum, GLint);
-void (GLAPIENTRY *TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-void (GLAPIENTRY *TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-void (GLAPIENTRY *TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-void (GLAPIENTRY *TexParameteri)(GLenum, GLenum, GLint);
-void (GLAPIENTRY *TexParameterf)(GLenum, GLenum, GLfloat);
-void (GLAPIENTRY *TexParameterfv)(GLenum, GLenum, const GLfloat *);
-void (GLAPIENTRY *TexCoord2f)(GLfloat, GLfloat);
-void (GLAPIENTRY *Vertex2f)(GLfloat, GLfloat);
-void (GLAPIENTRY *Vertex3f)(GLfloat, GLfloat, GLfloat);
-void (GLAPIENTRY *Normal3f)(GLfloat, GLfloat, GLfloat);
-void (GLAPIENTRY *Lightfv)(GLenum, GLenum, const GLfloat *);
-void (GLAPIENTRY *ColorMaterial)(GLenum, GLenum);
-void (GLAPIENTRY *ShadeModel)(GLenum);
-void (GLAPIENTRY *GetIntegerv)(GLenum, GLint *);
+void (GLAPIENTRY *mpglBegin)(GLenum);
+void (GLAPIENTRY *mpglEnd)(void);
+void (GLAPIENTRY *mpglViewport)(GLint, GLint, GLsizei, GLsizei);
+void (GLAPIENTRY *mpglMatrixMode)(GLenum);
+void (GLAPIENTRY *mpglLoadIdentity)(void);
+void (GLAPIENTRY *mpglTranslated)(double, double, double);
+void (GLAPIENTRY *mpglScaled)(double, double, double);
+void (GLAPIENTRY *mpglOrtho)(double, double, double, double, double, double);
+void (GLAPIENTRY *mpglFrustum)(double, double, double, double, double, double);
+void (GLAPIENTRY *mpglPushMatrix)(void);
+void (GLAPIENTRY *mpglPopMatrix)(void);
+void (GLAPIENTRY *mpglClear)(GLbitfield);
+GLuint (GLAPIENTRY *mpglGenLists)(GLsizei);
+void (GLAPIENTRY *mpglDeleteLists)(GLuint, GLsizei);
+void (GLAPIENTRY *mpglNewList)(GLuint, GLenum);
+void (GLAPIENTRY *mpglEndList)(void);
+void (GLAPIENTRY *mpglCallList)(GLuint);
+void (GLAPIENTRY *mpglCallLists)(GLsizei, GLenum, const GLvoid *);
+void (GLAPIENTRY *mpglGenTextures)(GLsizei, GLuint *);
+void (GLAPIENTRY *mpglDeleteTextures)(GLsizei, const GLuint *);
+void (GLAPIENTRY *mpglTexEnvf)(GLenum, GLenum, GLfloat);
+void (GLAPIENTRY *mpglTexEnvi)(GLenum, GLenum, GLint);
+void (GLAPIENTRY *mpglColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
+void (GLAPIENTRY *mpglColor3f)(GLfloat, GLfloat, GLfloat);
+void (GLAPIENTRY *mpglColor4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+void (GLAPIENTRY *mpglClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+void (GLAPIENTRY *mpglClearDepth)(GLclampd);
+void (GLAPIENTRY *mpglDepthFunc)(GLenum);
+void (GLAPIENTRY *mpglEnable)(GLenum);
+void (GLAPIENTRY *mpglDisable)(GLenum);
+const GLubyte *(GLAPIENTRY *mpglGetString)(GLenum);
+void (GLAPIENTRY *mpglDrawBuffer)(GLenum);
+void (GLAPIENTRY *mpglDepthMask)(GLboolean);
+void (GLAPIENTRY *mpglBlendFunc)(GLenum, GLenum);
+void (GLAPIENTRY *mpglFlush)(void);
+void (GLAPIENTRY *mpglFinish)(void);
+void (GLAPIENTRY *mpglPixelStorei)(GLenum, GLint);
+void (GLAPIENTRY *mpglTexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+void (GLAPIENTRY *mpglTexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+void (GLAPIENTRY *mpglTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+void (GLAPIENTRY *mpglTexParameteri)(GLenum, GLenum, GLint);
+void (GLAPIENTRY *mpglTexParameterf)(GLenum, GLenum, GLfloat);
+void (GLAPIENTRY *mpglTexParameterfv)(GLenum, GLenum, const GLfloat *);
+void (GLAPIENTRY *mpglTexCoord2f)(GLfloat, GLfloat);
+void (GLAPIENTRY *mpglVertex2f)(GLfloat, GLfloat);
+void (GLAPIENTRY *mpglVertex3f)(GLfloat, GLfloat, GLfloat);
+void (GLAPIENTRY *mpglNormal3f)(GLfloat, GLfloat, GLfloat);
+void (GLAPIENTRY *mpglLightfv)(GLenum, GLenum, const GLfloat *);
+void (GLAPIENTRY *mpglColorMaterial)(GLenum, GLenum);
+void (GLAPIENTRY *mpglShadeModel)(GLenum);
+void (GLAPIENTRY *mpglGetIntegerv)(GLenum, GLint *);
/**
* \defgroup glextfunctions OpenGL extension functions
@@ -94,43 +94,43 @@ void (GLAPIENTRY *GetIntegerv)(GLenum, GLint *);
* context is created
* \{
*/
-void (GLAPIENTRY *GenBuffers)(GLsizei, GLuint *);
-void (GLAPIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
-void (GLAPIENTRY *BindBuffer)(GLenum, GLuint);
-GLvoid* (GLAPIENTRY *MapBuffer)(GLenum, GLenum);
-GLboolean (GLAPIENTRY *UnmapBuffer)(GLenum);
-void (GLAPIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
-void (GLAPIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
-void (GLAPIENTRY *CombinerParameteri)(GLenum, GLint);
-void (GLAPIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+void (GLAPIENTRY *mpglGenBuffers)(GLsizei, GLuint *);
+void (GLAPIENTRY *mpglDeleteBuffers)(GLsizei, const GLuint *);
+void (GLAPIENTRY *mpglBindBuffer)(GLenum, GLuint);
+GLvoid* (GLAPIENTRY *mpglMapBuffer)(GLenum, GLenum);
+GLboolean (GLAPIENTRY *mpglUnmapBuffer)(GLenum);
+void (GLAPIENTRY *mpglBufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
+void (GLAPIENTRY *mpglCombinerParameterfv)(GLenum, const GLfloat *);
+void (GLAPIENTRY *mpglCombinerParameteri)(GLenum, GLint);
+void (GLAPIENTRY *mpglCombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum);
-void (GLAPIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+void (GLAPIENTRY *mpglCombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum, GLenum, GLboolean, GLboolean,
GLboolean);
-void (GLAPIENTRY *BeginFragmentShader)(void);
-void (GLAPIENTRY *EndFragmentShader)(void);
-void (GLAPIENTRY *SampleMap)(GLuint, GLuint, GLenum);
-void (GLAPIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
+void (GLAPIENTRY *mpglBeginFragmentShader)(void);
+void (GLAPIENTRY *mpglEndFragmentShader)(void);
+void (GLAPIENTRY *mpglSampleMap)(GLuint, GLuint, GLenum);
+void (GLAPIENTRY *mpglColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint);
-void (GLAPIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
+void (GLAPIENTRY *mpglColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint);
-void (GLAPIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *);
-void (GLAPIENTRY *ActiveTexture)(GLenum);
-void (GLAPIENTRY *BindTexture)(GLenum, GLuint);
-void (GLAPIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
-void (GLAPIENTRY *GenPrograms)(GLsizei, GLuint *);
-void (GLAPIENTRY *DeletePrograms)(GLsizei, const GLuint *);
-void (GLAPIENTRY *BindProgram)(GLenum, GLuint);
-void (GLAPIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
-void (GLAPIENTRY *GetProgramiv)(GLenum, GLenum, GLint *);
-void (GLAPIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
+void (GLAPIENTRY *mpglSetFragmentShaderConstant)(GLuint, const GLfloat *);
+void (GLAPIENTRY *mpglActiveTexture)(GLenum);
+void (GLAPIENTRY *mpglBindTexture)(GLenum, GLuint);
+void (GLAPIENTRY *mpglMultiTexCoord2f)(GLenum, GLfloat, GLfloat);
+void (GLAPIENTRY *mpglGenPrograms)(GLsizei, GLuint *);
+void (GLAPIENTRY *mpglDeletePrograms)(GLsizei, const GLuint *);
+void (GLAPIENTRY *mpglBindProgram)(GLenum, GLuint);
+void (GLAPIENTRY *mpglProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
+void (GLAPIENTRY *mpglGetProgramiv)(GLenum, GLenum, GLint *);
+void (GLAPIENTRY *mpglProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
GLfloat, GLfloat);
-int (GLAPIENTRY *SwapInterval)(int);
-void (GLAPIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei,
+int (GLAPIENTRY *mpglSwapInterval)(int);
+void (GLAPIENTRY *mpglTexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei,
GLint, GLenum, GLenum, const GLvoid *);
-void* (GLAPIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float);
-void (GLAPIENTRY *FreeMemoryMESA)(void *, int, void *);
+void* (GLAPIENTRY *mpglAllocateMemoryMESA)(void *, int, size_t, float, float, float);
+void (GLAPIENTRY *mpglFreeMemoryMESA)(void *, int, void *);
/** \} */ // end of glextfunctions group
//! \defgroup glgeneral OpenGL general helper functions
@@ -158,7 +158,7 @@ void glAdjustAlignment(int stride) {
gl_alignment=2;
else
gl_alignment=1;
- PixelStorei(GL_UNPACK_ALIGNMENT, gl_alignment);
+ mpglPixelStorei(GL_UNPACK_ALIGNMENT, gl_alignment);
}
struct gl_name_map_struct {
@@ -360,7 +360,7 @@ typedef struct {
void *fallback;
} extfunc_desc_t;
-#define DEF_FUNC_DESC(name) {&name, NULL, {"gl"#name, NULL}, gl ##name}
+#define DEF_FUNC_DESC(name) {&mpgl##name, NULL, {"gl"#name, NULL}, gl ##name}
static const extfunc_desc_t extfuncs[] = {
// these aren't extension functions but we query them anyway to allow
// different "backends" with one binary
@@ -416,35 +416,35 @@ static const extfunc_desc_t extfuncs[] = {
DEF_FUNC_DESC(GetIntegerv),
// here start the real extensions
- {&GenBuffers, NULL, {"glGenBuffers", "glGenBuffersARB", NULL}},
- {&DeleteBuffers, NULL, {"glDeleteBuffers", "glDeleteBuffersARB", NULL}},
- {&BindBuffer, NULL, {"glBindBuffer", "glBindBufferARB", NULL}},
- {&MapBuffer, NULL, {"glMapBuffer", "glMapBufferARB", NULL}},
- {&UnmapBuffer, NULL, {"glUnmapBuffer", "glUnmapBufferARB", NULL}},
- {&BufferData, NULL, {"glBufferData", "glBufferDataARB", NULL}},
- {&CombinerParameterfv, "NV_register_combiners", {"glCombinerParameterfv", "glCombinerParameterfvNV", NULL}},
- {&CombinerParameteri, "NV_register_combiners", {"glCombinerParameteri", "glCombinerParameteriNV", NULL}},
- {&CombinerInput, "NV_register_combiners", {"glCombinerInput", "glCombinerInputNV", NULL}},
- {&CombinerOutput, "NV_register_combiners", {"glCombinerOutput", "glCombinerOutputNV", NULL}},
- {&BeginFragmentShader, "ATI_fragment_shader", {"glBeginFragmentShaderATI", NULL}},
- {&EndFragmentShader, "ATI_fragment_shader", {"glEndFragmentShaderATI", NULL}},
- {&SampleMap, "ATI_fragment_shader", {"glSampleMapATI", NULL}},
- {&ColorFragmentOp2, "ATI_fragment_shader", {"glColorFragmentOp2ATI", NULL}},
- {&ColorFragmentOp3, "ATI_fragment_shader", {"glColorFragmentOp3ATI", NULL}},
- {&SetFragmentShaderConstant, "ATI_fragment_shader", {"glSetFragmentShaderConstantATI", NULL}},
- {&ActiveTexture, NULL, {"glActiveTexture", "glActiveTextureARB", NULL}},
- {&BindTexture, NULL, {"glBindTexture", "glBindTextureARB", "glBindTextureEXT", NULL}},
- {&MultiTexCoord2f, NULL, {"glMultiTexCoord2f", "glMultiTexCoord2fARB", NULL}},
- {&GenPrograms, "_program", {"glGenProgramsARB", NULL}},
- {&DeletePrograms, "_program", {"glDeleteProgramsARB", NULL}},
- {&BindProgram, "_program", {"glBindProgramARB", NULL}},
- {&ProgramString, "_program", {"glProgramStringARB", NULL}},
- {&GetProgramiv, "_program", {"glGetProgramivARB", NULL}},
- {&ProgramEnvParameter4f, "_program", {"glProgramEnvParameter4fARB", NULL}},
- {&SwapInterval, "_swap_control", {"glXSwapIntervalSGI", "glXSwapInterval", "wglSwapIntervalSGI", "wglSwapInterval", "wglSwapIntervalEXT", NULL}},
- {&TexImage3D, NULL, {"glTexImage3D", NULL}},
- {&AllocateMemoryMESA, "GLX_MESA_allocate_memory", {"glXAllocateMemoryMESA", NULL}},
- {&FreeMemoryMESA, "GLX_MESA_allocate_memory", {"glXFreeMemoryMESA", NULL}},
+ {&mpglGenBuffers, NULL, {"glGenBuffers", "glGenBuffersARB", NULL}},
+ {&mpglDeleteBuffers, NULL, {"glDeleteBuffers", "glDeleteBuffersARB", NULL}},
+ {&mpglBindBuffer, NULL, {"glBindBuffer", "glBindBufferARB", NULL}},
+ {&mpglMapBuffer, NULL, {"glMapBuffer", "glMapBufferARB", NULL}},
+ {&mpglUnmapBuffer, NULL, {"glUnmapBuffer", "glUnmapBufferARB", NULL}},
+ {&mpglBufferData, NULL, {"glBufferData", "glBufferDataARB", NULL}},
+ {&mpglCombinerParameterfv, "NV_register_combiners", {"glCombinerParameterfv", "glCombinerParameterfvNV", NULL}},
+ {&mpglCombinerParameteri, "NV_register_combiners", {"glCombinerParameteri", "glCombinerParameteriNV", NULL}},
+ {&mpglCombinerInput, "NV_register_combiners", {"glCombinerInput", "glCombinerInputNV", NULL}},
+ {&mpglCombinerOutput, "NV_register_combiners", {"glCombinerOutput", "glCombinerOutputNV", NULL}},
+ {&mpglBeginFragmentShader, "ATI_fragment_shader", {"glBeginFragmentShaderATI", NULL}},
+ {&mpglEndFragmentShader, "ATI_fragment_shader", {"glEndFragmentShaderATI", NULL}},
+ {&mpglSampleMap, "ATI_fragment_shader", {"glSampleMapATI", NULL}},
+ {&mpglColorFragmentOp2, "ATI_fragment_shader", {"glColorFragmentOp2ATI", NULL}},
+ {&mpglColorFragmentOp3, "ATI_fragment_shader", {"glColorFragmentOp3ATI", NULL}},
+ {&mpglSetFragmentShaderConstant, "ATI_fragment_shader", {"glSetFragmentShaderConstantATI", NULL}},
+ {&mpglActiveTexture, NULL, {"glActiveTexture", "glActiveTextureARB", NULL}},
+ {&mpglBindTexture, NULL, {"glBindTexture", "glBindTextureARB", "glBindTextureEXT", NULL}},
+ {&mpglMultiTexCoord2f, NULL, {"glMultiTexCoord2f", "glMultiTexCoord2fARB", NULL}},
+ {&mpglGenPrograms, "_program", {"glGenProgramsARB", NULL}},
+ {&mpglDeletePrograms, "_program", {"glDeleteProgramsARB", NULL}},
+ {&mpglBindProgram, "_program", {"glBindProgramARB", NULL}},
+ {&mpglProgramString, "_program", {"glProgramStringARB", NULL}},
+ {&mpglGetProgramiv, "_program", {"glGetProgramivARB", NULL}},
+ {&mpglProgramEnvParameter4f, "_program", {"glProgramEnvParameter4fARB", NULL}},
+ {&mpglSwapInterval, "_swap_control", {"glXSwapIntervalSGI", "glXSwapInterval", "wglSwapIntervalSGI", "wglSwapInterval", "wglSwapIntervalEXT", NULL}},
+ {&mpglTexImage3D, NULL, {"glTexImage3D", NULL}},
+ {&mpglAllocateMemoryMESA, "GLX_MESA_allocate_memory", {"glXAllocateMemoryMESA", NULL}},
+ {&mpglFreeMemoryMESA, "GLX_MESA_allocate_memory", {"glXFreeMemoryMESA", NULL}},
{NULL}
};
@@ -463,11 +463,11 @@ static void getFunctions(void *(*getProcAddress)(const GLubyte *),
getProcAddress = setNull;
// special case, we need glGetString before starting to find the other functions
- GetString = getProcAddress("glGetString");
- if (!GetString)
- GetString = glGetString;
+ mpglGetString = getProcAddress("glGetString");
+ if (!mpglGetString)
+ mpglGetString = glGetString;
- extensions = (const char *)GetString(GL_EXTENSIONS);
+ extensions = (const char *)mpglGetString(GL_EXTENSIONS);
if (!extensions) extensions = "";
if (!ext2) ext2 = "";
allexts = malloc(strlen(extensions) + strlen(ext2) + 2);
@@ -517,16 +517,16 @@ void glCreateClearTex(GLenum target, GLenum fmt, GLenum format, GLenum type, GLi
init = malloc(stride * h);
memset(init, val, stride * h);
glAdjustAlignment(stride);
- PixelStorei(GL_UNPACK_ROW_LENGTH, w);
- TexImage2D(target, 0, fmt, w, h, 0, format, type, init);
- TexParameterf(target, GL_TEXTURE_PRIORITY, 1.0);
- TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter);
- TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter);
- TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ mpglPixelStorei(GL_UNPACK_ROW_LENGTH, w);
+ mpglTexImage2D(target, 0, fmt, w, h, 0, format, type, init);
+ mpglTexParameterf(target, GL_TEXTURE_PRIORITY, 1.0);
+ mpglTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter);
+ mpglTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter);
+ mpglTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ mpglTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// Border texels should not be used with CLAMP_TO_EDGE
// We set a sane default anyway.
- TexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border);
+ mpglTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border);
free(init);
}
@@ -674,13 +674,13 @@ void glUploadTex(GLenum target, GLenum format, GLenum type,
}
// this is not always correct, but should work for MPlayer
glAdjustAlignment(stride);
- PixelStorei(GL_UNPACK_ROW_LENGTH, stride / glFmt2bpp(format, type));
+ mpglPixelStorei(GL_UNPACK_ROW_LENGTH, stride / glFmt2bpp(format, type));
for (; y + slice <= y_max; y += slice) {
- TexSubImage2D(target, 0, x, y, w, slice, format, type, data);
+ mpglTexSubImage2D(target, 0, x, y, w, slice, format, type, data);
data += stride * slice;
}
if (y < y_max)
- TexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data);
+ mpglTexSubImage2D(target, 0, x, y, w, y_max - y, format, type, data);
}
static void fillUVcoeff(GLfloat *ucoef, GLfloat *vcoef,
@@ -714,51 +714,51 @@ static void glSetupYUVCombiners(float uvcos, float uvsin) {
GLfloat ucoef[4];
GLfloat vcoef[4];
GLint i;
- if (!CombinerInput || !CombinerOutput ||
- !CombinerParameterfv || !CombinerParameteri) {
+ if (!mpglCombinerInput || !mpglCombinerOutput ||
+ !mpglCombinerParameterfv || !mpglCombinerParameteri) {
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Combiner functions missing!\n");
return;
}
- GetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &i);
+ mpglGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &i);
if (i < 2)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 2 general combiners needed for YUV combiner support (found %i)\n", i);
- GetIntegerv(GL_MAX_TEXTURE_UNITS, &i);
+ mpglGetIntegerv(GL_MAX_TEXTURE_UNITS, &i);
if (i < 3)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 3 texture units needed for YUV combiner support (found %i)\n", i);
fillUVcoeff(ucoef, vcoef, uvcos, uvsin);
- CombinerParameterfv(GL_CONSTANT_COLOR0_NV, ucoef);
- CombinerParameterfv(GL_CONSTANT_COLOR1_NV, vcoef);
+ mpglCombinerParameterfv(GL_CONSTANT_COLOR0_NV, ucoef);
+ mpglCombinerParameterfv(GL_CONSTANT_COLOR1_NV, vcoef);
// UV first, like this green component cannot overflow
- CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV,
- GL_TEXTURE1, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
- CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV,
- GL_CONSTANT_COLOR0_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
- CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV,
- GL_TEXTURE2, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
- CombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_D_NV,
- GL_CONSTANT_COLOR1_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
- CombinerOutput(GL_COMBINER0_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV,
- GL_SPARE0_NV, GL_SCALE_BY_FOUR_NV, GL_NONE, GL_FALSE,
- GL_FALSE, GL_FALSE);
+ mpglCombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_A_NV,
+ GL_TEXTURE1, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
+ mpglCombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_B_NV,
+ GL_CONSTANT_COLOR0_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
+ mpglCombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_C_NV,
+ GL_TEXTURE2, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
+ mpglCombinerInput(GL_COMBINER0_NV, GL_RGB, GL_VARIABLE_D_NV,
+ GL_CONSTANT_COLOR1_NV, GL_HALF_BIAS_NORMAL_NV, GL_RGB);
+ mpglCombinerOutput(GL_COMBINER0_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV,
+ GL_SPARE0_NV, GL_SCALE_BY_FOUR_NV, GL_NONE, GL_FALSE,
+ GL_FALSE, GL_FALSE);
// stage 2
- CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_A_NV, GL_SPARE0_NV,
- GL_SIGNED_IDENTITY_NV, GL_RGB);
- CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO,
- GL_UNSIGNED_INVERT_NV, GL_RGB);
- CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_C_NV,
- GL_TEXTURE0, GL_SIGNED_IDENTITY_NV, GL_RGB);
- CombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO,
- GL_UNSIGNED_INVERT_NV, GL_RGB);
- CombinerOutput(GL_COMBINER1_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV,
- GL_SPARE0_NV, GL_NONE, GL_NONE, GL_FALSE,
- GL_FALSE, GL_FALSE);
+ mpglCombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_A_NV, GL_SPARE0_NV,
+ GL_SIGNED_IDENTITY_NV, GL_RGB);
+ mpglCombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_B_NV, GL_ZERO,
+ GL_UNSIGNED_INVERT_NV, GL_RGB);
+ mpglCombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_C_NV,
+ GL_TEXTURE0, GL_SIGNED_IDENTITY_NV, GL_RGB);
+ mpglCombinerInput(GL_COMBINER1_NV, GL_RGB, GL_VARIABLE_D_NV, GL_ZERO,
+ GL_UNSIGNED_INVERT_NV, GL_RGB);
+ mpglCombinerOutput(GL_COMBINER1_NV, GL_RGB, GL_DISCARD_NV, GL_DISCARD_NV,
+ GL_SPARE0_NV, GL_NONE, GL_NONE, GL_FALSE,
+ GL_FALSE, GL_FALSE);
// leave final combiner stage in default mode
- CombinerParameteri(GL_NUM_GENERAL_COMBINERS_NV, 2);
+ mpglCombinerParameteri(GL_NUM_GENERAL_COMBINERS_NV, 2);
}
/**
@@ -773,39 +773,39 @@ static void glSetupYUVCombinersATI(float uvcos, float uvsin) {
GLfloat ucoef[4];
GLfloat vcoef[4];
GLint i;
- if (!BeginFragmentShader || !EndFragmentShader ||
- !SetFragmentShaderConstant || !SampleMap ||
- !ColorFragmentOp2 || !ColorFragmentOp3) {
+ if (!mpglBeginFragmentShader || !mpglEndFragmentShader ||
+ !mpglSetFragmentShaderConstant || !mpglSampleMap ||
+ !mpglColorFragmentOp2 || !mpglColorFragmentOp3) {
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Combiner (ATI) functions missing!\n");
return;
}
- GetIntegerv(GL_NUM_FRAGMENT_REGISTERS_ATI, &i);
+ mpglGetIntegerv(GL_NUM_FRAGMENT_REGISTERS_ATI, &i);
if (i < 3)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 3 registers needed for YUV combiner (ATI) support (found %i)\n", i);
- GetIntegerv (GL_MAX_TEXTURE_UNITS, &i);
+ mpglGetIntegerv (GL_MAX_TEXTURE_UNITS, &i);
if (i < 3)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] 3 texture units needed for YUV combiner (ATI) support (found %i)\n", i);
fillUVcoeff(ucoef, vcoef, uvcos, uvsin);
- BeginFragmentShader();
- SetFragmentShaderConstant(GL_CON_0_ATI, ucoef);
- SetFragmentShaderConstant(GL_CON_1_ATI, vcoef);
- SampleMap(GL_REG_0_ATI, GL_TEXTURE0, GL_SWIZZLE_STR_ATI);
- SampleMap(GL_REG_1_ATI, GL_TEXTURE1, GL_SWIZZLE_STR_ATI);
- SampleMap(GL_REG_2_ATI, GL_TEXTURE2, GL_SWIZZLE_STR_ATI);
+ mpglBeginFragmentShader();
+ mpglSetFragmentShaderConstant(GL_CON_0_ATI, ucoef);
+ mpglSetFragmentShaderConstant(GL_CON_1_ATI, vcoef);
+ mpglSampleMap(GL_REG_0_ATI, GL_TEXTURE0, GL_SWIZZLE_STR_ATI);
+ mpglSampleMap(GL_REG_1_ATI, GL_TEXTURE1, GL_SWIZZLE_STR_ATI);
+ mpglSampleMap(GL_REG_2_ATI, GL_TEXTURE2, GL_SWIZZLE_STR_ATI);
// UV first, like this green component cannot overflow
- ColorFragmentOp2(GL_MUL_ATI, GL_REG_1_ATI, GL_NONE, GL_NONE,
- GL_REG_1_ATI, GL_NONE, GL_BIAS_BIT_ATI,
- GL_CON_0_ATI, GL_NONE, GL_BIAS_BIT_ATI);
- ColorFragmentOp3(GL_MAD_ATI, GL_REG_2_ATI, GL_NONE, GL_4X_BIT_ATI,
- GL_REG_2_ATI, GL_NONE, GL_BIAS_BIT_ATI,
- GL_CON_1_ATI, GL_NONE, GL_BIAS_BIT_ATI,
- GL_REG_1_ATI, GL_NONE, GL_NONE);
- ColorFragmentOp2(GL_ADD_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_0_ATI, GL_NONE, GL_NONE,
- GL_REG_2_ATI, GL_NONE, GL_NONE);
- EndFragmentShader();
+ mpglColorFragmentOp2(GL_MUL_ATI, GL_REG_1_ATI, GL_NONE, GL_NONE,
+ GL_REG_1_ATI, GL_NONE, GL_BIAS_BIT_ATI,
+ GL_CON_0_ATI, GL_NONE, GL_BIAS_BIT_ATI);
+ mpglColorFragmentOp3(GL_MAD_ATI, GL_REG_2_ATI, GL_NONE, GL_4X_BIT_ATI,
+ GL_REG_2_ATI, GL_NONE, GL_BIAS_BIT_ATI,
+ GL_CON_1_ATI, GL_NONE, GL_BIAS_BIT_ATI,
+ GL_REG_1_ATI, GL_NONE, GL_NONE);
+ mpglColorFragmentOp2(GL_ADD_ATI, GL_REG_0_ATI, GL_NONE, GL_NONE,
+ GL_REG_0_ATI, GL_NONE, GL_NONE,
+ GL_REG_2_ATI, GL_NONE, GL_NONE);
+ mpglEndFragmentShader();
}
/**
@@ -844,13 +844,13 @@ static void gen_spline_lookup_tex(GLenum unit) {
}
store_weights(0, tex);
store_weights(1, &tex[4 * (LOOKUP_BSPLINE_RES - 1)]);
- ActiveTexture(unit);
- TexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, LOOKUP_BSPLINE_RES, 0, GL_RGBA, GL_FLOAT, tex);
- TexParameterf(GL_TEXTURE_1D, GL_TEXTURE_PRIORITY, 1.0);
- TexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- TexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- TexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(unit);
+ mpglTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16, LOOKUP_BSPLINE_RES, 0, GL_RGBA, GL_FLOAT, tex);
+ mpglTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_PRIORITY, 1.0);
+ mpglTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ mpglTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ mpglTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ mpglActiveTexture(GL_TEXTURE0);
free(tex);
}
@@ -1062,7 +1062,7 @@ static void create_conv_textures(gl_conversion_params_t *params, int *texu, char
break;
case YUV_CONVERSION_FRAGMENT_LOOKUP:
texs[0] = (*texu)++;
- ActiveTexture(GL_TEXTURE0 + texs[0]);
+ mpglActiveTexture(GL_TEXTURE0 + texs[0]);
lookup_data = malloc(4 * LOOKUP_RES);
mp_gen_gamma_map(lookup_data, LOOKUP_RES, params->csp_params.rgamma);
mp_gen_gamma_map(&lookup_data[LOOKUP_RES], LOOKUP_RES, params->csp_params.ggamma);
@@ -1071,31 +1071,31 @@ static void create_conv_textures(gl_conversion_params_t *params, int *texu, char
LOOKUP_RES, 4, 0);
glUploadTex(GL_TEXTURE_2D, GL_LUMINANCE, GL_UNSIGNED_BYTE, lookup_data,
LOOKUP_RES, 0, 0, LOOKUP_RES, 4, 0);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
texs[0] += '0';
break;
case YUV_CONVERSION_FRAGMENT_LOOKUP3D:
{
int sz = LOOKUP_3DRES + 2; // texture size including borders
- if (!TexImage3D) {
+ if (!mpglTexImage3D) {
mp_msg(MSGT_VO, MSGL_ERR, "[gl] Missing 3D texture function!\n");
break;
}
texs[0] = (*texu)++;
- ActiveTexture(GL_TEXTURE0 + texs[0]);
+ mpglActiveTexture(GL_TEXTURE0 + texs[0]);
lookup_data = malloc(3 * sz * sz * sz);
mp_gen_yuv2rgb_map(&params->csp_params, lookup_data, LOOKUP_3DRES);
glAdjustAlignment(sz);
- PixelStorei(GL_UNPACK_ROW_LENGTH, 0);
- TexImage3D(GL_TEXTURE_3D, 0, 3, sz, sz, sz, 1,
- GL_RGB, GL_UNSIGNED_BYTE, lookup_data);
- TexParameterf(GL_TEXTURE_3D, GL_TEXTURE_PRIORITY, 1.0);
- TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
- TexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
- ActiveTexture(GL_TEXTURE0);
+ mpglPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ mpglTexImage3D(GL_TEXTURE_3D, 0, 3, sz, sz, sz, 1,
+ GL_RGB, GL_UNSIGNED_BYTE, lookup_data);
+ mpglTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_PRIORITY, 1.0);
+ mpglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ mpglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ mpglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ mpglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ mpglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP);
+ mpglActiveTexture(GL_TEXTURE0);
texs[0] += '0';
}
break;
@@ -1215,26 +1215,26 @@ static const struct {
int loadGPUProgram(GLenum target, char *prog) {
int i;
GLint cur = 0, max = 0, err = 0;
- if (!ProgramString) {
+ if (!mpglProgramString) {
mp_msg(MSGT_VO, MSGL_ERR, "[gl] Missing GPU program function\n");
return 0;
}
- ProgramString(target, GL_PROGRAM_FORMAT_ASCII, strlen(prog), prog);
- GetIntegerv(GL_PROGRAM_ERROR_POSITION, &err);
+ mpglProgramString(target, GL_PROGRAM_FORMAT_ASCII, strlen(prog), prog);
+ mpglGetIntegerv(GL_PROGRAM_ERROR_POSITION, &err);
if (err != -1) {
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] Error compiling fragment program, make sure your card supports\n"
"[gl] GL_ARB_fragment_program (use glxinfo to check).\n"
"[gl] Error message:\n %s at %.10s\n",
- GetString(GL_PROGRAM_ERROR_STRING), &prog[err]);
+ mpglGetString(GL_PROGRAM_ERROR_STRING), &prog[err]);
return 0;
}
- if (!GetProgramiv || !mp_msg_test(MSGT_VO, MSGL_DBG2))
+ if (!mpglGetProgramiv || !mp_msg_test(MSGT_VO, MSGL_DBG2))
return 1;
mp_msg(MSGT_VO, MSGL_V, "[gl] Program statistics:\n");
for (i = 0; progstats[i].name; i++) {
- GetProgramiv(target, progstats[i].cur, &cur);
- GetProgramiv(target, progstats[i].max, &max);
+ mpglGetProgramiv(target, progstats[i].cur, &cur);
+ mpglGetProgramiv(target, progstats[i].max, &max);
mp_msg(MSGT_VO, MSGL_V, "[gl] %s: %i/%i\n", progstats[i].name, cur, max);
}
return 1;
@@ -1274,12 +1274,12 @@ static void glSetupYUVFragprog(gl_conversion_params_t *params) {
memcpy(chrom_scale_texs, lum_scale_texs, sizeof(chrom_scale_texs));
else
create_scaler_textures(YUV_CHROM_SCALER(type), &cur_texu, chrom_scale_texs);
- GetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &i);
+ mpglGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &i);
if (i < cur_texu)
mp_msg(MSGT_VO, MSGL_ERR,
"[gl] %i texture units needed for this type of YUV fragment support (found %i)\n",
cur_texu, i);
- if (!ProgramString) {
+ if (!mpglProgramString) {
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] ProgramString function missing!\n");
return;
}
@@ -1368,27 +1368,27 @@ void glSetupYUVConversion(gl_conversion_params_t *params) {
void glEnableYUVConversion(GLenum target, int type) {
switch (YUV_CONVERSION(type)) {
case YUV_CONVERSION_COMBINERS:
- ActiveTexture(GL_TEXTURE1);
- Enable(target);
- ActiveTexture(GL_TEXTURE2);
- Enable(target);
- ActiveTexture(GL_TEXTURE0);
- Enable(GL_REGISTER_COMBINERS_NV);
+ mpglActiveTexture(GL_TEXTURE1);
+ mpglEnable(target);
+ mpglActiveTexture(GL_TEXTURE2);
+ mpglEnable(target);
+ mpglActiveTexture(GL_TEXTURE0);
+ mpglEnable(GL_REGISTER_COMBINERS_NV);
break;
case YUV_CONVERSION_COMBINERS_ATI:
- ActiveTexture(GL_TEXTURE1);
- Enable(target);
- ActiveTexture(GL_TEXTURE2);
- Enable(target);
- ActiveTexture(GL_TEXTURE0);
- Enable(GL_FRAGMENT_SHADER_ATI);
+ mpglActiveTexture(GL_TEXTURE1);
+ mpglEnable(target);
+ mpglActiveTexture(GL_TEXTURE2);
+ mpglEnable(target);
+ mpglActiveTexture(GL_TEXTURE0);
+ mpglEnable(GL_FRAGMENT_SHADER_ATI);
break;
case YUV_CONVERSION_FRAGMENT_LOOKUP3D:
case YUV_CONVERSION_FRAGMENT_LOOKUP:
case YUV_CONVERSION_FRAGMENT_POW:
case YUV_CONVERSION_FRAGMENT:
case YUV_CONVERSION_NONE:
- Enable(GL_FRAGMENT_PROGRAM);
+ mpglEnable(GL_FRAGMENT_PROGRAM);
break;
}
}
@@ -1402,27 +1402,27 @@ void glEnableYUVConversion(GLenum target, int type) {
void glDisableYUVConversion(GLenum target, int type) {
switch (YUV_CONVERSION(type)) {
case YUV_CONVERSION_COMBINERS:
- ActiveTexture(GL_TEXTURE1);
- Disable(target);
- ActiveTexture(GL_TEXTURE2);
- Disable(target);
- ActiveTexture(GL_TEXTURE0);
- Disable(GL_REGISTER_COMBINERS_NV);
+ mpglActiveTexture(GL_TEXTURE1);
+ mpglDisable(target);
+ mpglActiveTexture(GL_TEXTURE2);
+ mpglDisable(target);
+ mpglActiveTexture(GL_TEXTURE0);
+ mpglDisable(GL_REGISTER_COMBINERS_NV);
break;
case YUV_CONVERSION_COMBINERS_ATI:
- ActiveTexture(GL_TEXTURE1);
- Disable(target);
- ActiveTexture(GL_TEXTURE2);
- Disable(target);
- ActiveTexture(GL_TEXTURE0);
- Disable(GL_FRAGMENT_SHADER_ATI);
+ mpglActiveTexture(GL_TEXTURE1);
+ mpglDisable(target);
+ mpglActiveTexture(GL_TEXTURE2);
+ mpglDisable(target);
+ mpglActiveTexture(GL_TEXTURE0);
+ mpglDisable(GL_FRAGMENT_SHADER_ATI);
break;
case YUV_CONVERSION_FRAGMENT_LOOKUP3D:
case YUV_CONVERSION_FRAGMENT_LOOKUP:
case YUV_CONVERSION_FRAGMENT_POW:
case YUV_CONVERSION_FRAGMENT:
case YUV_CONVERSION_NONE:
- Disable(GL_FRAGMENT_PROGRAM);
+ mpglDisable(GL_FRAGMENT_PROGRAM);
break;
}
}
@@ -1461,32 +1461,32 @@ void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h,
y += h;
h = -h;
}
- Begin(GL_QUADS);
- TexCoord2f(tx, ty);
+ mpglBegin(GL_QUADS);
+ mpglTexCoord2f(tx, ty);
if (is_yv12) {
- MultiTexCoord2f(GL_TEXTURE1, tx2, ty2);
- MultiTexCoord2f(GL_TEXTURE2, tx2, ty2);
+ mpglMultiTexCoord2f(GL_TEXTURE1, tx2, ty2);
+ mpglMultiTexCoord2f(GL_TEXTURE2, tx2, ty2);
}
- Vertex2f(x, y);
- TexCoord2f(tx, ty + th);
+ mpglVertex2f(x, y);
+ mpglTexCoord2f(tx, ty + th);
if (is_yv12) {
- MultiTexCoord2f(GL_TEXTURE1, tx2, ty2 + th2);
- MultiTexCoord2f(GL_TEXTURE2, tx2, ty2 + th2);
+ mpglMultiTexCoord2f(GL_TEXTURE1, tx2, ty2 + th2);
+ mpglMultiTexCoord2f(GL_TEXTURE2, tx2, ty2 + th2);
}
- Vertex2f(x, y + h);
- TexCoord2f(tx + tw, ty + th);
+ mpglVertex2f(x, y + h);
+ mpglTexCoord2f(tx + tw, ty + th);
if (is_yv12) {
- MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2 + th2);
- MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2 + th2);
+ mpglMultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2 + th2);
+ mpglMultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2 + th2);
}
- Vertex2f(x + w, y + h);
- TexCoord2f(tx + tw, ty);
+ mpglVertex2f(x + w, y + h);
+ mpglTexCoord2f(tx + tw, ty);
if (is_yv12) {
- MultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2);
- MultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2);
+ mpglMultiTexCoord2f(GL_TEXTURE1, tx2 + tw2, ty2);
+ mpglMultiTexCoord2f(GL_TEXTURE2, tx2 + tw2, ty2);
}
- Vertex2f(x + w, y);
- End();
+ mpglVertex2f(x + w, y);
+ mpglEnd();
}
#ifdef CONFIG_GL_WIN32
@@ -1519,7 +1519,7 @@ static int setGlWindow_w32(MPGLContext *ctx)
// should only be needed when keeping context, but not doing glFinish
// can cause flickering even when we do not keep it.
if (*context)
- Finish();
+ mpglFinish();
new_vinfo = GetPixelFormat(windc);
if (*context && *vinfo && new_vinfo && *vinfo == new_vinfo) {
// we can keep the wglContext
@@ -1660,7 +1660,7 @@ static int setGlWindow_x11(MPGLContext *ctx)
// should only be needed when keeping context, but not doing glFinish
// can cause flickering even when we do not keep it.
if (*context)
- Finish();
+ mpglFinish();
new_vinfo = getWindowVisualInfo(win);
if (*context && *vinfo && new_vinfo &&
(*vinfo)->visualid == new_vinfo->visualid) {
@@ -1738,7 +1738,7 @@ static void releaseGlContext_x11(MPGLContext *ctx) {
*vinfo = NULL;
if (*context)
{
- Finish();
+ mpglFinish();
glXMakeCurrent(mDisplay, None, NULL);
glXDestroyContext(mDisplay, *context);
}
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index d792dd8a94..d1b78c40bb 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -388,93 +388,93 @@ typedef struct MPGLContext {
int init_mpglcontext(MPGLContext *ctx, enum MPGLType type);
void uninit_mpglcontext(MPGLContext *ctx);
-extern void (GLAPIENTRY *Begin)(GLenum);
-extern void (GLAPIENTRY *End)(void);
-extern void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei);
-extern void (GLAPIENTRY *MatrixMode)(GLenum);
-extern void (GLAPIENTRY *LoadIdentity)(void);
-extern void (GLAPIENTRY *Translated)(double, double, double);
-extern void (GLAPIENTRY *Scaled)(double, double, double);
-extern void (GLAPIENTRY *Ortho)(double, double, double, double, double, double);
-extern void (GLAPIENTRY *Frustum)(double, double, double, double, double, double);
-extern void (GLAPIENTRY *PushMatrix)(void);
-extern void (GLAPIENTRY *PopMatrix)(void);
-extern void (GLAPIENTRY *Clear)(GLbitfield);
-extern GLuint (GLAPIENTRY *GenLists)(GLsizei);
-extern void (GLAPIENTRY *DeleteLists)(GLuint, GLsizei);
-extern void (GLAPIENTRY *NewList)(GLuint, GLenum);
-extern void (GLAPIENTRY *EndList)(void);
-extern void (GLAPIENTRY *CallList)(GLuint);
-extern void (GLAPIENTRY *CallLists)(GLsizei, GLenum, const GLvoid *);
-extern void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *);
-extern void (GLAPIENTRY *DeleteTextures)(GLsizei, const GLuint *);
-extern void (GLAPIENTRY *TexEnvf)(GLenum, GLenum, GLfloat);
-extern void (GLAPIENTRY *TexEnvi)(GLenum, GLenum, GLint);
-extern void (GLAPIENTRY *Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
-extern void (GLAPIENTRY *Color3f)(GLfloat, GLfloat, GLfloat);
-extern void (GLAPIENTRY *Color4f)(GLfloat, GLfloat, GLfloat, GLfloat);