# HG changeset patch # User reimar # Date 1344375587 0 # Node ID 7974179b9471f98316b52f3399724c70a44a5569 # Parent 0807ab90536ca8c249240dc6e28fc8fd3ecadb77 Add support for depth textures to simplify some experiments. diff -r 0807ab90536c -r 7974179b9471 libvo/gl_common.c --- 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; diff -r 0807ab90536c -r 7974179b9471 libvo/gl_common.h --- 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