Search
lxdream.org :: lxdream/src/drivers/video_gl.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_gl.h
changeset 854:130928a3cdcb
prev736:a02d1475ccfd
next1159:580436b01b6c
author nkeynes
date Thu Oct 16 12:06:24 2008 +0000 (15 years ago)
permissions -rw-r--r--
last change Fix bound check on number of framebuffers allocated
Fix repurposing framebuffers to clear out previous attachments to prevent
dimension erros.
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * Common GL code that doesn't depend on a specific implementation
     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 lxdream_video_gl_H
    20 #define lxdream_video_gl_H 1
    22 #ifdef __cplusplus
    23 extern "C" {
    24 #endif
    26 /**
    27  * Generic GL routine to draw the given frame buffer into a texture
    28  */
    29 gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id );
    31 /**
    32  * Reset the GL state to its initial values
    33  */
    34 void gl_reset_state();
    36 /**
    37  * Generic GL routine to blank the display view with the specified colour.
    38  */
    39 void gl_display_blank( uint32_t colour );
    41 /**
    42  * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
    43  */
    44 void gl_display_render_buffer( render_buffer_t buffer );
    46 /**
    47  * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
    48  */
    49 void gl_texture_window( int width, int height, int tex_id, gboolean inverted );
    51 /**
    52  * Convert window coordinates to dreamcast device coords (640x480) using the 
    53  * same viewable area as gl_texture_window.
    54  * If the coordinates are outside the viewable area, the result is -1,-1.
    55  */ 
    56 void gl_window_to_system_coords( int *x, int *y );
    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( unsigned char *target, render_buffer_t buffer, 
    64                                 int rowstride, int colour_format );
    67 /****** FBO handling (gl_fbo.c) ******/
    68 gboolean gl_fbo_is_supported();
    69 void gl_fbo_shutdown();
    70 void gl_fbo_init( display_driver_t driver );
    71 void gl_fbo_detach();
    73 #ifdef __cplusplus
    74 }
    75 #endif
    77 #endif /* !lxdream_video_gl_H */
.