14#include "opengl_render.h"
15#include "opengl_shader.h"
16#include "opengl_tex.h"
17#include "opengl_vbo.h"
19#define OPENGL_NUM_FBOS 4
28#define OPENGL_DOUBLEBUF ( 1 << 1 )
29#define OPENGL_VSYNC ( 1 << 2 )
30#define OPENGL_SUBROUTINES \
33#define gl_has( f ) ( gl_screen.flags & ( f ) )
37typedef struct glInfo_ {
73 GLuint
fbo[OPENGL_NUM_FBOS];
80extern mat4 gl_view_matrix;
82#define SCREEN_X gl_screen.x
83#define SCREEN_Y gl_screen.y
84#define SCREEN_W gl_screen.w
85#define SCREEN_H gl_screen.h
90int gl_init(
unsigned int extra_flags );
118void gl_saveFboDepth( GLuint fbo,
const char *filename );
120#define gl_checkErr() gl_checkHandleError( __func__, __LINE__ )
121int gl_checkHandleError(
const char *func,
int line );
123#define gl_checkErr() 0
void gl_setDefViewport(int x, int y, int w, int h)
Sets the default viewport.
void gl_screenshot(const char *filename)
Takes a screenshot.
void gl_defViewport(void)
Resets viewport to default.
void gl_colourblind(void)
Enables or disables the colourblind shader.
GLenum gl_stringToBlendFactor(const char *s)
Gets a blend factor from a string.
void gl_resize(void)
Handles a window resize and resets gl_screen parameters.
void gl_screenToWindowPos(int *wx, int *wy, int sx, int sy)
Translates the screen position to windos position.
void gl_exit(void)
Cleans up OpenGL, the works.
void gl_viewport(int x, int y, int w, int h)
Sets the opengl viewport.
int gl_init(unsigned int extra_flags)
Initializes SDL/OpenGL and the works.
void gl_windowToScreenPos(int *sx, int *sy, int wx, int wy)
Translates the window position to screen position.
GLenum gl_stringToBlendFunc(const char *s)
Gets a blend function from a string.
GLenum gl_stringToFilter(const char *s)
Gets the associated min/mag filter from a string.
GLboolean gl_hasVersion(int major, int minor)
Checks to see if opengl version is at least major.minor.
GLenum gl_stringToClamp(const char *s)
Gets the associated min/mag filter from a string.
int gl_setupFullscreen(void)
Tries to apply the configured display mode to the window.
Stores data about the current opengl environment.
GLuint fbo_tex[OPENGL_NUM_FBOS]
GLuint fbo[OPENGL_NUM_FBOS]
GLuint fbo_depth_tex[OPENGL_NUM_FBOS]