[MPlayer-cvslog] r30987 - in trunk/libvo: gl_common.c gl_common.h matrixview.c vo_gl.c vo_gl2.c
reimar
subversion at mplayerhq.hu
Sat Apr 3 09:08:07 CEST 2010
Author: reimar
Date: Sat Apr 3 09:08:07 2010
New Revision: 30987
Log:
Add mpgl prefix to all OpenGL-related function pointers.
This is necessary because at least the GetString symbol
causes clashes on PPC OSX 10.4, causing -vo gl to always
crash.
Modified:
trunk/libvo/gl_common.c
trunk/libvo/gl_common.h
trunk/libvo/matrixview.c
trunk/libvo/vo_gl.c
trunk/libvo/vo_gl2.c
Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c Fri Apr 2 19:29:22 2010 (r30986)
+++ trunk/libvo/gl_common.c Sat Apr 3 09:08:07 2010 (r30987)
@@ -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, G
* 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 *(*getProc
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, GLe
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 f
}
// 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 uv
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
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
}
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_conv
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_conv
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(¶ms->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_conver
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_
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
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, GLf
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 *
// 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 *
// 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(MPGLCon
*vinfo = NULL;
if (*context)
{
- Finish();
+ mpglFinish();
glXMakeCurrent(mDisplay, None, NULL);
glXDestroyContext(mDisplay, *context);
}
Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h Fri Apr 2 19:29:22 2010 (r30986)
+++ trunk/libvo/gl_common.h Sat Apr 3 09:08:07 2010 (r30987)
@@ -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);
-extern void (GLAPIENTRY *ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
-extern void (GLAPIENTRY *ClearDepth)(GLclampd);
-extern void (GLAPIENTRY *DepthFunc)(GLenum);
-extern void (GLAPIENTRY *Enable)(GLenum);
-extern void (GLAPIENTRY *Disable)(GLenum);
-extern const GLubyte *(GLAPIENTRY *GetString)(GLenum);
-extern void (GLAPIENTRY *DrawBuffer)(GLenum);
-extern void (GLAPIENTRY *DepthMask)(GLboolean);
-extern void (GLAPIENTRY *BlendFunc)(GLenum, GLenum);
-extern void (GLAPIENTRY *Flush)(void);
-extern void (GLAPIENTRY *Finish)(void);
-extern void (GLAPIENTRY *PixelStorei)(GLenum, GLint);
-extern void (GLAPIENTRY *TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void (GLAPIENTRY *TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void (GLAPIENTRY *TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
-extern void (GLAPIENTRY *TexParameteri)(GLenum, GLenum, GLint);
-extern void (GLAPIENTRY *TexParameterf)(GLenum, GLenum, GLfloat);
-extern void (GLAPIENTRY *TexParameterfv)(GLenum, GLenum, const GLfloat *);
-extern void (GLAPIENTRY *TexCoord2f)(GLfloat, GLfloat);
-extern void (GLAPIENTRY *Vertex2f)(GLfloat, GLfloat);
-extern void (GLAPIENTRY *Vertex3f)(GLfloat, GLfloat, GLfloat);
-extern void (GLAPIENTRY *Normal3f)(GLfloat, GLfloat, GLfloat);
-extern void (GLAPIENTRY *Lightfv)(GLenum, GLenum, const GLfloat *);
-extern void (GLAPIENTRY *ColorMaterial)(GLenum, GLenum);
-extern void (GLAPIENTRY *ShadeModel)(GLenum);
-extern void (GLAPIENTRY *GetIntegerv)(GLenum, GLint *);
+extern void (GLAPIENTRY *mpglBegin)(GLenum);
+extern void (GLAPIENTRY *mpglEnd)(void);
+extern void (GLAPIENTRY *mpglViewport)(GLint, GLint, GLsizei, GLsizei);
+extern void (GLAPIENTRY *mpglMatrixMode)(GLenum);
+extern void (GLAPIENTRY *mpglLoadIdentity)(void);
+extern void (GLAPIENTRY *mpglTranslated)(double, double, double);
+extern void (GLAPIENTRY *mpglScaled)(double, double, double);
+extern void (GLAPIENTRY *mpglOrtho)(double, double, double, double, double, double);
+extern void (GLAPIENTRY *mpglFrustum)(double, double, double, double, double, double);
+extern void (GLAPIENTRY *mpglPushMatrix)(void);
+extern void (GLAPIENTRY *mpglPopMatrix)(void);
+extern void (GLAPIENTRY *mpglClear)(GLbitfield);
+extern GLuint (GLAPIENTRY *mpglGenLists)(GLsizei);
+extern void (GLAPIENTRY *mpglDeleteLists)(GLuint, GLsizei);
+extern void (GLAPIENTRY *mpglNewList)(GLuint, GLenum);
+extern void (GLAPIENTRY *mpglEndList)(void);
+extern void (GLAPIENTRY *mpglCallList)(GLuint);
+extern void (GLAPIENTRY *mpglCallLists)(GLsizei, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *mpglGenTextures)(GLsizei, GLuint *);
+extern void (GLAPIENTRY *mpglDeleteTextures)(GLsizei, const GLuint *);
+extern void (GLAPIENTRY *mpglTexEnvf)(GLenum, GLenum, GLfloat);
+extern void (GLAPIENTRY *mpglTexEnvi)(GLenum, GLenum, GLint);
+extern void (GLAPIENTRY *mpglColor4ub)(GLubyte, GLubyte, GLubyte, GLubyte);
+extern void (GLAPIENTRY *mpglColor3f)(GLfloat, GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglColor4f)(GLfloat, GLfloat, GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglClearColor)(GLclampf, GLclampf, GLclampf, GLclampf);
+extern void (GLAPIENTRY *mpglClearDepth)(GLclampd);
+extern void (GLAPIENTRY *mpglDepthFunc)(GLenum);
+extern void (GLAPIENTRY *mpglEnable)(GLenum);
+extern void (GLAPIENTRY *mpglDisable)(GLenum);
+extern const GLubyte *(GLAPIENTRY *mpglGetString)(GLenum);
+extern void (GLAPIENTRY *mpglDrawBuffer)(GLenum);
+extern void (GLAPIENTRY *mpglDepthMask)(GLboolean);
+extern void (GLAPIENTRY *mpglBlendFunc)(GLenum, GLenum);
+extern void (GLAPIENTRY *mpglFlush)(void);
+extern void (GLAPIENTRY *mpglFinish)(void);
+extern void (GLAPIENTRY *mpglPixelStorei)(GLenum, GLint);
+extern void (GLAPIENTRY *mpglTexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *mpglTexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *mpglTexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *);
+extern void (GLAPIENTRY *mpglTexParameteri)(GLenum, GLenum, GLint);
+extern void (GLAPIENTRY *mpglTexParameterf)(GLenum, GLenum, GLfloat);
+extern void (GLAPIENTRY *mpglTexParameterfv)(GLenum, GLenum, const GLfloat *);
+extern void (GLAPIENTRY *mpglTexCoord2f)(GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglVertex2f)(GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglVertex3f)(GLfloat, GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglNormal3f)(GLfloat, GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglLightfv)(GLenum, GLenum, const GLfloat *);
+extern void (GLAPIENTRY *mpglColorMaterial)(GLenum, GLenum);
+extern void (GLAPIENTRY *mpglShadeModel)(GLenum);
+extern void (GLAPIENTRY *mpglGetIntegerv)(GLenum, GLint *);
-extern void (GLAPIENTRY *GenBuffers)(GLsizei, GLuint *);
-extern void (GLAPIENTRY *DeleteBuffers)(GLsizei, const GLuint *);
-extern void (GLAPIENTRY *BindBuffer)(GLenum, GLuint);
-extern GLvoid* (GLAPIENTRY *MapBuffer)(GLenum, GLenum);
-extern GLboolean (GLAPIENTRY *UnmapBuffer)(GLenum);
-extern void (GLAPIENTRY *BufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
-extern void (GLAPIENTRY *CombinerParameterfv)(GLenum, const GLfloat *);
-extern void (GLAPIENTRY *CombinerParameteri)(GLenum, GLint);
-extern void (GLAPIENTRY *CombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+extern void (GLAPIENTRY *mpglGenBuffers)(GLsizei, GLuint *);
+extern void (GLAPIENTRY *mpglDeleteBuffers)(GLsizei, const GLuint *);
+extern void (GLAPIENTRY *mpglBindBuffer)(GLenum, GLuint);
+extern GLvoid* (GLAPIENTRY *mpglMapBuffer)(GLenum, GLenum);
+extern GLboolean (GLAPIENTRY *mpglUnmapBuffer)(GLenum);
+extern void (GLAPIENTRY *mpglBufferData)(GLenum, intptr_t, const GLvoid *, GLenum);
+extern void (GLAPIENTRY *mpglCombinerParameterfv)(GLenum, const GLfloat *);
+extern void (GLAPIENTRY *mpglCombinerParameteri)(GLenum, GLint);
+extern void (GLAPIENTRY *mpglCombinerInput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum);
-extern void (GLAPIENTRY *CombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
+extern void (GLAPIENTRY *mpglCombinerOutput)(GLenum, GLenum, GLenum, GLenum, GLenum,
GLenum, GLenum, GLboolean, GLboolean,
GLboolean);
-extern void (GLAPIENTRY *BeginFragmentShader)(void);
-extern void (GLAPIENTRY *EndFragmentShader)(void);
-extern void (GLAPIENTRY *SampleMap)(GLuint, GLuint, GLenum);
-extern void (GLAPIENTRY *ColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
+extern void (GLAPIENTRY *mpglBeginFragmentShader)(void);
+extern void (GLAPIENTRY *mpglEndFragmentShader)(void);
+extern void (GLAPIENTRY *mpglSampleMap)(GLuint, GLuint, GLenum);
+extern void (GLAPIENTRY *mpglColorFragmentOp2)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint);
-extern void (GLAPIENTRY *ColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
+extern void (GLAPIENTRY *mpglColorFragmentOp3)(GLenum, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint, GLuint, GLuint,
GLuint, GLuint, GLuint);
-extern void (GLAPIENTRY *SetFragmentShaderConstant)(GLuint, const GLfloat *);
-extern void (GLAPIENTRY *ActiveTexture)(GLenum);
-extern void (GLAPIENTRY *BindTexture)(GLenum, GLuint);
-extern void (GLAPIENTRY *MultiTexCoord2f)(GLenum, GLfloat, GLfloat);
-extern void (GLAPIENTRY *GenPrograms)(GLsizei, GLuint *);
-extern void (GLAPIENTRY *DeletePrograms)(GLsizei, const GLuint *);
-extern void (GLAPIENTRY *BindProgram)(GLenum, GLuint);
-extern void (GLAPIENTRY *ProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
-extern void (GLAPIENTRY *ProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
+extern void (GLAPIENTRY *mpglSetFragmentShaderConstant)(GLuint, const GLfloat *);
+extern void (GLAPIENTRY *mpglActiveTexture)(GLenum);
+extern void (GLAPIENTRY *mpglBindTexture)(GLenum, GLuint);
+extern void (GLAPIENTRY *mpglMultiTexCoord2f)(GLenum, GLfloat, GLfloat);
+extern void (GLAPIENTRY *mpglGenPrograms)(GLsizei, GLuint *);
+extern void (GLAPIENTRY *mpglDeletePrograms)(GLsizei, const GLuint *);
+extern void (GLAPIENTRY *mpglBindProgram)(GLenum, GLuint);
+extern void (GLAPIENTRY *mpglProgramString)(GLenum, GLenum, GLsizei, const GLvoid *);
+extern void (GLAPIENTRY *mpglProgramEnvParameter4f)(GLenum, GLuint, GLfloat, GLfloat,
GLfloat, GLfloat);
-extern int (GLAPIENTRY *SwapInterval)(int);
-extern void (GLAPIENTRY *TexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei,
+extern int (GLAPIENTRY *mpglSwapInterval)(int);
+extern void (GLAPIENTRY *mpglTexImage3D)(GLenum, GLint, GLenum, GLsizei, GLsizei,
GLsizei, GLint, GLenum, GLenum, const GLvoid *);
-extern void* (GLAPIENTRY *AllocateMemoryMESA)(void *, int, size_t, float, float, float);
-extern void (GLAPIENTRY *FreeMemoryMESA)(void *, int, void *);
+extern void* (GLAPIENTRY *mpglAllocateMemoryMESA)(void *, int, size_t, float, float, float);
+extern void (GLAPIENTRY *mpglFreeMemoryMESA)(void *, int, void *);
#endif /* MPLAYER_GL_COMMON_H */
Modified: trunk/libvo/matrixview.c
==============================================================================
--- trunk/libvo/matrixview.c Fri Apr 2 19:29:22 2010 (r30986)
+++ trunk/libvo/matrixview.c Sat Apr 3 09:08:07 2010 (r30987)
@@ -76,17 +76,17 @@ static void draw_char(int num, float lig
num3 = num - (num2 * 10);
ty = (float)num2 / 7;
tx = (float)num3 / 10;
- Normal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
- Color4f(0.0, 1.0, 0.0, light); // Basic polygon color
+ mpglNormal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
+ mpglColor4f(0.0, 1.0, 0.0, light); // Basic polygon color
- TexCoord2f(tx, ty);
- Vertex3f(x, y, z);
- TexCoord2f(tx + 0.1, ty);
- Vertex3f(x + 1, y, z);
- TexCoord2f(tx + 0.1, ty + 0.166);
- Vertex3f(x + 1, y - 1, z);
- TexCoord2f(tx, ty + 0.166);
- Vertex3f(x, y - 1, z);
+ mpglTexCoord2f(tx, ty);
+ mpglVertex3f(x, y, z);
+ mpglTexCoord2f(tx + 0.1, ty);
+ mpglVertex3f(x + 1, y, z);
+ mpglTexCoord2f(tx + 0.1, ty + 0.166);
+ mpglVertex3f(x + 1, y - 1, z);
+ mpglTexCoord2f(tx, ty + 0.166);
+ mpglVertex3f(x, y - 1, z);
}
static void draw_illuminatedchar(int num, float x, float y, float z)
@@ -98,32 +98,32 @@ static void draw_illuminatedchar(int num
num3 = num - (num2 * 10);
ty = (float)num2 / 7;
tx = (float)num3 / 10;
- Normal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
- Color4f(1.0, 1.0, 1.0, .5); // Basic polygon color
+ mpglNormal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
+ mpglColor4f(1.0, 1.0, 1.0, .5); // Basic polygon color
- TexCoord2f(tx, ty);
- Vertex3f(x, y, z);
- TexCoord2f(tx + 0.1, ty);
- Vertex3f(x + 1, y, z);
- TexCoord2f(tx + 0.1, ty + 0.166);
- Vertex3f(x + 1, y - 1, z);
- TexCoord2f(tx, ty + 0.166);
- Vertex3f(x, y - 1, z);
+ mpglTexCoord2f(tx, ty);
+ mpglVertex3f(x, y, z);
+ mpglTexCoord2f(tx + 0.1, ty);
+ mpglVertex3f(x + 1, y, z);
+ mpglTexCoord2f(tx + 0.1, ty + 0.166);
+ mpglVertex3f(x + 1, y - 1, z);
+ mpglTexCoord2f(tx, ty + 0.166);
+ mpglVertex3f(x, y - 1, z);
}
static void draw_flare(float x, float y, float z) //flare
{
- Normal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
- Color4f(1.0, 1.0, 1.0, .8); // Basic polygon color
+ mpglNormal3f(0.0f, 0.0f, 1.0f); // Needed for lighting
+ mpglColor4f(1.0, 1.0, 1.0, .8); // Basic polygon color
- TexCoord2f(0, 0);
- Vertex3f(x - 1, y + 1, z);
- TexCoord2f(0.75, 0);
- Vertex3f(x + 2, y + 1, z);
- TexCoord2f(0.75, 0.75);
- Vertex3f(x + 2, y - 2, z);
- TexCoord2f(0, 0.75);
- Vertex3f(x - 1, y - 2, z);
+ mpglTexCoord2f(0, 0);
+ mpglVertex3f(x - 1, y + 1, z);
+ mpglTexCoord2f(0.75, 0);
+ mpglVertex3f(x + 2, y + 1, z);
+ mpglTexCoord2f(0.75, 0.75);
+ mpglVertex3f(x + 2, y - 2, z);
+ mpglTexCoord2f(0, 0.75);
+ mpglVertex3f(x - 1, y - 2, z);
}
static void draw_text(uint8_t *pic)
@@ -251,21 +251,21 @@ static void make_text(void)
static void ourBuildTextures(void)
{
- TexImage2D(GL_TEXTURE_2D, 0, 1, 128, 64, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
- font_texture);
- TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ mpglTexImage2D(GL_TEXTURE_2D, 0, 1, 128, 64, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
+ font_texture);
+ mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- BindTexture(GL_TEXTURE_2D, 1);
- TexImage2D(GL_TEXTURE_2D, 0, 1, 4, 4, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
- flare);
- TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ mpglBindTexture(GL_TEXTURE_2D, 1);
+ mpglTexImage2D(GL_TEXTURE_2D, 0, 1, 4, 4, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
+ flare);
+ mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Some pretty standard settings for wrapping and filtering.
- TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- BindTexture(GL_TEXTURE_2D, 0);
+ mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+ mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ mpglBindTexture(GL_TEXTURE_2D, 0);
}
void matrixview_init(int w, int h)
@@ -275,27 +275,27 @@ void matrixview_init(int w, int h)
ourBuildTextures();
// Color to clear color buffer to.
- ClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+ mpglClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// Depth to clear depth buffer to; type of test.
- ClearDepth(1.0);
- DepthFunc(GL_LESS);
+ mpglClearDepth(1.0);
+ mpglDepthFunc(GL_LESS);
// Enables Smooth Color Shading; try GL_FLAT for (lack of) fun.
- ShadeModel(GL_SMOOTH);
+ mpglShadeModel(GL_SMOOTH);
// Set up a light, turn it on.
- Lightfv(GL_LIGHT1, GL_POSITION, Light_Position);
- Lightfv(GL_LIGHT1, GL_AMBIENT, Light_Ambient);
- Lightfv(GL_LIGHT1, GL_DIFFUSE, Light_Diffuse);
- Enable(GL_LIGHT1);
+ mpglLightfv(GL_LIGHT1, GL_POSITION, Light_Position);
+ mpglLightfv(GL_LIGHT1, GL_AMBIENT, Light_Ambient);
+ mpglLightfv(GL_LIGHT1, GL_DIFFUSE, Light_Diffuse);
+ mpglEnable(GL_LIGHT1);
// A handy trick -- have surface material mirror the color.
- ColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
- Enable(GL_COLOR_MATERIAL);
+ mpglColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
+ mpglEnable(GL_COLOR_MATERIAL);
// Allow adjusting of texture color via glColor
- TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
matrixview_reshape(w, h);
}
@@ -303,48 +303,48 @@ void matrixview_init(int w, int h)
void matrixview_reshape(int w, int h)
{
- Viewport(0, 0, w, h);
+ mpglViewport(0, 0, w, h);
- MatrixMode(GL_PROJECTION);
- LoadIdentity();
- Frustum(-_text_x, _text_x, -_text_y, _text_y, -Z_Off - Z_Depth, -Z_Off);
+ mpglMatrixMode(GL_PROJECTION);
+ mpglLoadIdentity();
+ mpglFrustum(-_text_x, _text_x, -_text_y, _text_y, -Z_Off - Z_Depth, -Z_Off);
- MatrixMode(GL_MODELVIEW);
+ mpglMatrixMode(GL_MODELVIEW);
}
void matrixview_draw(int w, int h, double currentTime, float frameTime,
uint8_t *data)
{
- Enable(GL_BLEND);
- Enable(GL_TEXTURE_2D);
+ mpglEnable(GL_BLEND);
+ mpglEnable(GL_TEXTURE_2D);
- Disable(GL_LIGHTING);
- BlendFunc(GL_SRC_ALPHA, GL_ONE);
- Disable(GL_DEPTH_TEST);
+ mpglDisable(GL_LIGHTING);
+ mpglBlendFunc(GL_SRC_ALPHA, GL_ONE);
+ mpglDisable(GL_DEPTH_TEST);
- MatrixMode(GL_MODELVIEW);
- LoadIdentity();
- Translated(0.0f, 0.0f, Z_Off);
+ mpglMatrixMode(GL_MODELVIEW);
+ mpglLoadIdentity();
+ mpglTranslated(0.0f, 0.0f, Z_Off);
// Clear the color and depth buffers.
- Clear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ mpglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// OK, let's start drawing our planer quads.
- Begin(GL_QUADS);
+ mpglBegin(GL_QUADS);
draw_text(data);
- End();
+ mpglEnd();
- BindTexture(GL_TEXTURE_2D, 1);
- Begin(GL_QUADS);
+ mpglBindTexture(GL_TEXTURE_2D, 1);
+ mpglBegin(GL_QUADS);
draw_flares();
- End();
- BindTexture(GL_TEXTURE_2D, 0);
+ mpglEnd();
+ mpglBindTexture(GL_TEXTURE_2D, 0);
make_change(currentTime);
- LoadIdentity();
- MatrixMode(GL_PROJECTION);
+ mpglLoadIdentity();
+ mpglMatrixMode(GL_PROJECTION);
}
void matrixview_contrast_set(float contrast)
Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c Fri Apr 2 19:29:22 2010 (r30986)
+++ trunk/libvo/vo_gl.c Sat Apr 3 09:08:07 2010 (r30987)
@@ -170,12 +170,12 @@ static void resize(int x,int y){
if (WinID >= 0) {
int top = 0, left = 0, w = x, h = y;
geometry(&top, &left, &w, &h, vo_screenwidth, vo_screenheight);
- Viewport(top, left, w, h);
+ mpglViewport(top, left, w, h);
} else
- Viewport( 0, 0, x, y );
+ mpglViewport( 0, 0, x, y );
- MatrixMode(GL_PROJECTION);
- LoadIdentity();
+ mpglMatrixMode(GL_PROJECTION);
+ mpglLoadIdentity();
ass_border_x = ass_border_y = 0;
if (aspect_scaling() && use_aspect) {
int new_w, new_h;
@@ -186,14 +186,14 @@ static void resize(int x,int y){
new_h += vo_panscan_y;
scale_x = (GLdouble)new_w / (GLdouble)x;
scale_y = (GLdouble)new_h / (GLdouble)y;
- Scaled(scale_x, scale_y, 1);
+ mpglScaled(scale_x, scale_y, 1);
ass_border_x = (vo_dwidth - new_w) / 2;
ass_border_y = (vo_dheight - new_h) / 2;
}
- Ortho(0, image_width, image_height, 0, -1,1);
+ mpglOrtho(0, image_width, image_height, 0, -1,1);
- MatrixMode(GL_MODELVIEW);
- LoadIdentity();
+ mpglMatrixMode(GL_MODELVIEW);
+ mpglLoadIdentity();
if (!scaled_osd) {
#ifdef CONFIG_FREETYPE
@@ -202,7 +202,7 @@ static void resize(int x,int y){
#endif
vo_osd_changed(OSDTYPE_OSD);
}
- Clear(GL_COLOR_BUFFER_BIT);
+ mpglClear(GL_COLOR_BUFFER_BIT);
redraw();
}
@@ -251,7 +251,7 @@ static void update_yuvconv(void) {
loadGPUProgram(GL_FRAGMENT_PROGRAM, prog);
free(prog);
}
- ProgramEnvParameter4f(GL_FRAGMENT_PROGRAM, 0,
+ mpglProgramEnvParameter4f(GL_FRAGMENT_PROGRAM, 0,
1.0 / texture_width, 1.0 / texture_height,
texture_width, texture_height);
}
@@ -262,17 +262,17 @@ static void update_yuvconv(void) {
"[gl] Could not read customtex %s\n", custom_tex);
else {
int width, height, maxval;
- ActiveTexture(GL_TEXTURE3);
+ mpglActiveTexture(GL_TEXTURE3);
if (glCreatePPMTex(custom_trect?GL_TEXTURE_RECTANGLE:GL_TEXTURE_2D, 0,
custom_tlin?GL_LINEAR:GL_NEAREST,
f, &width, &height, &maxval))
- ProgramEnvParameter4f(GL_FRAGMENT_PROGRAM, 1,
+ mpglProgramEnvParameter4f(GL_FRAGMENT_PROGRAM, 1,
1.0 / width, 1.0 / height, width, height);
else
mp_msg(MSGT_VO, MSGL_WARN,
"[gl] Error parsing customtex %s\n", custom_tex);
fclose(f);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
}
}
}
@@ -284,14 +284,14 @@ static void clearOSD(void) {
int i;
if (!osdtexCnt)
return;
- DeleteTextures(osdtexCnt, osdtex);
+ mpglDeleteTextures(osdtexCnt, osdtex);
#ifndef FAST_OSD
- DeleteTextures(osdtexCnt, osdatex);
+ mpglDeleteTextures(osdtexCnt, osdatex);
for (i = 0; i < osdtexCnt; i++)
- DeleteLists(osdaDispList[i], 1);
+ mpglDeleteLists(osdaDispList[i], 1);
#endif
for (i = 0; i < osdtexCnt; i++)
- DeleteLists(osdDispList[i], 1);
+ mpglDeleteLists(osdDispList[i], 1);
osdtexCnt = 0;
}
@@ -300,10 +300,10 @@ static void clearOSD(void) {
*/
static void clearEOSD(void) {
if (eosdDispList)
- DeleteLists(eosdDispList, 1);
+ mpglDeleteLists(eosdDispList, 1);
eosdDispList = 0;
if (eosdtexCnt)
- DeleteTextures(eosdtexCnt, eosdtex);
+ mpglDeleteTextures(eosdtexCnt, eosdtex);
eosdtexCnt = 0;
free(eosdtex);
eosdtex = NULL;
@@ -350,10 +350,10 @@ static void genEOSD(mp_eosd_images_t *im
if (!img)
return;
if (!largeeosdtex[0]) {
- glGenTextures(2, largeeosdtex);
- BindTexture(gl_target, largeeosdtex[0]);
+ mpglGenTextures(2, largeeosdtex);
+ mpglBindTexture(gl_target, largeeosdtex[0]);
glCreateClearTex(gl_target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, scale_type, LARGE_EOSD_TEX_SIZE, LARGE_EOSD_TEX_SIZE, 0);
- BindTexture(gl_target, largeeosdtex[1]);
+ mpglBindTexture(gl_target, largeeosdtex[1]);
glCreateClearTex(gl_target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, scale_type, LARGE_EOSD_TEX_SIZE, LARGE_EOSD_TEX_SIZE, 0);
}
for (i = img; i; i = i->next)
@@ -371,7 +371,7 @@ static void genEOSD(mp_eosd_images_t *im
tinytexcur, smalltexcur, eosdtexCnt);
if (eosdtexCnt) {
eosdtex = calloc(eosdtexCnt, sizeof(GLuint));
- glGenTextures(eosdtexCnt, eosdtex);
+ mpglGenTextures(eosdtexCnt, eosdtex);
}
tinytexcur = smalltexcur = 0;
for (i = img, curtex = eosdtex; i; i = i->next) {
@@ -382,47 +382,47 @@ static void genEOSD(mp_eosd_images_t *im
}
if (is_tinytex(i, tinytexcur)) {
tinytex_pos(tinytexcur, &x, &y);
- BindTexture(gl_target, largeeosdtex[0]);
+ mpglBindTexture(gl_target, largeeosdtex[0]);
tinytexcur++;
} else if (is_smalltex(i, smalltexcur)) {
smalltex_pos(smalltexcur, &x, &y);
- BindTexture(gl_target, largeeosdtex[1]);
+ mpglBindTexture(gl_target, largeeosdtex[1]);
smalltexcur++;
} else {
texSize(i->w, i->h, &sx, &sy);
- BindTexture(gl_target, *curtex++);
+ mpglBindTexture(gl_target, *curtex++);
glCreateClearTex(gl_target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, scale_type, sx, sy, 0);
}
glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, i->bitmap, i->stride,
x, y, i->w, i->h, 0);
}
- eosdDispList = GenLists(1);
+ eosdDispList = mpglGenLists(1);
skip_upload:
- NewList(eosdDispList, GL_COMPILE);
+ mpglNewList(eosdDispList, GL_COMPILE);
tinytexcur = smalltexcur = 0;
for (i = img, curtex = eosdtex; i; i = i->next) {
int x = 0, y = 0;
if (i->w <= 0 || i->h <= 0 || i->stride < i->w)
continue;
- Color4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff));
+ mpglColor4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff));
if (is_tinytex(i, tinytexcur)) {
tinytex_pos(tinytexcur, &x, &y);
sx = sy = LARGE_EOSD_TEX_SIZE;
- BindTexture(gl_target, largeeosdtex[0]);
+ mpglBindTexture(gl_target, largeeosdtex[0]);
tinytexcur++;
} else if (is_smalltex(i, smalltexcur)) {
smalltex_pos(smalltexcur, &x, &y);
sx = sy = LARGE_EOSD_TEX_SIZE;
- BindTexture(gl_target, largeeosdtex[1]);
+ mpglBindTexture(gl_target, largeeosdtex[1]);
smalltexcur++;
} else {
texSize(i->w, i->h, &sx, &sy);
- BindTexture(gl_target, *curtex++);
+ mpglBindTexture(gl_target, *curtex++);
}
glDrawTex(i->dst_x, i->dst_y, i->w, i->h, x, y, i->w, i->h, sx, sy, use_rectangle == 1, 0, 0);
}
- EndList();
- BindTexture(gl_target, 0);
+ mpglEndList();
+ mpglBindTexture(gl_target, 0);
}
/**
@@ -430,30 +430,30 @@ skip_upload:
*/
static void uninitGl(void) {
int i = 0;
- if (DeletePrograms && fragprog)
- DeletePrograms(1, &fragprog);
+ if (mpglDeletePrograms && fragprog)
+ mpglDeletePrograms(1, &fragprog);
fragprog = 0;
while (default_texs[i] != 0)
i++;
if (i)
- DeleteTextures(i, default_texs);
+ mpglDeleteTextures(i, default_texs);
default_texs[0] = 0;
clearOSD();
clearEOSD();
if (largeeosdtex[0])
- DeleteTextures(2, largeeosdtex);
+ mpglDeleteTextures(2, largeeosdtex);
largeeosdtex[0] = 0;
- if (DeleteBuffers && gl_buffer)
- DeleteBuffers(1, &gl_buffer);
+ if (mpglDeleteBuffers && gl_buffer)
+ mpglDeleteBuffers(1, &gl_buffer);
gl_buffer = 0; gl_buffersize = 0;
gl_bufferptr = NULL;
- if (DeleteBuffers && gl_buffer_uv[0])
- DeleteBuffers(2, gl_buffer_uv);
+ if (mpglDeleteBuffers && gl_buffer_uv[0])
+ mpglDeleteBuffers(2, gl_buffer_uv);
gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0;
gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0;
#ifdef CONFIG_GL_X11
if (mesa_bufferptr)
- FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
+ mpglFreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
#endif
mesa_bufferptr = NULL;
err_shown = 0;
@@ -461,14 +461,14 @@ static void uninitGl(void) {
static int isSoftwareGl(void)
{
- const char *renderer = GetString(GL_RENDERER);
+ const char *renderer = mpglGetString(GL_RENDERER);
return strcmp(renderer, "Software Rasterizer") == 0;
}
static void autodetectGlExtensions(void) {
- const char *extensions = GetString(GL_EXTENSIONS);
- const char *vendor = GetString(GL_VENDOR);
- const char *version = GetString(GL_VERSION);
+ const char *extensions = mpglGetString(GL_EXTENSIONS);
+ const char *vendor = mpglGetString(GL_VENDOR);
+ const char *version = mpglGetString(GL_VERSION);
int is_ati = strstr(vendor, "ATI") != NULL;
int ati_broken_pbo = 0;
mp_msg(MSGT_VO, MSGL_V, "[gl] Running on OpenGL by '%s', versions '%s'\n", vendor, version);
@@ -500,13 +500,13 @@ static int initGl(uint32_t d_width, uint
texSize(image_width, image_height, &texture_width, &texture_height);
- Disable(GL_BLEND);
- Disable(GL_DEPTH_TEST);
- DepthMask(GL_FALSE);
- Disable(GL_CULL_FACE);
- Enable(gl_target);
- DrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
- TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ mpglDisable(GL_BLEND);
+ mpglDisable(GL_DEPTH_TEST);
+ mpglDepthMask(GL_FALSE);
+ mpglDisable(GL_CULL_FACE);
+ mpglEnable(gl_target);
+ mpglDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
+ mpglTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n",
texture_width, texture_height);
@@ -515,35 +515,35 @@ static int initGl(uint32_t d_width, uint
int i;
int xs, ys;
mp_get_chroma_shift(image_format, &xs, &ys);
- GenTextures(21, default_texs);
+ mpglGenTextures(21, default_texs);
default_texs[21] = 0;
for (i = 0; i < 7; i++) {
- ActiveTexture(GL_TEXTURE1 + i);
- BindTexture(GL_TEXTURE_2D, default_texs[i]);
- BindTexture(GL_TEXTURE_RECTANGLE, default_texs[i + 7]);
- BindTexture(GL_TEXTURE_3D, default_texs[i + 14]);
+ mpglActiveTexture(GL_TEXTURE1 + i);
+ mpglBindTexture(GL_TEXTURE_2D, default_texs[i]);
+ mpglBindTexture(GL_TEXTURE_RECTANGLE, default_texs[i + 7]);
+ mpglBindTexture(GL_TEXTURE_3D, default_texs[i + 14]);
}
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type,
texture_width >> xs, texture_height >> ys, 128);
if (mipmap_gen)
- TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
- ActiveTexture(GL_TEXTURE2);
+ mpglTexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
+ mpglActiveTexture(GL_TEXTURE2);
glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type,
texture_width >> xs, texture_height >> ys, 128);
if (mipmap_gen)
- TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
- ActiveTexture(GL_TEXTURE0);
- BindTexture(gl_target, 0);
+ mpglTexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
+ mpglActiveTexture(GL_TEXTURE0);
+ mpglBindTexture(gl_target, 0);
}
if (is_yuv || custom_prog)
{
if ((MASK_NOT_COMBINERS & (1 << use_yuv)) || custom_prog) {
- if (!GenPrograms || !BindProgram) {
+ if (!mpglGenPrograms || !mpglBindProgram) {
mp_msg(MSGT_VO, MSGL_ERR, "[gl] fragment program functions missing!\n");
} else {
- GenPrograms(1, &fragprog);
- BindProgram(GL_FRAGMENT_PROGRAM, fragprog);
+ mpglGenPrograms(1, &fragprog);
+ mpglBindProgram(GL_FRAGMENT_PROGRAM, fragprog);
}
}
update_yuvconv();
@@ -551,14 +551,14 @@ static int initGl(uint32_t d_width, uint
glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type,
texture_width, texture_height, 0);
if (mipmap_gen)
- TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
+ mpglTexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE);
resize(d_width, d_height);
- ClearColor( 0.0f,0.0f,0.0f,0.0f );
- Clear( GL_COLOR_BUFFER_BIT );
- if (SwapInterval && swap_interval >= 0)
- SwapInterval(swap_interval);
+ mpglClearColor( 0.0f,0.0f,0.0f,0.0f );
+ mpglClear( GL_COLOR_BUFFER_BIT );
+ if (mpglSwapInterval && swap_interval >= 0)
+ mpglSwapInterval(swap_interval);
return 1;
}
@@ -618,7 +618,7 @@ glconfig:
uninitGl();
if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
return -1;
- if (mesa_buffer && !AllocateMemoryMESA) {
+ if (mesa_buffer && !mpglAllocateMemoryMESA) {
mp_msg(MSGT_VO, MSGL_ERR, "Can not enable mesa-buffer because AllocateMemoryMESA was not found\n");
mesa_buffer = 0;
}
@@ -659,15 +659,15 @@ static void create_osd_texture(int x0, i
}
// create Textures for OSD part
- GenTextures(1, &osdtex[osdtexCnt]);
- BindTexture(gl_target, osdtex[osdtexCnt]);
+ mpglGenTextures(1, &osdtex[osdtexCnt]);
+ mpglBindTexture(gl_target, osdtex[osdtexCnt]);
glCreateClearTex(gl_target, GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, scale_type, sx, sy, 0);
glUploadTex(gl_target, GL_LUMINANCE, GL_UNSIGNED_BYTE, src, stride,
0, 0, w, h, 0);
#ifndef FAST_OSD
- GenTextures(1, &osdatex[osdtexCnt]);
- BindTexture(gl_target, osdatex[osdtexCnt]);
+ mpglGenTextures(1, &osdatex[osdtexCnt]);
+ mpglBindTexture(gl_target, osdatex[osdtexCnt]);
glCreateClearTex(gl_target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, scale_type, sx, sy, 0);
{
int i;
@@ -682,23 +682,23 @@ static void create_osd_texture(int x0, i
}
#endif
- BindTexture(gl_target, 0);
+ mpglBindTexture(gl_target, 0);
// Create a list for rendering this OSD part
#ifndef FAST_OSD
- osdaDispList[osdtexCnt] = GenLists(1);
- NewList(osdaDispList[osdtexCnt], GL_COMPILE);
+ osdaDispList[osdtexCnt] = mpglGenLists(1);
+ mpglNewList(osdaDispList[osdtexCnt], GL_COMPILE);
// render alpha
- BindTexture(gl_target, osdatex[osdtexCnt]);
+ mpglBindTexture(gl_target, osdatex[osdtexCnt]);
glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1, 0, 0);
- EndList();
+ mpglEndList();
#endif
- osdDispList[osdtexCnt] = GenLists(1);
- NewList(osdDispList[osdtexCnt], GL_COMPILE);
+ osdDispList[osdtexCnt] = mpglGenLists(1);
+ mpglNewList(osdDispList[osdtexCnt], GL_COMPILE);
// render OSD
- BindTexture(gl_target, osdtex[osdtexCnt]);
+ mpglBindTexture(gl_target, osdtex[osdtexCnt]);
glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1, 0, 0);
- EndList();
+ mpglEndList();
osdtexCnt++;
}
@@ -710,31 +710,31 @@ static void do_render_osd(int type) {
if (((type & 1) && osdtexCnt > 0) || ((type & 2) && eosdDispList)) {
// set special rendering parameters
if (!scaled_osd) {
- MatrixMode(GL_PROJECTION);
- PushMatrix();
- LoadIdentity();
- Ortho(0, vo_dwidth, vo_dheight, 0, -1, 1);
+ mpglMatrixMode(GL_PROJECTION);
+ mpglPushMatrix();
+ mpglLoadIdentity();
+ mpglOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1);
}
- Enable(GL_BLEND);
+ mpglEnable(GL_BLEND);
if ((type & 2) && eosdDispList) {
- BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- CallList(eosdDispList);
+ mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ mpglCallList(eosdDispList);
}
if ((type & 1) && osdtexCnt > 0) {
- Color4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
+ mpglColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
// draw OSD
#ifndef FAST_OSD
- BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
- CallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList);
+ mpglBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
+ mpglCallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList);
#endif
- BlendFunc(GL_SRC_ALPHA, GL_ONE);
- CallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList);
+ mpglBlendFunc(GL_SRC_ALPHA, GL_ONE);
+ mpglCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList);
}
// set rendering parameters back to defaults
- Disable(GL_BLEND);
+ mpglDisable(GL_BLEND);
if (!scaled_osd)
- PopMatrix();
- BindTexture(gl_target, 0);
+ mpglPopMatrix();
+ mpglBindTexture(gl_target, 0);
}
}
@@ -756,7 +756,7 @@ static void do_render(void) {
// Enable(GL_TEXTURE_2D);
// BindTexture(GL_TEXTURE_2D, texture_id);
- Color3f(1,1,1);
+ mpglColor3f(1,1,1);
if (is_yuv || custom_prog)
glEnableYUVConversion(gl_target, yuvconvtype);
glDrawTex(0, 0, image_width, image_height,
@@ -770,15 +770,15 @@ static void do_render(void) {
static void flip_page(void) {
if (vo_doublebuffering) {
- if (use_glFinish) Finish();
+ if (use_glFinish) mpglFinish();
glctx.swapGlBuffers(&glctx);
if (aspect_scaling() && use_aspect)
- Clear(GL_COLOR_BUFFER_BIT);
+ mpglClear(GL_COLOR_BUFFER_BIT);
} else {
do_render();
do_render_osd(3);
- if (use_glFinish) Finish();
- else Flush();
+ if (use_glFinish) mpglFinish();
+ else mpglFlush();
}
}
@@ -796,20 +796,20 @@ static int draw_slice(uint8_t *src[], in
if (is_yuv) {
int xs, ys;
mp_get_chroma_shift(image_format, &xs, &ys);
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glUploadTex(gl_target, gl_format, gl_type, src[1], stride[1],
x >> xs, y >> ys, w >> xs, h >> ys, slice_height);
- ActiveTexture(GL_TEXTURE2);
+ mpglActiveTexture(GL_TEXTURE2);
glUploadTex(gl_target, gl_format, gl_type, src[2], stride[2],
x >> xs, y >> ys, w >> xs, h >> ys, slice_height);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
}
return 0;
}
static uint32_t get_image(mp_image_t *mpi) {
int needed_size;
- if (!GenBuffers || !BindBuffer || !BufferData || !MapBuffer) {
+ if (!mpglGenBuffers || !mpglBindBuffer || !mpglBufferData || !mpglMapBuffer) {
if (!err_shown)
mp_msg(MSGT_VO, MSGL_ERR, "[gl] extensions missing for dr\n"
"Expect a _major_ speed penalty\n");
@@ -830,27 +830,27 @@ static uint32_t get_image(mp_image_t *mp
if (mesa_buffer) {
#ifdef CONFIG_GL_X11
if (mesa_bufferptr && needed_size > mesa_buffersize) {
- FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
+ mpglFreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
mesa_bufferptr = NULL;
}
if (!mesa_bufferptr)
- mesa_bufferptr = AllocateMemoryMESA(mDisplay, mScreen, needed_size, 0, 1.0, 1.0);
+ mesa_bufferptr = mpglAllocateMemoryMESA(mDisplay, mScreen, needed_size, 0, 1.0, 1.0);
mesa_buffersize = needed_size;
#endif
mpi->planes[0] = mesa_bufferptr;
} else {
if (!gl_buffer)
- GenBuffers(1, &gl_buffer);
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
+ mpglGenBuffers(1, &gl_buffer);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
if (needed_size > gl_buffersize) {
gl_buffersize = needed_size;
- BufferData(GL_PIXEL_UNPACK_BUFFER, gl_buffersize,
- NULL, GL_DYNAMIC_DRAW);
+ mpglBufferData(GL_PIXEL_UNPACK_BUFFER, gl_buffersize,
+ NULL, GL_DYNAMIC_DRAW);
}
if (!gl_bufferptr)
- gl_bufferptr = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
+ gl_bufferptr = mpglMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
mpi->planes[0] = gl_bufferptr;
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
if (!mpi->planes[0]) {
if (!err_shown)
@@ -871,21 +871,21 @@ static uint32_t get_image(mp_image_t *mp
mpi->stride[2] = mpi->width >> xs;
if (ati_hack && !mesa_buffer) {
mpi->flags &= ~MP_IMGFLAG_COMMON_PLANE;
- if (!gl_buffer_uv[0]) GenBuffers(2, gl_buffer_uv);
+ if (!gl_buffer_uv[0]) mpglGenBuffers(2, gl_buffer_uv);
if (mpi->stride[1] * mpi->height > gl_buffersize_uv) {
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
- BufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[1] * mpi->height,
- NULL, GL_DYNAMIC_DRAW);
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[1]);
- BufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[1] * mpi->height,
- NULL, GL_DYNAMIC_DRAW);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
+ mpglBufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[1] * mpi->height,
+ NULL, GL_DYNAMIC_DRAW);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[1]);
+ mpglBufferData(GL_PIXEL_UNPACK_BUFFER, mpi->stride[1] * mpi->height,
+ NULL, GL_DYNAMIC_DRAW);
gl_buffersize_uv = mpi->stride[1] * mpi->height;
}
if (!gl_bufferptr_uv[0]) {
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
- gl_bufferptr_uv[0] = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[1]);
- gl_bufferptr_uv[1] = MapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
+ gl_bufferptr_uv[0] = mpglMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[1]);
+ gl_bufferptr_uv[1] = mpglMapBuffer(GL_PIXEL_UNPACK_BUFFER, GL_WRITE_ONLY);
}
mpi->planes[1] = gl_bufferptr_uv[0];
mpi->planes[2] = gl_bufferptr_uv[1];
@@ -940,7 +940,7 @@ static uint32_t draw_image(mp_image_t *m
mpi_flipped = stride[0] < 0;
if (mpi->flags & MP_IMGFLAG_DIRECT) {
if (mesa_buffer) {
- PixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
+ mpglPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
w = texture_width;
} else {
intptr_t base = (intptr_t)planes[0];
@@ -950,8 +950,8 @@ static uint32_t draw_image(mp_image_t *m
planes[0] -= base;
planes[1] -= base;
planes[2] -= base;
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
- UnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer);
+ mpglUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
gl_bufferptr = NULL;
if (!(mpi->flags & MP_IMGFLAG_COMMON_PLANE))
planes[0] = planes[1] = planes[2] = NULL;
@@ -964,26 +964,26 @@ static uint32_t draw_image(mp_image_t *m
int xs, ys;
mp_get_chroma_shift(image_format, &xs, &ys);
if ((mpi->flags & MP_IMGFLAG_DIRECT) && !(mpi->flags & MP_IMGFLAG_COMMON_PLANE)) {
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
- UnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[0]);
+ mpglUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
gl_bufferptr_uv[0] = NULL;
}
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glUploadTex(gl_target, gl_format, gl_type, planes[1], stride[1],
mpi->x >> xs, mpi->y >> ys, w >> xs, h >> ys, slice);
if ((mpi->flags & MP_IMGFLAG_DIRECT) && !(mpi->flags & MP_IMGFLAG_COMMON_PLANE)) {
- BindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[1]);
- UnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
+ mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, gl_buffer_uv[1]);
+ mpglUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
gl_bufferptr_uv[1] = NULL;
}
- ActiveTexture(GL_TEXTURE2);
+ mpglActiveTexture(GL_TEXTURE2);
glUploadTex(gl_target, gl_format, gl_type, planes[2], stride[2],
mpi->x >> xs, mpi->y >> ys, w >> xs, h >> ys, slice);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
}
if (mpi->flags & MP_IMGFLAG_DIRECT) {
- if (mesa_buffer) PixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
- else BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
+ if (mesa_buffer) mpglPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
+ else mpglBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
skip_upload:
if (vo_doublebuffering) do_render();
Modified: trunk/libvo/vo_gl2.c
==============================================================================
--- trunk/libvo/vo_gl2.c Fri Apr 2 19:29:22 2010 (r30986)
+++ trunk/libvo/vo_gl2.c Sat Apr 3 09:08:07 2010 (r30987)
@@ -266,11 +266,11 @@ static int initTextures(void)
glBindTexture (GL_TEXTURE_2D, tsq->texobj);
if (is_yuv) {
glGenTextures(2, tsq->uvtexobjs);
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glBindTexture (GL_TEXTURE_2D, tsq->uvtexobjs[0]);
- ActiveTexture(GL_TEXTURE2);
+ mpglActiveTexture(GL_TEXTURE2);
glBindTexture (GL_TEXTURE_2D, tsq->uvtexobjs[1]);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
}
glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format, gl_bitmap_type, GL_LINEAR,
@@ -280,13 +280,13 @@ static int initTextures(void)
if (is_yuv) {
int xs, ys;
mp_get_chroma_shift(image_format, &xs, &ys);
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format, gl_bitmap_type, GL_LINEAR,
texture_width >> xs, texture_height >> ys, 128);
- ActiveTexture(GL_TEXTURE2);
+ mpglActiveTexture(GL_TEXTURE2);
glCreateClearTex(GL_TEXTURE_2D, gl_internal_format, gl_bitmap_format, gl_bitmap_type, GL_LINEAR,
texture_width >> xs, texture_height >> ys, 128);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
}
tsq++;
@@ -396,11 +396,11 @@ static void drawTextureDisplay (void)
thisw = image_width % texture_width;
glBindTexture (GL_TEXTURE_2D, square->texobj);
if (is_yuv) {
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glBindTexture (GL_TEXTURE_2D, square->uvtexobjs[0]);
- ActiveTexture(GL_TEXTURE2);
+ mpglActiveTexture(GL_TEXTURE2);
glBindTexture (GL_TEXTURE_2D, square->uvtexobjs[1]);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
}
if (texdirty) {
@@ -576,18 +576,18 @@ static int initGl(uint32_t d_width, uint
switch (use_yuv) {
case YUV_CONVERSION_FRAGMENT_LOOKUP:
glGenTextures(1, &lookupTex);
- ActiveTexture(GL_TEXTURE3);
+ mpglActiveTexture(GL_TEXTURE3);
glBindTexture(GL_TEXTURE_2D, lookupTex);
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, 0);
case YUV_CONVERSION_FRAGMENT_POW:
case YUV_CONVERSION_FRAGMENT:
- if (!GenPrograms || !BindProgram) {
+ if (!mpglGenPrograms || !mpglBindProgram) {
mp_msg(MSGT_VO, MSGL_ERR, "[gl] fragment program functions missing!\n");
break;
}
- GenPrograms(1, &fragprog);
- BindProgram(GL_FRAGMENT_PROGRAM, fragprog);
+ mpglGenPrograms(1, &fragprog);
+ mpglBindProgram(GL_FRAGMENT_PROGRAM, fragprog);
break;
}
mp_get_chroma_shift(image_format, &xs, &ys);
@@ -773,17 +773,17 @@ static int draw_slice(uint8_t *src[], in
int subtex_w = rem_w;
if (subtex_x + subtex_w > texture_width)
subtex_w = texture_width - subtex_x;
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, tsq->texobj);
glUploadTex(GL_TEXTURE_2D, gl_bitmap_format, gl_bitmap_type,
yptr, ystride, subtex_x, subtex_y,
subtex_w, subtex_h, 0);
- ActiveTexture(GL_TEXTURE1);
+ mpglActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, tsq->uvtexobjs[0]);
glUploadTex(GL_TEXTURE_2D, gl_bitmap_format, gl_bitmap_type,
uptr, ustride, subtex_x >> xs, subtex_y >> ys,
subtex_w >> xs, subtex_h >> ys, 0);
- ActiveTexture(GL_TEXTURE2);
+ mpglActiveTexture(GL_TEXTURE2);
glBindTexture(GL_TEXTURE_2D, tsq->uvtexobjs[1]);
glUploadTex(GL_TEXTURE_2D, gl_bitmap_format, gl_bitmap_type,
vptr, vstride, subtex_x >> xs, subtex_y >> ys,
@@ -802,7 +802,7 @@ static int draw_slice(uint8_t *src[], in
texline += texnumx;
rem_h -= subtex_h;
}
- ActiveTexture(GL_TEXTURE0);
+ mpglActiveTexture(GL_TEXTURE0);
return 0;
}
@@ -895,7 +895,7 @@ static int preinit(const char *arg)
goto err_out;
if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
goto err_out;
- extensions = GetString(GL_EXTENSIONS);
+ extensions = mpglGetString(GL_EXTENSIONS);
use_yuv = strstr(extensions, "GL_ARB_fragment_program") ? 2 : 0;
}
return 0;
More information about the MPlayer-cvslog
mailing list