2 * $Id: gl_common.h,v 1.5 2007-10-31 09:10:23 nkeynes Exp $
4 * Parent for all X11 display drivers.
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 video_gl_common_H
20 #define video_gl_common_H
25 * Test if a specific extension is supported. From opengl.org
26 * @param extension extension name to check for
27 * @return TRUE if supported, otherwise FALSE.
29 gboolean isGLExtensionSupported( const char *extension );
31 gboolean hasRequiredGLExtensions();
34 * Generic GL routine to draw the given frame buffer into a render buffer
36 gboolean gl_load_frame_buffer( frame_buffer_t frame, render_buffer_t buffer );
39 * Generic GL routine to blank the display view with the specified colour.
41 gboolean gl_display_blank( uint32_t colour );
44 * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
46 void gl_display_render_buffer( render_buffer_t buffer );
49 * Redisplay the last frame.
51 void gl_redisplay_last();
54 * Generic GL read_render_buffer. This function assumes that the caller
55 * has already set the appropriate glReadBuffer(); in other words, unless
56 * there's only one buffer this needs to be wrapped.
58 gboolean gl_read_render_buffer( unsigned char *target, render_buffer_t buffer,
59 int rowstride, int colour_format );
62 /****** FBO handling (gl_fbo.c) ******/
63 gboolean gl_fbo_is_supported();
64 void gl_fbo_shutdown();
65 void gl_fbo_init( display_driver_t driver );
68 /****** Shader handling (gl_sl.c) *****/
69 gboolean glsl_is_supported(void);
70 gboolean glsl_load_shaders( const char *vert_shader, const char *frag_shader );
71 void glsl_unload_shaders(void);
73 extern const char *glsl_vertex_shader_src;
74 extern const char *glsl_fragment_shader_src;
76 #endif /* !video_gl_common_H */
.