filename | src/drivers/video_gl.h |
changeset | 1251:b8ab59d39756 |
prev | 1246:887f7b0ac7f3 |
next | 1258:f8a9c0fd2abb |
author | nkeynes |
date | Sat Mar 03 16:11:28 2012 +1000 (12 years ago) |
permissions | -rw-r--r-- |
last change | Support depth component 16 as well as 24 (add capability flag for the available bits) Put remaining TODOs inside HAVE_OPENGL_FIXEDFUNC blocks Add swap-buffer calls for EGL (does not appear to support rendering directly to front-buffer) |
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 extern uint32_t video_width, video_height;
28 /**
29 * Set the video size used by the frame blits
30 */
31 void gl_set_video_size( uint32_t width, uint32_t height, int flipped );
33 /**
34 * Generic GL routine to draw the given frame buffer into a texture
35 */
36 gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id );
38 /**
39 * Reset the GL state to its initial values
40 */
41 void gl_reset_state();
43 /**
44 * Generic GL routine to blank the display view with the specified colour.
45 */
46 void gl_display_blank( uint32_t colour );
48 /**
49 * Write a rectangular texture (GL_TEXTURE_2D) to the display frame
50 */
51 void gl_display_render_buffer( render_buffer_t buffer );
53 /**
54 * Write a rectangular texture (GL_TEXTURE_2D) to the display frame
55 */
56 void gl_texture_window( int width, int height, int tex_id, gboolean inverted );
58 /**
59 * Convert window coordinates to dreamcast device coords (640x480) using the
60 * same viewable area as gl_texture_window.
61 * If the coordinates are outside the viewable area, the result is -1,-1.
62 */
63 void gl_window_to_system_coords( int *x, int *y );
65 /**
66 * Generic GL read_render_buffer. This function assumes that the caller
67 * has already set the appropriate glReadBuffer(); in other words, unless
68 * there's only one buffer this needs to be wrapped.
69 */
70 gboolean gl_read_render_buffer( unsigned char *target, render_buffer_t buffer,
71 int rowstride, int colour_format );
74 void gl_framebuffer_setup(void);
75 void gl_framebuffer_cleanup(void);
76 /****** FBO handling (gl_fbo.c) ******/
77 gboolean gl_fbo_is_supported();
78 void gl_fbo_shutdown();
79 void gl_fbo_init( display_driver_t driver );
80 void gl_fbo_detach();
82 /** VBO/VAR handling (gl_vbo.c) ******/
83 void gl_vbo_init( display_driver_t driver );
85 /* Set the fallback vertex buffer handling, for drivers with no GL */
86 void gl_vbo_fallback_init( display_driver_t driver );
88 #ifdef __cplusplus
89 }
90 #endif
92 #endif /* !lxdream_video_gl_H */
.