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 1159:580436b01b6c
prev854:130928a3cdcb
next1222:a4545699a82b
author nkeynes
date Wed Jan 19 17:50:09 2011 +1000 (9 years ago)
permissions -rw-r--r--
last change Implement vertex array range support, and move buffer operations to gl_vbo.c
file annotate diff log raw
nkeynes@635
     1
/**
nkeynes@635
     2
 * $Id$
nkeynes@635
     3
 *
nkeynes@662
     4
 * Common GL code that doesn't depend on a specific implementation
nkeynes@635
     5
 *
nkeynes@635
     6
 * Copyright (c) 2005 Nathan Keynes.
nkeynes@635
     7
 *
nkeynes@635
     8
 * This program is free software; you can redistribute it and/or modify
nkeynes@635
     9
 * it under the terms of the GNU General Public License as published by
nkeynes@635
    10
 * the Free Software Foundation; either version 2 of the License, or
nkeynes@635
    11
 * (at your option) any later version.
nkeynes@635
    12
 *
nkeynes@635
    13
 * This program is distributed in the hope that it will be useful,
nkeynes@635
    14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
nkeynes@635
    15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
nkeynes@635
    16
 * GNU General Public License for more details.
nkeynes@635
    17
 */
nkeynes@635
    18
nkeynes@736
    19
#ifndef lxdream_video_gl_H
nkeynes@736
    20
#define lxdream_video_gl_H 1
nkeynes@736
    21
nkeynes@736
    22
#ifdef __cplusplus
nkeynes@736
    23
extern "C" {
nkeynes@736
    24
#endif
nkeynes@635
    25
nkeynes@635
    26
/**
nkeynes@635
    27
 * Generic GL routine to draw the given frame buffer into a texture
nkeynes@635
    28
 */
nkeynes@635
    29
gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id );
nkeynes@635
    30
nkeynes@635
    31
/**
nkeynes@669
    32
 * Reset the GL state to its initial values
nkeynes@669
    33
 */
nkeynes@669
    34
void gl_reset_state();
nkeynes@669
    35
nkeynes@669
    36
/**
nkeynes@635
    37
 * Generic GL routine to blank the display view with the specified colour.
nkeynes@635
    38
 */
nkeynes@669
    39
void gl_display_blank( uint32_t colour );
nkeynes@635
    40
nkeynes@635
    41
/**
nkeynes@635
    42
 * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
nkeynes@635
    43
 */
nkeynes@635
    44
void gl_display_render_buffer( render_buffer_t buffer );
nkeynes@635
    45
nkeynes@635
    46
/**
nkeynes@635
    47
 * Write a rectangular texture (GL_TEXTURE_RECTANGLE_ARB) to the display frame
nkeynes@635
    48
 */
nkeynes@635
    49
void gl_texture_window( int width, int height, int tex_id, gboolean inverted );
nkeynes@635
    50
nkeynes@635
    51
/**
nkeynes@854
    52
 * Convert window coordinates to dreamcast device coords (640x480) using the 
nkeynes@854
    53
 * same viewable area as gl_texture_window.
nkeynes@854
    54
 * If the coordinates are outside the viewable area, the result is -1,-1.
nkeynes@854
    55
 */ 
nkeynes@854
    56
void gl_window_to_system_coords( int *x, int *y );
nkeynes@854
    57
nkeynes@854
    58
/**
nkeynes@635
    59
 * Generic GL read_render_buffer. This function assumes that the caller
nkeynes@635
    60
 * has already set the appropriate glReadBuffer(); in other words, unless
nkeynes@635
    61
 * there's only one buffer this needs to be wrapped.
nkeynes@635
    62
 */
nkeynes@635
    63
gboolean gl_read_render_buffer( unsigned char *target, render_buffer_t buffer, 
nkeynes@736
    64
                                int rowstride, int colour_format );
nkeynes@635
    65
nkeynes@635
    66
nkeynes@635
    67
/****** FBO handling (gl_fbo.c) ******/
nkeynes@635
    68
gboolean gl_fbo_is_supported();
nkeynes@635
    69
void gl_fbo_shutdown();
nkeynes@635
    70
void gl_fbo_init( display_driver_t driver );
nkeynes@635
    71
void gl_fbo_detach();
nkeynes@635
    72
nkeynes@1159
    73
/** VBO/VAR handling (gl_vbo.c) ******/
nkeynes@1159
    74
void gl_vbo_init( display_driver_t driver );
nkeynes@1159
    75
nkeynes@1159
    76
/* Set the fallback vertex buffer handling, for drivers with no GL */
nkeynes@1159
    77
void gl_vbo_fallback_init( display_driver_t driver );
nkeynes@1159
    78
nkeynes@736
    79
#ifdef __cplusplus
nkeynes@736
    80
}
nkeynes@736
    81
#endif
nkeynes@736
    82
nkeynes@736
    83
#endif /* !lxdream_video_gl_H */
.