2016-07-09 02:18:40 +00:00
|
|
|
#ifndef BBGE_RENDERBASE_H
|
|
|
|
#define BBGE_RENDERBASE_H
|
|
|
|
|
2024-04-15 22:12:56 +00:00
|
|
|
#include <SDL.h>
|
2016-07-09 02:18:40 +00:00
|
|
|
|
2016-09-26 02:13:28 +00:00
|
|
|
// Define this before including GL headers to avoid pulling in windows.h
|
|
|
|
#if defined(_WIN32) && !defined(APIENTRY)
|
|
|
|
# define APIENTRY __stdcall
|
|
|
|
#endif
|
|
|
|
|
2016-07-09 02:18:40 +00:00
|
|
|
#define GL_GLEXT_LEGACY 1
|
2017-02-09 20:17:21 +00:00
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glext.h>
|
2016-07-09 02:18:40 +00:00
|
|
|
|
2023-08-09 00:33:52 +00:00
|
|
|
// Extensions from newer glext.h versions
|
|
|
|
#ifndef GL_ARB_debug_output
|
|
|
|
#define GL_ARB_debug_output 1
|
|
|
|
typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
|
|
|
|
#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
|
|
|
|
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
|
|
|
|
#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
|
|
|
|
#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
|
|
|
|
#define GL_DEBUG_SOURCE_API_ARB 0x8246
|
|
|
|
#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
|
|
|
|
#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
|
|
|
|
#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
|
|
|
|
#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
|
|
|
|
#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
|
|
|
|
#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
|
|
|
|
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
|
|
|
|
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
|
|
|
|
#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
|
|
|
|
#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
|
|
|
|
#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
|
|
|
|
#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
|
|
|
|
#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
|
|
|
|
#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
|
|
|
|
#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
|
|
|
|
#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
|
|
|
|
#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
|
|
|
|
typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
|
|
|
typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
|
|
|
|
typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam);
|
|
|
|
typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
|
|
|
|
#ifdef GL_GLEXT_PROTOTYPES
|
|
|
|
GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
|
|
|
GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf);
|
|
|
|
GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const void *userParam);
|
|
|
|
GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
|
|
|
|
#endif
|
|
|
|
#endif /* GL_ARB_debug_output */
|
|
|
|
|
2016-07-09 02:18:40 +00:00
|
|
|
#ifdef _WINDOWS_
|
|
|
|
#error windows.h was included! euuugh!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef APIENTRY
|
|
|
|
#undef APIENTRY
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef WINGDIAPI
|
|
|
|
#undef WINGDIAPI
|
|
|
|
#endif
|
|
|
|
|
2016-09-26 02:13:28 +00:00
|
|
|
extern PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT;
|
|
|
|
|
|
|
|
// GL_ARB_shader_objects
|
|
|
|
extern PFNGLCREATEPROGRAMOBJECTARBPROC glCreateProgramObjectARB;
|
|
|
|
extern PFNGLDELETEOBJECTARBPROC glDeleteObjectARB;
|
|
|
|
extern PFNGLUSEPROGRAMOBJECTARBPROC glUseProgramObjectARB;
|
|
|
|
extern PFNGLCREATESHADEROBJECTARBPROC glCreateShaderObjectARB;
|
|
|
|
extern PFNGLSHADERSOURCEARBPROC glShaderSourceARB;
|
|
|
|
extern PFNGLCOMPILESHADERARBPROC glCompileShaderARB;
|
|
|
|
extern PFNGLGETOBJECTPARAMETERIVARBPROC glGetObjectParameterivARB;
|
|
|
|
extern PFNGLATTACHOBJECTARBPROC glAttachObjectARB;
|
|
|
|
extern PFNGLGETINFOLOGARBPROC glGetInfoLogARB;
|
|
|
|
extern PFNGLLINKPROGRAMARBPROC glLinkProgramARB;
|
|
|
|
extern PFNGLGETUNIFORMLOCATIONARBPROC glGetUniformLocationARB;
|
|
|
|
extern PFNGLGETACTIVEUNIFORMARBPROC glGetActiveUniformARB;
|
2023-07-20 20:30:56 +00:00
|
|
|
extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
|
2016-09-26 02:13:28 +00:00
|
|
|
extern PFNGLUNIFORM2FVARBPROC glUniform2fvARB;
|
|
|
|
extern PFNGLUNIFORM3FVARBPROC glUniform3fvARB;
|
|
|
|
extern PFNGLUNIFORM4FVARBPROC glUniform4fvARB;
|
|
|
|
extern PFNGLUNIFORM1IVARBPROC glUniform1ivARB;
|
|
|
|
extern PFNGLUNIFORM2IVARBPROC glUniform2ivARB;
|
|
|
|
extern PFNGLUNIFORM3IVARBPROC glUniform3ivARB;
|
|
|
|
extern PFNGLUNIFORM4IVARBPROC glUniform4ivARB;
|
|
|
|
|
|
|
|
extern PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT;
|
|
|
|
extern PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT;
|
|
|
|
extern PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT;
|
|
|
|
extern PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT;
|
|
|
|
extern PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT;
|
|
|
|
extern PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT;
|
|
|
|
extern PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT;
|
|
|
|
extern PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT;
|
|
|
|
extern PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT;
|
|
|
|
extern PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT;
|
|
|
|
extern PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT;
|
|
|
|
extern PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT;
|
|
|
|
extern PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT;
|
|
|
|
extern PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT;
|
|
|
|
extern PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT;
|
|
|
|
extern PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT;
|
|
|
|
|
2023-07-20 20:30:56 +00:00
|
|
|
extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
|
|
|
|
extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
|
|
|
|
extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
|
|
|
|
extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
|
|
|
|
extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
|
|
|
|
extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
|
|
|
|
extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
|
2016-07-09 02:18:40 +00:00
|
|
|
|
|
|
|
#endif
|