diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-26 10:43:56 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-26 10:43:56 +0000 |
commit | 97600b8ee08b7832c313b7469d7c9775f3fda489 (patch) | |
tree | 9cbd5bc9d0231b6d4ca5dd96241cc515d0048e53 /libvo/vo_gl.c | |
parent | d4383bb58e9acb6fff17361d8aa2936696de5e6f (diff) | |
download | mpv-97600b8ee08b7832c313b7469d7c9775f3fda489.tar.bz2 mpv-97600b8ee08b7832c313b7469d7c9775f3fda489.tar.xz |
support custom OSD colour for vo_gl.c. Based on patch by Tomas Janousek tomi at nomi cz
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17957 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_gl.c')
-rw-r--r-- | libvo/vo_gl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 1bd8e1ef9f..c69d56500e 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -55,6 +55,7 @@ static GLuint osdatex[MAX_OSD_PARTS]; static GLuint osdDispList[MAX_OSD_PARTS]; //! How many parts the OSD currently consists of static int osdtexCnt; +static int osd_color; static int use_aspect; static int use_yuv; @@ -251,6 +252,7 @@ static int initGl(uint32_t d_width, uint32_t d_height) { glDisable(GL_CULL_FACE); glEnable(gl_target); glDrawBuffer(vo_doublebuffering?GL_BACK:GL_FRONT); + glTexEnvi(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); @@ -529,6 +531,7 @@ flip_page(void) glOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1); } glEnable(GL_BLEND); + glColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff); // draw OSD glCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList); // set rendering parameters back to defaults @@ -690,6 +693,7 @@ static opt_t subopts[] = { {"customprog", OPT_ARG_MSTRZ,&custom_prog, NULL}, {"customtex", OPT_ARG_MSTRZ,&custom_tex, NULL}, {"customtlin", OPT_ARG_BOOL, &custom_tlin, NULL}, + {"osdcolor", OPT_ARG_INT, &osd_color, NULL}, {NULL} }; @@ -708,6 +712,7 @@ static int preinit(const char *arg) custom_prog = NULL; custom_tex = NULL; custom_tlin = 1; + osd_color = 0xffffff; if (subopt_parse(arg, subopts) != 0) { mp_msg(MSGT_VO, MSGL_FATAL, "\n-vo gl command line help:\n" @@ -744,6 +749,8 @@ static int preinit(const char *arg) " use a custom YUV conversion lookup texture\n" " nocustomtlin\n" " use GL_NEAREST scaling for customtex texture\n" + " osdcolor=<0xRRGGBB>\n" + " use the given color for the OSD\n" "\n" ); return -1; } |