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 4
33#define OPENGL_DOUBLEBUF (1<<1)
34#define OPENGL_VSYNC (1<<2)
35#define OPENGL_SUBROUTINES (1<<3)
36#define gl_has(f) (gl_screen.flags & (f))
40typedef struct glInfo_ {
71 GLuint fbo[OPENGL_NUM_FBOS];
72 GLuint fbo_tex[OPENGL_NUM_FBOS];
76extern mat4 gl_view_matrix;
78#define SCREEN_X gl_screen.x
79#define SCREEN_Y gl_screen.y
80#define SCREEN_W gl_screen.w
81#define SCREEN_H gl_screen.h
86#define COLOUR(x) glColour4d((x).r,(x).g,(x).b,(x).a)
87#define ACOLOUR(x,a) glColour4d((x).r,(x).g,(x).b,a)
119#define gl_checkErr() gl_checkHandleError( __func__, __LINE__ )
120void gl_checkHandleError(
const char *func,
int line );
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(int enable)
Enables or disables the colourblind shader.
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.