summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r--libvo/vo_gl.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index b4f4bb862f..ccb44e1882 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -149,12 +149,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);
- glViewport(top, left, w, h);
+ Viewport(top, left, w, h);
} else
- glViewport( 0, 0, x, y );
+ Viewport( 0, 0, x, y );
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
+ MatrixMode(GL_PROJECTION);
+ LoadIdentity();
ass_border_x = ass_border_y = 0;
if (aspect_scaling() && use_aspect) {
int new_w, new_h;
@@ -165,14 +165,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;
- glScaled(scale_x, scale_y, 1);
+ Scaled(scale_x, scale_y, 1);
ass_border_x = (vo_dwidth - new_w) / 2;
ass_border_y = (vo_dheight - new_h) / 2;
}
- glOrtho(0, image_width, image_height, 0, -1,1);
+ Ortho(0, image_width, image_height, 0, -1,1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
+ MatrixMode(GL_MODELVIEW);
+ LoadIdentity();
if (!scaled_osd) {
#ifdef CONFIG_FREETYPE
@@ -181,7 +181,7 @@ static void resize(int x,int y){
#endif
vo_osd_changed(OSDTYPE_OSD);
}
- glClear(GL_COLOR_BUFFER_BIT);
+ Clear(GL_COLOR_BUFFER_BIT);
redraw();
}
@@ -259,14 +259,14 @@ static void clearOSD(void) {
int i;
if (!osdtexCnt)
return;
- glDeleteTextures(osdtexCnt, osdtex);
+ DeleteTextures(osdtexCnt, osdtex);
#ifndef FAST_OSD
- glDeleteTextures(osdtexCnt, osdatex);
+ DeleteTextures(osdtexCnt, osdatex);
for (i = 0; i < osdtexCnt; i++)
- glDeleteLists(osdaDispList[i], 1);
+ DeleteLists(osdaDispList[i], 1);
#endif
for (i = 0; i < osdtexCnt; i++)
- glDeleteLists(osdDispList[i], 1);
+ DeleteLists(osdDispList[i], 1);
osdtexCnt = 0;
}
@@ -275,10 +275,10 @@ static void clearOSD(void) {
*/
static void clearEOSD(void) {
if (eosdDispList)
- glDeleteLists(eosdDispList, 1);
+ DeleteLists(eosdDispList, 1);
eosdDispList = 0;
if (eosdtexCnt)
- glDeleteTextures(eosdtexCnt, eosdtex);
+ DeleteTextures(eosdtexCnt, eosdtex);
eosdtexCnt = 0;
free(eosdtex);
eosdtex = NULL;
@@ -373,15 +373,15 @@ static void genEOSD(mp_eosd_images_t *imgs) {
glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, i->bitmap, i->stride,
x, y, i->w, i->h, 0);
}
- eosdDispList = glGenLists(1);
+ eosdDispList = GenLists(1);
skip_upload:
- glNewList(eosdDispList, GL_COMPILE);
+ NewList(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;
- glColor4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff));
+ Color4ub(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;
@@ -398,7 +398,7 @@ skip_upload:
}
glDrawTex(i->dst_x, i->dst_y, i->w, i->h, x, y, i->w, i->h, sx, sy, use_rectangle == 1, 0, 0);
}
- glEndList();
+ EndList();
BindTexture(gl_target, 0);
}
@@ -413,12 +413,12 @@ static void uninitGl(void) {
while (default_texs[i] != 0)
i++;
if (i)
- glDeleteTextures(i, default_texs);
+ DeleteTextures(i, default_texs);
default_texs[0] = 0;
clearOSD();
clearEOSD();
if (largeeosdtex[0])
- glDeleteTextures(2, largeeosdtex);
+ DeleteTextures(2, largeeosdtex);
largeeosdtex[0] = 0;
if (DeleteBuffers && gl_buffer)
DeleteBuffers(1, &gl_buffer);
@@ -437,9 +437,9 @@ static void uninitGl(void) {
}
static void autodetectGlExtensions(void) {
- const char *extensions = glGetString(GL_EXTENSIONS);
- const char *vendor = glGetString(GL_VENDOR);
- const char *version = glGetString(GL_VERSION);
+ const char *extensions = GetString(GL_EXTENSIONS);
+ const char *vendor = GetString(GL_VENDOR);
+ const char *version = GetString(GL_VERSION);
int is_ati = strstr(vendor, "ATI") != NULL;
int ati_broken_pbo = 0;
if (is_ati && strncmp(version, "2.1.", 4) == 0) {
@@ -465,20 +465,20 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
autodetectGlExtensions();
texSize(image_width, image_height, &texture_width, &texture_height);
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDepthMask(GL_FALSE);
- glDisable(GL_CULL_FACE);
- glEnable(gl_target);
- glDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT);
- glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+ 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);
mp_msg(MSGT_VO, MSGL_V, "[gl] Creating %dx%d texture...\n",
texture_width, texture_height);
if (image_format == IMGFMT_YV12) {
int i;
- glGenTextures(21, default_texs);
+ GenTextures(21, default_texs);
default_texs[21] = 0;
for (i = 0; i < 7; i++) {
ActiveTexture(GL_TEXTURE1 + i);
@@ -513,8 +513,8 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
resize(d_width, d_height);
- glClearColor( 0.0f,0.0f,0.0f,0.0f );
- glClear( GL_COLOR_BUFFER_BIT );
+ ClearColor( 0.0f,0.0f,0.0f,0.0f );
+ Clear( GL_COLOR_BUFFER_BIT );
if (SwapInterval && swap_interval >= 0)
SwapInterval(swap_interval);
return 1;
@@ -607,14 +607,14 @@ static void create_osd_texture(int x0, int y0, int w, int h,
}
// create Textures for OSD part
- glGenTextures(1, &osdtex[osdtexCnt]);
+ GenTextures(1, &osdtex[osdtexCnt]);
BindTexture(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
- glGenTextures(1, &osdatex[osdtexCnt]);
+ GenTextures(1, &osdatex[osdtexCnt]);
BindTexture(gl_target, osdatex[osdtexCnt]);
glCreateClearTex(gl_target, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, scale_type, sx, sy, 0);
{
@@ -634,19 +634,19 @@ static void create_osd_texture(int x0, int y0, int w, int h,
// Create a list for rendering this OSD part
#ifndef FAST_OSD
- osdaDispList[osdtexCnt] = glGenLists(1);
- glNewList(osdaDispList[osdtexCnt], GL_COMPILE);
+ osdaDispList[osdtexCnt] = GenLists(1);
+ NewList(osdaDispList[osdtexCnt], GL_COMPILE);
// render alpha
BindTexture(gl_target, osdatex[osdtexCnt]);
glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1, 0, 0);
- glEndList();
+ EndList();
#endif
- osdDispList[osdtexCnt] = glGenLists(1);
- glNewList(osdDispList[osdtexCnt], GL_COMPILE);
+ osdDispList[osdtexCnt] = GenLists(1);
+ NewList(osdDispList[osdtexCnt], GL_COMPILE);
// render OSD
BindTexture(gl_target, osdtex[osdtexCnt]);
glDrawTex(x0, y0, w, h, 0, 0, w, h, sx, sy, use_rectangle == 1, 0, 0);
- glEndList();
+ EndList();
osdtexCnt++;
}
@@ -666,10 +666,10 @@ static void draw_osd(void)
}
static void do_render(void) {
-// glEnable(GL_TEXTURE_2D);
-// glBindTexture(GL_TEXTURE_2D, texture_id);
+// Enable(GL_TEXTURE_2D);
+// BindTexture(GL_TEXTURE_2D, texture_id);
- glColor3f(1,1,1);
+ Color3f(1,1,1);
if (image_format == IMGFMT_YV12)
glEnableYUVConversion(gl_target, yuvconvtype);
glDrawTex(0, 0, image_width, image_height,
@@ -688,45 +688,45 @@ static void do_render_osd(int type) {
if (((type & 1) && osdtexCnt > 0) || ((type & 2) && eosdDispList)) {
// set special rendering parameters
if (!scaled_osd) {
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1);
+ MatrixMode(GL_PROJECTION);
+ PushMatrix();
+ LoadIdentity();
+ Ortho(0, vo_dwidth, vo_dheight, 0, -1, 1);
}
- glEnable(GL_BLEND);
+ Enable(GL_BLEND);
if ((type & 2) && eosdDispList) {
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- glCallList(eosdDispList);
+ BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ CallList(eosdDispList);
}
if ((type & 1) && osdtexCnt > 0) {
- glColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
+ Color4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24));
// draw OSD
#ifndef FAST_OSD
- glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
- glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList);
+ BlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA);
+ CallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList);
#endif
- glBlendFunc(GL_SRC_ALPHA, GL_ONE);
- glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList);
+ BlendFunc(GL_SRC_ALPHA, GL_ONE);
+ CallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList);
}
// set rendering parameters back to defaults
- glDisable(GL_BLEND);
+ Disable(GL_BLEND);
if (!scaled_osd)
- glPopMatrix();
+ PopMatrix();
BindTexture(gl_target, 0);
}
}
static void flip_page(void) {
if (vo_doublebuffering) {
- if (use_glFinish) glFinish();
+ if (use_glFinish) Finish();
glctx.swapGlBuffers(&glctx);
if (aspect_scaling() && use_aspect)
- glClear(GL_COLOR_BUFFER_BIT);
+ Clear(GL_COLOR_BUFFER_BIT);
} else {
do_render();
do_render_osd(3);
- if (use_glFinish) glFinish();
- else glFlush();
+ if (use_glFinish) Finish();
+ else Flush();
}
}
@@ -882,7 +882,7 @@ static uint32_t draw_image(mp_image_t *mpi) {
mpi_flipped = stride[0] < 0;
if (mpi->flags & MP_IMGFLAG_DIRECT) {
if (mesa_buffer) {
- glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
+ PixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 1);
w = texture_width;
} else {
intptr_t base = (intptr_t)planes[0];
@@ -922,7 +922,7 @@ static uint32_t draw_image(mp_image_t *mpi) {
ActiveTexture(GL_TEXTURE0);
}
if (mpi->flags & MP_IMGFLAG_DIRECT) {
- if (mesa_buffer) glPixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
+ if (mesa_buffer) PixelStorei(GL_UNPACK_CLIENT_STORAGE_APPLE, 0);
else BindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
skip_upload: