mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-25 17:53:47 +00:00
114 lines
5.6 KiB
C
114 lines
5.6 KiB
C
#ifndef BBGE_RENDERBASE_H
|
|
#define BBGE_RENDERBASE_H
|
|
|
|
#include "SDL.h"
|
|
|
|
// Define this before including GL headers to avoid pulling in windows.h
|
|
#if defined(_WIN32) && !defined(APIENTRY)
|
|
# define APIENTRY __stdcall
|
|
#endif
|
|
|
|
#define GL_GLEXT_LEGACY 1
|
|
#include <GL/gl.h>
|
|
#include <GL/glext.h>
|
|
|
|
// 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 */
|
|
|
|
#ifdef _WINDOWS_
|
|
#error windows.h was included! euuugh!
|
|
#endif
|
|
|
|
#ifdef APIENTRY
|
|
#undef APIENTRY
|
|
#endif
|
|
|
|
#ifdef WINGDIAPI
|
|
#undef WINGDIAPI
|
|
#endif
|
|
|
|
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;
|
|
extern PFNGLUNIFORM1FVARBPROC glUniform1fvARB;
|
|
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;
|
|
|
|
extern PFNGLGENBUFFERSARBPROC glGenBuffersARB;
|
|
extern PFNGLDELETEBUFFERSARBPROC glDeleteBuffersARB;
|
|
extern PFNGLBUFFERDATAARBPROC glBufferDataARB;
|
|
extern PFNGLBUFFERSUBDATAARBPROC glBufferSubDataARB;
|
|
extern PFNGLBINDBUFFERARBPROC glBindBufferARB;
|
|
extern PFNGLMAPBUFFERARBPROC glMapBufferARB;
|
|
extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB;
|
|
|
|
#endif
|