changeset 34969:7974179b9471

Add support for depth textures to simplify some experiments.
author reimar
date Tue, 07 Aug 2012 21:39:47 +0000
parents 0807ab90536c
children 78bf01276896
files libvo/gl_common.c libvo/gl_common.h
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Tue Aug 07 17:46:36 2012 +0000
+++ b/libvo/gl_common.c	Tue Aug 07 21:39:47 2012 +0000
@@ -575,6 +575,10 @@
   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 @@
   switch (format) {
     case GL_LUMINANCE:
     case GL_ALPHA:
+    case GL_DEPTH_COMPONENT:
       return component_size;
     case GL_YCBCR_MESA:
       return 2;
--- a/libvo/gl_common.h	Tue Aug 07 17:46:36 2012 +0000
+++ b/libvo/gl_common.h	Tue Aug 07 21:39:47 2012 +0000
@@ -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