summaryrefslogtreecommitdiffstats
path: root/libvo/cocoa_common.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-05-14 16:33:06 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2012-05-15 10:37:58 +0200
commit43337db0a49029da316157d9bc57e9c44e846e69 (patch)
tree4644c331af38cab4fa8de6a1f5468ec648c43afa /libvo/cocoa_common.m
parent4a2bd440dd71faf6852d3653de02fc512ce8244f (diff)
downloadmpv-43337db0a49029da316157d9bc57e9c44e846e69.tar.bz2
mpv-43337db0a49029da316157d9bc57e9c44e846e69.tar.xz
cocoa: gl3: support querying of colors bit depth
Add support for querying the bit depth of the colors from the OpenGL context. This allows to perform dithering correctly.
Diffstat (limited to 'libvo/cocoa_common.m')
-rw-r--r--libvo/cocoa_common.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m
index 04b325405b..5b2bc9ab4e 100644
--- a/libvo/cocoa_common.m
+++ b/libvo/cocoa_common.m
@@ -405,6 +405,22 @@ void *vo_cocoa_cgl_pixel_format(void)
return [s->pixelFormat CGLPixelFormatObj];
}
+int vo_cocoa_cgl_color_size(void)
+{
+ GLint value;
+ CGLDescribePixelFormat(vo_cocoa_cgl_pixel_format(), 0,
+ kCGLPFAColorSize, &value);
+ switch (value) {
+ case 32:
+ case 24:
+ return 8;
+ case 16:
+ return 5;
+ }
+
+ return 8;
+}
+
void create_menu()
{
NSMenu *menu;