Search
lxdream.org :: lxdream :: r667:0e1ac8da75d9
lxdream 0.9.1
released Jun 29
Download Now
changeset667:0e1ac8da75d9
parent666:ea369bcf6def
child668:c62dff190859
authornkeynes
dateSat Apr 19 02:39:37 2008 +0000 (16 years ago)
Centralize gl ext checks in glutil.c
src/pvr2/glutil.c
src/pvr2/glutil.h
src/pvr2/scene.c
1.1 --- a/src/pvr2/glutil.c Sat Apr 19 02:30:04 2008 +0000
1.2 +++ b/src/pvr2/glutil.c Sat Apr 19 02:39:37 2008 +0000
1.3 @@ -18,6 +18,26 @@
1.4 #include <string.h>
1.5 #include "pvr2/glutil.h"
1.6
1.7 +gboolean isGLSecondaryColorSupported()
1.8 +{
1.9 + return isGLExtensionSupported("GL_EXT_secondary_color");
1.10 +}
1.11 +
1.12 +gboolean isGLVertexBufferSupported()
1.13 +{
1.14 + return isGLExtensionSupported("GL_ARB_vertex_buffer_object");
1.15 +}
1.16 +
1.17 +gboolean isGLPixelBufferSupported()
1.18 +{
1.19 + return isGLExtensionSupported("GL_ARB_pixel_buffer_object");
1.20 +}
1.21 +
1.22 +gboolean isGLMirroredTextureSupported()
1.23 +{
1.24 + return isGLExtensionSupported("GL_ARB_texture_mirrored_repeat");
1.25 +}
1.26 +
1.27 /**
1.28 * Test if a specific extension is supported. From opengl.org
1.29 * @param extension extension name to check for
2.1 --- a/src/pvr2/glutil.h Sat Apr 19 02:30:04 2008 +0000
2.2 +++ b/src/pvr2/glutil.h Sat Apr 19 02:39:37 2008 +0000
2.3 @@ -28,6 +28,14 @@
2.4 */
2.5 gboolean isGLExtensionSupported( const char *extension );
2.6
2.7 +/**
2.8 + * Test if secondary color (GL_COLOR_SUM) is supported.
2.9 + */
2.10 +gboolean isGLSecondaryColorSupported();
2.11 +
2.12 +gboolean isGLVertexBufferSupported();
2.13 +gboolean isGLPixelBufferSupported();
2.14 +gboolean isGLMirroredTextureSupported();
2.15
2.16 /****** Shader handling (gl_sl.c) *****/
2.17 gboolean glsl_is_supported(void);
3.1 --- a/src/pvr2/scene.c Sat Apr 19 02:30:04 2008 +0000
3.2 +++ b/src/pvr2/scene.c Sat Apr 19 02:39:37 2008 +0000
3.3 @@ -26,8 +26,6 @@
3.4 #include "pvr2/glutil.h"
3.5 #include "pvr2/scene.h"
3.6
3.7 -#define VBO_EXT_STRING "GL_ARB_vertex_buffer_object"
3.8 -#define PBO_EXT_STRING "GL_ARB_pixel_buffer_object"
3.9
3.10 static inline uint32_t bgra_to_rgba(uint32_t bgra)
3.11 {
3.12 @@ -67,7 +65,7 @@
3.13 {
3.14 if( !vbo_init ) {
3.15 #ifdef ENABLE_VERTEX_BUFFER
3.16 - if( isGLExtensionSupported(VBO_EXT_STRING) ) {
3.17 + if( isGLVertexBufferSupported() ) {
3.18 vbo_supported = TRUE;
3.19 pvr2_scene.vbo_id = 1;
3.20 }
.