Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Go to the source code of this file.
Macros | |
#define | ogl_WarnIfError() ogl_WarnIfErrorLoc(__FILE__, __LINE__) |
Functions | |
bool | ogl_Init (void *(load)(const char *), void *display, int subsystem) |
initialization: import extension function pointers and do feature detect. More... | |
void | ogl_SetVsyncEnabled (bool enabled) |
Change vsync state. More... | |
bool | ogl_HaveExtension (const char *ext) |
Check whether the given OpenGL extension is supported. More... | |
bool | ogl_HaveVersion (int major, int minor) |
make sure the OpenGL implementation version matches or is newer than the given version. More... | |
const char * | ogl_HaveExtensions (int dummy,...) SENTINEL_ARG |
check if a list of extensions are all supported (as determined by ogl_HaveExtension). More... | |
const char * | ogl_ExtensionString () |
get a list of all supported extensions. More... | |
void | ogl_WarnIfErrorLoc (const char *file, int line) |
raise a warning (break into the debugger) if an OpenGL error is pending. More... | |
const char * | ogl_GetErrorName (GLenum err) |
get a name of the error. More... | |
bool | ogl_SquelchError (GLenum err_to_ignore) |
ignore and reset the specified OpenGL error. More... | |
#define ogl_WarnIfError | ( | ) | ogl_WarnIfErrorLoc(__FILE__, __LINE__) |
const char * ogl_ExtensionString | ( | ) |
get a list of all supported extensions.
useful for crash logs / system information.
const char * ogl_GetErrorName | ( | GLenum | err | ) |
get a name of the error.
useful for debug.
bool ogl_HaveExtension | ( | const char * | ext | ) |
Check whether the given OpenGL extension is supported.
NOTE: this does not check whether the extensions is loaded. for that, check whether GLAD_<extension name> is not null.
ext | extension string; exact case. |
const char * ogl_HaveExtensions | ( | int | dummy, |
... | |||
) |
check if a list of extensions are all supported (as determined by ogl_HaveExtension).
dummy | value ignored; varargs requires a placeholder. follow it by a list of const char* extension string parameters, terminated by a 0 pointer. |
bool ogl_HaveVersion | ( | int | major, |
int | minor | ||
) |
make sure the OpenGL implementation version matches or is newer than the given version.
bool ogl_Init | ( | void * | load)(const char *, |
void * | display, | ||
int | subsystem | ||
) |
initialization: import extension function pointers and do feature detect.
call before using any other function. fails if OpenGL not ready for use. TODO: move loading functionality to GL backend.
void ogl_SetVsyncEnabled | ( | bool | enabled | ) |
Change vsync state.
bool ogl_SquelchError | ( | GLenum | err_to_ignore | ) |
ignore and reset the specified OpenGL error.
this is useful for suppressing annoying error messages, e.g. "invalid enum" for GL_CLAMP_TO_EDGE even though we've already warned the user that their OpenGL implementation is too old.
call after the fact, i.e. the error has been raised. if another or different error is pending, those are reported immediately.
err_to_ignore | one of the glGetError enums. |
void ogl_WarnIfErrorLoc | ( | const char * | file, |
int | line | ||
) |
raise a warning (break into the debugger) if an OpenGL error is pending.
resets the OpenGL error state afterwards.
when an error is reported, insert calls to this in a binary-search scheme to quickly narrow down the actual error location.
reports a bogus invalid_operation error if called before OpenGL is initialized, so don't!
disabled in release mode for efficiency and to avoid annoying errors.