summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-10 16:39:45 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-12-10 16:39:45 +0000
commit9c0caf340f2d41e6cd0fa108b9dd91edd3a47215 (patch)
tree5f0c263512f3c195fe0d87069bbcd255e11f225b /libvo
parent8e8b7921afb1ff51c52d5e25ffc6fbf340bd1ff9 (diff)
downloadmpv-9c0caf340f2d41e6cd0fa108b9dd91edd3a47215.tar.bz2
mpv-9c0caf340f2d41e6cd0fa108b9dd91edd3a47215.tar.xz
Try to auto-detect several vo_gl settings (ati-hack, force-pbo and rectangle).
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28125 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_gl.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 19e3459637..7f59aee55c 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -401,11 +401,21 @@ static void uninitGl(void) {
err_shown = 0;
}
+static void autodetectGlExtensions(void) {
+ const char *extensions = glGetString(GL_EXTENSIONS);
+ const char *vendor = glGetString(GL_VENDOR);
+ int is_ati = strstr(vendor, "ATI") != NULL;
+ if (ati_hack == -1) ati_hack = is_ati;
+ if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0;
+ if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 2 : 0;
+}
+
/**
* \brief Initialize a (new or reused) OpenGL context.
* set global gl-related variables to their default values
*/
static int initGl(uint32_t d_width, uint32_t d_height) {
+ autodetectGlExtensions();
texSize(image_width, image_height, &texture_width, &texture_height);
glDisable(GL_BLEND);
@@ -925,10 +935,10 @@ static int preinit(const char *arg)
lscale = 0;
cscale = 0;
filter_strength = 0.5;
- use_rectangle = 0;
+ use_rectangle = -1;
use_glFinish = 0;
- ati_hack = 0;
- force_pbo = 0;
+ ati_hack = -1;
+ force_pbo = -1;
mesa_buffer = 0;
swap_interval = 1;
slice_height = 0;