nkeynes@635: /** nkeynes@635: * $Id$ nkeynes@635: * nkeynes@662: * Common GL code that doesn't depend on a specific implementation nkeynes@635: * nkeynes@635: * Copyright (c) 2005 Nathan Keynes. nkeynes@635: * nkeynes@635: * This program is free software; you can redistribute it and/or modify nkeynes@635: * it under the terms of the GNU General Public License as published by nkeynes@635: * the Free Software Foundation; either version 2 of the License, or nkeynes@635: * (at your option) any later version. nkeynes@635: * nkeynes@635: * This program is distributed in the hope that it will be useful, nkeynes@635: * but WITHOUT ANY WARRANTY; without even the implied warranty of nkeynes@635: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the nkeynes@635: * GNU General Public License for more details. nkeynes@635: */ nkeynes@635: nkeynes@736: #ifndef lxdream_video_gl_H nkeynes@736: #define lxdream_video_gl_H 1 nkeynes@736: nkeynes@736: #ifdef __cplusplus nkeynes@736: extern "C" { nkeynes@736: #endif nkeynes@635: nkeynes@1236: extern uint32_t video_width, video_height; nkeynes@1236: nkeynes@1236: /** nkeynes@1236: * Set the video size used by the frame blits nkeynes@1236: */ nkeynes@1236: void gl_set_video_size( uint32_t width, uint32_t height ); nkeynes@1236: nkeynes@635: /** nkeynes@635: * Generic GL routine to draw the given frame buffer into a texture nkeynes@635: */ nkeynes@635: gboolean gl_load_frame_buffer( frame_buffer_t frame, int tex_id ); nkeynes@635: nkeynes@635: /** nkeynes@669: * Reset the GL state to its initial values nkeynes@669: */ nkeynes@669: void gl_reset_state(); nkeynes@669: nkeynes@669: /** nkeynes@635: * Generic GL routine to blank the display view with the specified colour. nkeynes@635: */ nkeynes@669: void gl_display_blank( uint32_t colour ); nkeynes@635: nkeynes@635: /** nkeynes@1222: * Write a rectangular texture (GL_TEXTURE_2D) to the display frame nkeynes@635: */ nkeynes@635: void gl_display_render_buffer( render_buffer_t buffer ); nkeynes@635: nkeynes@635: /** nkeynes@1222: * Write a rectangular texture (GL_TEXTURE_2D) to the display frame nkeynes@635: */ nkeynes@635: void gl_texture_window( int width, int height, int tex_id, gboolean inverted ); nkeynes@635: nkeynes@635: /** nkeynes@854: * Convert window coordinates to dreamcast device coords (640x480) using the nkeynes@854: * same viewable area as gl_texture_window. nkeynes@854: * If the coordinates are outside the viewable area, the result is -1,-1. nkeynes@854: */ nkeynes@854: void gl_window_to_system_coords( int *x, int *y ); nkeynes@854: nkeynes@854: /** nkeynes@635: * Generic GL read_render_buffer. This function assumes that the caller nkeynes@635: * has already set the appropriate glReadBuffer(); in other words, unless nkeynes@635: * there's only one buffer this needs to be wrapped. nkeynes@635: */ nkeynes@635: gboolean gl_read_render_buffer( unsigned char *target, render_buffer_t buffer, nkeynes@736: int rowstride, int colour_format ); nkeynes@635: nkeynes@635: nkeynes@635: /****** FBO handling (gl_fbo.c) ******/ nkeynes@635: gboolean gl_fbo_is_supported(); nkeynes@635: void gl_fbo_shutdown(); nkeynes@635: void gl_fbo_init( display_driver_t driver ); nkeynes@635: void gl_fbo_detach(); nkeynes@635: nkeynes@1159: /** VBO/VAR handling (gl_vbo.c) ******/ nkeynes@1159: void gl_vbo_init( display_driver_t driver ); nkeynes@1159: nkeynes@1159: /* Set the fallback vertex buffer handling, for drivers with no GL */ nkeynes@1159: void gl_vbo_fallback_init( display_driver_t driver ); nkeynes@1159: nkeynes@736: #ifdef __cplusplus nkeynes@736: } nkeynes@736: #endif nkeynes@736: nkeynes@736: #endif /* !lxdream_video_gl_H */