4 * GL-based support functions
6 * Copyright (c) 2005 Nathan Keynes.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 #ifndef lxdream_glutil_H
20 #define lxdream_glutil_H
24 #include "pvr2/shaders.h"
31 * Test if a specific extension is supported. From opengl.org
32 * @param extension extension name to check for
33 * @return TRUE if supported, otherwise FALSE.
35 gboolean isGLExtensionSupported( const char *extension );
38 * Dump GL information to the output stream, usually for debugging purposes
40 void glPrintInfo( FILE *out );
43 * Check for a GL error and print a message if there is one
44 * @param context If not null, a string to be printed along side an error message
45 * @return FALSE if there was an error, otherwise TRUE
47 gboolean gl_check_error( const char *context );
49 * Test if secondary color (GL_COLOR_SUM) is supported.
51 gboolean isGLSecondaryColorSupported();
53 gboolean isGLVertexBufferSupported();
54 gboolean isGLVertexRangeSupported();
55 gboolean isGLPixelBufferSupported();
56 gboolean isGLMultitextureSupported();
57 gboolean isGLMirroredTextureSupported();
59 /****** Shader handling (gl_sl.c) *****/
60 gboolean glsl_is_supported(void);
61 const char *glsl_get_version(void);
62 gboolean glsl_load_shaders( );
63 void glsl_unload_shaders(void);
64 gboolean glsl_set_shader( unsigned program_id );
65 void glsl_clear_shader();
66 GLint glsl_get_uniform_location( unsigned program, const char *name );
67 void glsl_set_uniform_int( unsigned program, const char *name, GLint value );
69 /* Convenience formatting function for driver use */
70 void fprint_extensions( FILE *out, const char *extensions );
76 #endif /* !lxdream_glutil_H */
.