17#include "opengl_render.h"
18#include "opengl_shader.h"
19#include "opengl_tex.h"
20#include "opengl_vbo.h"
22#include "shaders.gen.h"
24#define OPENGL_NUM_FBOS 3
29#define OPENGL_DOUBLEBUF (1<<1)
30#define OPENGL_VSYNC (1<<2)
31#define OPENGL_SUBROUTINES (1<<3)
32#define gl_has(f) (gl_screen.flags & (f))
36typedef struct glInfo_ {
67 GLuint fbo[OPENGL_NUM_FBOS];
68 GLuint fbo_tex[OPENGL_NUM_FBOS];
72extern mat4 gl_view_matrix;
74#define SCREEN_X gl_screen.x
75#define SCREEN_Y gl_screen.y
76#define SCREEN_W gl_screen.w
77#define SCREEN_H gl_screen.h
82#define COLOUR(x) glColor4d((x).r,(x).g,(x).b,(x).a)
83#define ACOLOUR(x,a) glColor4d((x).r,(x).g,(x).b,a)
115#define gl_checkErr() gl_checkHandleError( __func__, __LINE__ )
116void gl_checkHandleError(
const char *func,
int line );
void gl_colorblind(int enable)
Enables or disables the colorblind shader.
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_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.
GLint gl_stringToFilter(const char *s)
Gets the associated min/mag filter from a string.
void gl_exit(void)
Cleans up OpenGL, the works.
void gl_viewport(int x, int y, int w, int h)
Sets the opengl viewport.
void gl_windowToScreenPos(int *sx, int *sy, int wx, int wy)
Translates the window position to screen position.
int gl_init(void)
Initializes SDL/OpenGL and the works.
GLboolean gl_hasVersion(int major, int minor)
Checks to see if opengl version is at least major.minor.
GLint 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.