mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Update glext to make more recent GL functionality available
This commit is contained in:
parent
53696052b9
commit
62cefcab8b
@ -84,6 +84,7 @@
|
|||||||
#include <GL/gl.h>
|
#include <GL/gl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef __glext_h_
|
||||||
#undef GL_GLEXT_VERSION
|
#undef GL_GLEXT_VERSION
|
||||||
#include "panda_glext.h"
|
#include "panda_glext.h"
|
||||||
|
|
||||||
|
@ -546,19 +546,19 @@ reset() {
|
|||||||
_use_object_labels = false;
|
_use_object_labels = false;
|
||||||
#ifndef OPENGLES_1
|
#ifndef OPENGLES_1
|
||||||
if (gl_debug) {
|
if (gl_debug) {
|
||||||
PFNGLDEBUGMESSAGECALLBACKPROC _glDebugMessageCallback;
|
PFNGLDEBUGMESSAGECALLBACKPROC_P _glDebugMessageCallback;
|
||||||
PFNGLDEBUGMESSAGECONTROLPROC _glDebugMessageControl;
|
PFNGLDEBUGMESSAGECONTROLPROC _glDebugMessageControl;
|
||||||
|
|
||||||
if (is_at_least_gl_version(4, 3) || has_extension("GL_KHR_debug")) {
|
if (is_at_least_gl_version(4, 3) || has_extension("GL_KHR_debug")) {
|
||||||
#ifdef OPENGLES
|
#ifdef OPENGLES
|
||||||
_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)
|
_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC_P)
|
||||||
get_extension_func("glDebugMessageCallbackKHR");
|
get_extension_func("glDebugMessageCallbackKHR");
|
||||||
_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)
|
_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)
|
||||||
get_extension_func("glDebugMessageControlKHR");
|
get_extension_func("glDebugMessageControlKHR");
|
||||||
_glObjectLabel = (PFNGLOBJECTLABELPROC)
|
_glObjectLabel = (PFNGLOBJECTLABELPROC)
|
||||||
get_extension_func("glObjectLabelKHR");
|
get_extension_func("glObjectLabelKHR");
|
||||||
#else
|
#else
|
||||||
_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)
|
_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC_P)
|
||||||
get_extension_func("glDebugMessageCallback");
|
get_extension_func("glDebugMessageCallback");
|
||||||
_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)
|
_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)
|
||||||
get_extension_func("glDebugMessageControl");
|
get_extension_func("glDebugMessageControl");
|
||||||
@ -571,7 +571,7 @@ reset() {
|
|||||||
|
|
||||||
#ifndef OPENGLES
|
#ifndef OPENGLES
|
||||||
} else if (has_extension("GL_ARB_debug_output")) {
|
} else if (has_extension("GL_ARB_debug_output")) {
|
||||||
_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)
|
_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC_P)
|
||||||
get_extension_func("glDebugMessageCallbackARB");
|
get_extension_func("glDebugMessageCallbackARB");
|
||||||
_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)
|
_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)
|
||||||
get_extension_func("glDebugMessageControlARB");
|
get_extension_func("glDebugMessageControlARB");
|
||||||
@ -591,7 +591,7 @@ reset() {
|
|||||||
0, NULL, GLCAT.is_debug());
|
0, NULL, GLCAT.is_debug());
|
||||||
|
|
||||||
// Enable the callback.
|
// Enable the callback.
|
||||||
_glDebugMessageCallback((GLDEBUGPROC) &debug_callback, (void*)this);
|
_glDebugMessageCallback((GLDEBUGPROC_P) &debug_callback, (void*)this);
|
||||||
if (gl_debug_synchronous) {
|
if (gl_debug_synchronous) {
|
||||||
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
||||||
}
|
}
|
||||||
@ -1214,6 +1214,13 @@ reset() {
|
|||||||
get_extension_func("glBufferSubData");
|
get_extension_func("glBufferSubData");
|
||||||
_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)
|
_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)
|
||||||
get_extension_func("glDeleteBuffers");
|
get_extension_func("glDeleteBuffers");
|
||||||
|
|
||||||
|
#ifndef OPENGLES
|
||||||
|
_glMapBuffer = (PFNGLMAPBUFFERPROC)
|
||||||
|
get_extension_func("glMapBuffer");
|
||||||
|
_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)
|
||||||
|
get_extension_func("glUnmapBuffer");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef OPENGLES_1
|
#ifndef OPENGLES_1
|
||||||
else if (has_extension("GL_ARB_vertex_buffer_object")) {
|
else if (has_extension("GL_ARB_vertex_buffer_object")) {
|
||||||
@ -1229,6 +1236,10 @@ reset() {
|
|||||||
get_extension_func("glBufferSubDataARB");
|
get_extension_func("glBufferSubDataARB");
|
||||||
_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)
|
_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)
|
||||||
get_extension_func("glDeleteBuffersARB");
|
get_extension_func("glDeleteBuffersARB");
|
||||||
|
_glMapBuffer = (PFNGLMAPBUFFERPROC)
|
||||||
|
get_extension_func("glMapBufferARB");
|
||||||
|
_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)
|
||||||
|
get_extension_func("glUnmapBufferARB");
|
||||||
}
|
}
|
||||||
#endif // OPENGLES_1
|
#endif // OPENGLES_1
|
||||||
|
|
||||||
@ -1243,6 +1254,31 @@ reset() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPENGLES
|
||||||
|
// Check for various advanced buffer management features.
|
||||||
|
if (is_at_least_gl_version(3, 0) || has_extension("GL_ARB_map_buffer_range")) {
|
||||||
|
_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)
|
||||||
|
get_extension_func("glMapBufferRange");
|
||||||
|
} else {
|
||||||
|
_glMapBufferRange = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_at_least_gl_version(4, 4) || has_extension("GL_ARB_buffer_storage")) {
|
||||||
|
_glBufferStorage = (PFNGLBUFFERSTORAGEPROC)
|
||||||
|
get_extension_func("glBufferStorage");
|
||||||
|
|
||||||
|
if (_glBufferStorage != NULL) {
|
||||||
|
_supports_buffer_storage = true;
|
||||||
|
} else {
|
||||||
|
GLCAT.warning()
|
||||||
|
<< "Buffer storage advertised as supported by OpenGL runtime, but "
|
||||||
|
"could not get pointers to extension function.\n";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_supports_buffer_storage = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
_supports_vao = false;
|
_supports_vao = false;
|
||||||
|
|
||||||
if (is_at_least_gl_version(3, 0) || has_extension("GL_ARB_vertex_array_object")) {
|
if (is_at_least_gl_version(3, 0) || has_extension("GL_ARB_vertex_array_object")) {
|
||||||
@ -1557,11 +1593,12 @@ reset() {
|
|||||||
get_extension_func("glGetActiveUniformBlockiv");
|
get_extension_func("glGetActiveUniformBlockiv");
|
||||||
_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)
|
_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)
|
||||||
get_extension_func("glGetActiveUniformBlockName");
|
get_extension_func("glGetActiveUniformBlockName");
|
||||||
|
|
||||||
|
_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)
|
||||||
|
get_extension_func("glBindBufferBase");
|
||||||
} else {
|
} else {
|
||||||
_supports_uniform_buffers = false;
|
_supports_uniform_buffers = false;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
_supports_uniform_buffers = false;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check whether we support geometry instancing and instanced vertex attribs.
|
// Check whether we support geometry instancing and instanced vertex attribs.
|
||||||
|
@ -58,8 +58,8 @@ typedef double GLdouble;
|
|||||||
// declare these typedefs.
|
// declare these typedefs.
|
||||||
#if !defined( __EDG__ ) || defined( __INTEL_COMPILER ) // Protect the following from the Tau instrumentor and expose it for the intel compiler.
|
#if !defined( __EDG__ ) || defined( __INTEL_COMPILER ) // Protect the following from the Tau instrumentor and expose it for the intel compiler.
|
||||||
typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
|
typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index);
|
||||||
typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
|
typedef void (APIENTRY *GLDEBUGPROC_P)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const GLvoid *userParam);
|
||||||
typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam);
|
typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKPROC_P) (GLDEBUGPROC_P callback, const void *userParam);
|
||||||
typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled);
|
||||||
typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
|
typedef void (APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
|
||||||
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
|
typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img);
|
||||||
@ -640,7 +640,6 @@ protected:
|
|||||||
GLint _max_image_units;
|
GLint _max_image_units;
|
||||||
bool _supports_multi_bind;
|
bool _supports_multi_bind;
|
||||||
bool _supports_get_program_binary;
|
bool _supports_get_program_binary;
|
||||||
bool _supports_uniform_buffers;
|
|
||||||
|
|
||||||
#ifdef OPENGLES
|
#ifdef OPENGLES
|
||||||
bool _supports_depth24;
|
bool _supports_depth24;
|
||||||
@ -734,6 +733,18 @@ public:
|
|||||||
PFNGLBUFFERSUBDATAPROC _glBufferSubData;
|
PFNGLBUFFERSUBDATAPROC _glBufferSubData;
|
||||||
PFNGLDELETEBUFFERSPROC _glDeleteBuffers;
|
PFNGLDELETEBUFFERSPROC _glDeleteBuffers;
|
||||||
|
|
||||||
|
#ifndef OPENGLES
|
||||||
|
PFNGLMAPBUFFERPROC _glMapBuffer;
|
||||||
|
PFNGLUNMAPBUFFERPROC _glUnmapBuffer;
|
||||||
|
PFNGLMAPBUFFERRANGEPROC _glMapBufferRange;
|
||||||
|
|
||||||
|
bool _supports_uniform_buffers;
|
||||||
|
PFNGLBINDBUFFERBASEPROC _glBindBufferBase;
|
||||||
|
|
||||||
|
bool _supports_buffer_storage;
|
||||||
|
PFNGLBUFFERSTORAGEPROC _glBufferStorage;
|
||||||
|
#endif
|
||||||
|
|
||||||
PFNGLBLENDEQUATIONPROC _glBlendEquation;
|
PFNGLBLENDEQUATIONPROC _glBlendEquation;
|
||||||
PFNGLBLENDCOLORPROC _glBlendColor;
|
PFNGLBLENDCOLORPROC _glBlendColor;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user