-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added pre-generated files.
- Loading branch information
Showing
18 changed files
with
96,411 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule OpenGLRegistry
updated
92 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
#pragma once | ||
#ifndef __AnyGL_h_ | ||
#define __AnyGL_h_ 1 | ||
|
||
#include "AnyGLConfig.h" | ||
|
||
/** | ||
* @brief Initializes the AnyGL library. | ||
* | ||
* This will initialize the loading library, such as GLX or WGL. On some platforms this is | ||
* necessary to load extensions in the loading library required to properly create an OpenGL | ||
* context. | ||
* | ||
* @return 1 if the initialization succeeded, 0 if it failed. | ||
*/ | ||
ANYGL_EXPORT int AnyGL_initialize(void); | ||
|
||
/** | ||
* @brief Loads the OpenGL functions based on the currently bound context. | ||
* @return 1 if the load succeedd, 0 if it failed. | ||
*/ | ||
ANYGL_EXPORT int AnyGL_load(void); | ||
|
||
/** | ||
* @brief Gets the version of OpenGL. | ||
* @param[out] major The major version. | ||
* @param[out] minor The minor viersion. | ||
* @param[out] es 1 if OpenGL ES, 0 if desktop OpenGL. | ||
*/ | ||
ANYGL_EXPORT void AnyGL_getGLVersion(int* major, int* minor, int* es); | ||
|
||
/** | ||
* @brief Checks to see if the OpenGL version is at least the version provided. | ||
* @param major The major version. | ||
* @param minor The minor version. | ||
* @param es 1 if OpenGL ES, 0 if desktop OpenGL. | ||
* @return 1 if the OpenGL version is less than or equal to the major and minor version and es | ||
* matches whether or not OpenGL ES is enabled. | ||
*/ | ||
ANYGL_EXPORT int AnyGL_atLeastVersion(int major, int minor, int es); | ||
|
||
/** | ||
* @brief Shuts down the AnyGL library, freeing any persistently held resources. | ||
*/ | ||
ANYGL_EXPORT void AnyGL_shutdown(void); | ||
|
||
/** | ||
* @brief Gets the string for an OpenGL error. | ||
* @param error The error code returned from glGetError() or glCheckFramebufferStatus(). | ||
* @return The string for the error, or "UNKNOWN" if not a known error code. | ||
*/ | ||
ANYGL_EXPORT const char* AnyGL_errorString(unsigned int error); | ||
|
||
/** | ||
* @brief Function pointer type for the error function. | ||
* @param file The file for the original call into OpenGL. | ||
* @param function The function for the original call into OpenGL. | ||
* @Param line The line for the original call into OpenGL. | ||
* @param glError The OpenGL error code. | ||
* @param glFunction The GL function called, including parameters passed in. | ||
*/ | ||
typedef void (*AnyGLErrorFunc)(const char* file, const char* function, unsigned int line, | ||
unsigned int glError, const char* glFunction); | ||
|
||
/** | ||
* @brief Sets the error function. | ||
* | ||
* This is used when debugging is enabled and a GL error is is thrown. | ||
* | ||
* @param errorFunc The function to set. If NULL, the default error function will be used. | ||
*/ | ||
ANYGL_EXPORT void AnyGL_setErrorFunc(AnyGLErrorFunc func); | ||
|
||
/** | ||
* @brief Gets whether or not debugging is enabled. | ||
* @return 1 if debugging is enabled, 0 of not. | ||
*/ | ||
ANYGL_EXPORT int AnyGL_getDebugEnabled(void); | ||
|
||
/** | ||
* @brief Sets whether or not debugging is enabled. | ||
* | ||
* This will check for an OpenGL error for each function call, calling the error function if one | ||
* occurred, passing in a string version of the function call with parameter values and information | ||
* about the callsite. This will do nothing if ANYGL_ALLOW_DEBUG is defined to 0. | ||
* | ||
* @param enabled 1 if debugging should be enabled, 0 if not. | ||
*/ | ||
ANYGL_EXPORT void AnyGL_setDebugEnabled(int enabled); | ||
|
||
/** | ||
* @brief Gets whether or not error checking is enabled for debug functions. | ||
* @return 1 if error checking is enabled, 0 if not. | ||
*/ | ||
ANYGL_EXPORT int AnyGL_getErrorCheckingEnabled(void); | ||
|
||
/** | ||
* @brief Sets whether or not error checking is enabled for debug functions. | ||
* | ||
* This can be used to disable error checking for situations such as loading resources where you | ||
* may want to check for error codes yourself. | ||
* @remark This is maintained separately for each thread. | ||
* @param enabled 1 if error checking should be enabled, 0 if not. | ||
*/ | ||
ANYGL_EXPORT void AnyGL_setErrorCheckingEnabled(int enabled); | ||
|
||
/** | ||
* @brief Gets the last OpenGL callsite. | ||
* @remark This is maintained separately for each thread and is only recorded when | ||
* ANYGL_ALLOW_DEBUG is 1, though debugging doesn't need to be enabled. | ||
* @param[out] file The file of the callsite. | ||
* @param[out] function The function of the callsite. | ||
* @param[out] line The line of the callsite. | ||
*/ | ||
ANYGL_EXPORT void AnyGL_getLastCallsite(const char** file, const char** function, | ||
unsigned int* line); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
#pragma once | ||
#ifndef __AnyGLConfig_h_ | ||
#define __AnyGLConfig_h_ 1 | ||
|
||
#if defined(_WIN32) | ||
# define ANYGL_WINDOWS 1 | ||
#elif defined(__ANDROID__) | ||
# define ANYGL_ANDROID 1 | ||
#elif defined(__APPLE__) | ||
# define ANYGL_APPLE 1 | ||
# include "TargetConditionals.h" | ||
# if TARGET_OS_IPHONE | ||
# define ANYGL_IOS 1 | ||
# endif | ||
#endif | ||
|
||
#ifndef ANYGL_WINDOWS | ||
#define ANYGL_WINDOWS 0 | ||
#endif | ||
|
||
#ifndef ANYGL_ANDROID | ||
#define ANYGL_ANDROID 0 | ||
#endif | ||
|
||
#ifndef ANYGL_APPLE | ||
#define ANYGL_APPLE 0 | ||
#endif | ||
|
||
#ifndef ANYGL_IOS | ||
#define ANYGL_IOS 0 | ||
#endif | ||
|
||
/* #define this to override whether or not to use OpenGL ES. */ | ||
#ifndef ANYGL_GLES | ||
#define ANYGL_GLES (ANYGL_ANDROID || ANYGL_IOS) | ||
#endif | ||
|
||
/* #define this to the OpenGL version (times 10) to include when loading via function pointer. */ | ||
#ifndef ANYGL_GL_VERSION | ||
#define ANYGL_GL_VERSION 33 | ||
#endif | ||
|
||
/* #define this to the OpenGL ES version (times 10) to include when loading via function pointer. */ | ||
#ifndef ANYGL_GLES_VERSION | ||
#define ANYGL_GLES_VERSION 30 | ||
#endif | ||
|
||
/* | ||
* Libraries for loading OpenGL functions. | ||
* ANYGL_LOAD_FPTR takes the function pointer from the system OpenGL includes. | ||
*/ | ||
#define ANYGL_LOAD_FPTR 0 | ||
#define ANYGL_LOAD_EGL 1 | ||
#define ANYGL_LOAD_WGL 2 | ||
#define ANYGL_LOAD_GLX 3 | ||
|
||
/* #define this to override the default library. */ | ||
#ifndef ANYGL_LOAD | ||
#if ANYGL_APPLE | ||
# define ANYGL_LOAD ANYGL_LOAD_FPTR | ||
#elif ANYGL_GLES | ||
# define ANYGL_LOAD ANYGL_LOAD_EGL | ||
#elif ANYGL_WINDOWS | ||
# define ANYGL_LOAD ANYGL_LOAD_WGL | ||
#else | ||
# define ANYGL_LOAD ANYGL_LOAD_GLX | ||
#endif | ||
#endif | ||
|
||
/* | ||
* #define ANYGL_DYNAMIC to use dynamic linking. | ||
* #define ANYGL_BUILD to export symbols, otherwise they will be imported. | ||
*/ | ||
#ifndef ANYGL_EXPORT | ||
#if ANYGL_DYNAMIC | ||
# ifdef _MSC_VER | ||
# ifdef ANYGL_BUILD | ||
# define ANYGL_EXPORT __declspec(dllexport) | ||
# else | ||
# define ANYGL_EXPORT __declspec(dllimport) | ||
# endif | ||
# else | ||
# define ANYGL_EXPORT __attribute__((visibility("default"))) | ||
# endif | ||
#else | ||
# define ANYGL_EXPORT | ||
#endif | ||
#endif | ||
|
||
/* #define this to override the calling convention. */ | ||
#ifndef APIENTRY | ||
#if ANYGL_WINDOWS | ||
# define APIENTRY __stdcall | ||
#else | ||
# define APIENTRY | ||
#endif | ||
#endif | ||
|
||
/* | ||
* #define this to 1 if you want to allow debugging OpenGL functions. Useful for debugging, but | ||
* adds some overhead, so not suitable for release builds. | ||
*/ | ||
#ifndef ANYGL_ALLOW_DEBUG | ||
#ifdef NDEBUG | ||
# define ANYGL_ALLOW_DEBUG 0 | ||
#else | ||
# define ANYGL_ALLOW_DEBUG 1 | ||
#endif | ||
#endif | ||
|
||
#endif |
Oops, something went wrong.