[MPlayer-cvslog] r35063 - in trunk/libvo: gl_common.c gl_common.h

reimar subversion at mplayerhq.hu
Tue Aug 7 23:39:47 CEST 2012


Author: reimar
Date: Tue Aug  7 23:39:47 2012
New Revision: 35063

Log:
Add support for depth textures to simplify some experiments.

Modified:
   trunk/libvo/gl_common.c
   trunk/libvo/gl_common.h

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Tue Aug  7 19:46:36 2012	(r35062)
+++ trunk/libvo/gl_common.c	Tue Aug  7 23:39:47 2012	(r35063)
@@ -575,6 +575,10 @@ void glCreateClearTex(GLenum target, GLe
   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);
+  if (format == GL_DEPTH_COMPONENT) {
+      mpglTexParameteri(target, GL_TEXTURE_COMPARE_MODE, GL_NONE);
+      mpglTexParameteri(target, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
+  }
   // Border texels should not be used with CLAMP_TO_EDGE
   // We set a sane default anyway.
   mpglTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border);
@@ -648,6 +652,7 @@ int glFmt2bpp(GLenum format, GLenum type
   switch (format) {
     case GL_LUMINANCE:
     case GL_ALPHA:
+    case GL_DEPTH_COMPONENT:
       return component_size;
     case GL_YCBCR_MESA:
       return 2;

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Tue Aug  7 19:46:36 2012	(r35062)
+++ trunk/libvo/gl_common.h	Tue Aug  7 23:39:47 2012	(r35063)
@@ -269,6 +269,9 @@
 #ifndef GL_LUMINANCE16
 #define GL_LUMINANCE16 0x8042
 #endif
+#ifndef GL_DEPTH_COMPONENT
+#define GL_DEPTH_COMPONENT 0x1902
+#endif
 #ifndef GL_UNPACK_CLIENT_STORAGE_APPLE
 #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
 #endif


More information about the MPlayer-cvslog mailing list