Search
lxdream.org :: lxdream/src/drivers/gl_common.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/gl_common.h
changeset 443:1163eb5c0590
prev429:e581b90c3fb3
next477:9a373f2ff009
author nkeynes
date Sat Oct 13 04:01:02 2007 +0000 (12 years ago)
permissions -rw-r--r--
last change Add ability to track the last displayed buffer, and handle expose/resize
events appropriately
view annotate diff log raw
     1 /**
     2  * $Id: gl_common.h,v 1.4 2007-10-13 04:01:02 nkeynes Exp $
     3  *
     4  * Parent for all X11 display drivers.
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     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.
    12  *
    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.
    17  */
    19 #ifndef video_gl_common_H
    20 #define video_gl_common_H
    22 #include "display.h"
    24 /**
    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.
    28  */
    29 gboolean isGLExtensionSupported( const char *extension );
    31 gboolean hasRequiredGLExtensions();
    33 /**
    34  * Generic GL routine to draw the given frame buffer in the display view.
    35  */
    36 gboolean gl_display_frame_buffer( frame_buffer_t frame );
    38 /**
    39  * Generic GL routine to blank the display view with the specified colour.
    40  */
    41 gboolean gl_display_blank( uint32_t colour );
    43 /**
    44  * Copy the frame buffer contents to the specified texture id
    45  */
    46 void gl_frame_buffer_to_tex_rectangle( frame_buffer_t frame, GLuint texid );
    48 /**
    49  * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
    50  */
    51 void gl_display_tex_rectangle( GLuint texid, uint32_t texwidth, uint32_t texheight, gboolean invert );
    53 /**
    54  * Redisplay the last frame.
    55  */
    56 void gl_redisplay_last();
    58 /**
    59  * Generic GL read_render_buffer. This function assumes that the caller
    60  * has already set the appropriate glReadBuffer(); in other words, unless
    61  * there's only one buffer this needs to be wrapped.
    62  */
    63 gboolean gl_read_render_buffer( render_buffer_t buffer, unsigned char *target );
    66 /****** FBO handling (gl_fbo.c) ******/
    67 gboolean gl_fbo_is_supported();
    68 void gl_fbo_shutdown();
    69 void gl_fbo_init( display_driver_t driver );
    71 /****** Shader handling (gl_sl.c) *****/
    72 gboolean glsl_is_supported(void);
    73 gboolean glsl_load_shaders( const char *vert_shader, const char *frag_shader );
    74 void glsl_unload_shaders(void);
    76 extern const char *glsl_vertex_shader_src;
    77 extern const char *glsl_fragment_shader_src;
    79 #endif /* !video_gl_common_H */
.