Commit 57607c96 authored by Robert Menzel's avatar Robert Menzel

initial version with basic KHR_debug emulator

parent a47ebb95
......@@ -9,19 +9,9 @@
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/GL.hh>
#if (ACGL_OPENGL_VERSION < 43)
#define ACGL_EMULATE_KHR_DEBUG
#endif
namespace ACGL{
namespace OpenGL{
//! will just call the gl version unless ACGL_EMULATE_KHR_DEBUG is defined
void acglDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* buf);
//! will just call the gl version unless ACGL_EMULATE_KHR_DEBUG is defined
void acglDebugMessageCallback(GLDEBUGPROC callback, const void* userParam);
//! converts a KHR debug source enum to a human readable string
const char *debugSourceName( GLenum _source );
......
......@@ -60,11 +60,6 @@
// To compare the OpenGL version number we define a new ACGL_OPENGL_VERSION XY define here
// analog to ACGL_OPENGL_VERSION_XY
//
// used internally only:
#define ACGL_LATEST_SUPPORTED_OPENGL_VERSION ACGL_OPENGL_VERSION_44
// OpenGL ES 2.0 is the default for embedded:
#ifdef ACGL_OPENGL_ES
# if defined (ACGL_OPENGLES_VERSION_30)
......@@ -130,6 +125,8 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CHECKGLERROR();
#ifdef ACGL_OPENGL_ES
// ES does not know 64bit ints but we need them for the Buffer class:
#include <stdint.h>
......@@ -190,9 +187,7 @@
// The selection could also be done with some preprocessor magic but it confuses most IDEs.
//
#ifdef ACGL_OPENGL_PROFILE_CORE
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_LATEST_SUPPORTED_OPENGL_VERSION)
#include <ACGL/OpenGL/glloaders/gl_core_43.hh>
#elif defined (ACGL_OPENGL_VERSION_32)
#if defined (ACGL_OPENGL_VERSION_32)
#include <ACGL/OpenGL/glloaders/gl_core_32.hh>
#elif defined (ACGL_OPENGL_VERSION_33)
#include <ACGL/OpenGL/glloaders/gl_core_33.hh>
......@@ -209,14 +204,12 @@
#endif
#else
// compatibility profile:
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_LATEST_SUPPORTED_OPENGL_VERSION)
#include <ACGL/OpenGL/glloaders/gl_compatibility_43.hh>
#elif defined (ACGL_OPENGL_VERSION_21)
#include <ACGL/OpenGL/glloaders/gl_21.hh>
#if defined (ACGL_OPENGL_VERSION_21)
#include <ACGL/OpenGL/glloaders/gl_compatibility_21.hh>
#elif defined (ACGL_OPENGL_VERSION_30)
#include <ACGL/OpenGL/glloaders/gl_30.hh>
#include <ACGL/OpenGL/glloaders/gl_compatibility_30.hh>
#elif defined (ACGL_OPENGL_VERSION_31)
#include <ACGL/OpenGL/glloaders/gl_31.hh>
#include <ACGL/OpenGL/glloaders/gl_compatibility_31.hh>
#elif defined (ACGL_OPENGL_VERSION_32)
#include <ACGL/OpenGL/glloaders/gl_compatibility_32.hh>
#elif defined (ACGL_OPENGL_VERSION_33)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -187,11 +187,11 @@ GLenum openGLError_( const char *_fileName, const unsigned long _lineNumber )
// OpenGL does not forbit the implementation to stack up more than one error code
// so we have to check those in a loop:
while ( currentError != GL_NO_ERROR ) {
//ACGL::Utils::error() << "GL error in file " << _fileName << ":" << _lineNumber << " - " << acglErrorString( currentError ) << std::endl;
ACGL::Utils::error() << "GL error in file " << _fileName << ":" << _lineNumber << " - " << acglErrorString( currentError ) << std::endl;
stringstream sstream (stringstream::in | stringstream::out);
sstream << acglErrorString( currentError ) << " in file " << _fileName << ":" << _lineNumber;
acglDebugMessageInsert( GL_DEBUG_SOURCE_API, GL_DEBUG_TYPE_ERROR, currentError, GL_DEBUG_SEVERITY_HIGH, -1, sstream.str().c_str() );
//stringstream sstream (stringstream::in | stringstream::out);
//sstream << acglErrorString( currentError ) << " in file " << _fileName << ":" << _lineNumber;
//acglDebugMessageInsert( GL_DEBUG_SOURCE_API, GL_DEBUG_TYPE_ERROR, currentError, GL_DEBUG_SEVERITY_HIGH, -1, sstream.str().c_str() );
lastError = currentError;
currentError = glGetError();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,6 +5,9 @@
**********************************************************************/
#include <ACGL/OpenGL/GL.hh>
#include <iostream>
using namespace std;
// don't do anything if an other extension loader (e.g. GLEW) should get used:
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
......@@ -14,9 +17,7 @@
#endif
#ifdef ACGL_OPENGL_PROFILE_CORE
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_LATEST_SUPPORTED_OPENGL_VERSION)
#include "gl_core_44.inc"
#elif defined (ACGL_OPENGL_VERSION_32)
#if defined (ACGL_OPENGL_VERSION_32)
#include "gl_core_32.inc"
#elif defined (ACGL_OPENGL_VERSION_33)
#include "gl_core_33.inc"
......@@ -35,9 +36,7 @@
#endif
#else
// compatibility profile:
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_LATEST_SUPPORTED_OPENGL_VERSION)
#include "gl_compatibility_44.inc"
#elif defined (ACGL_OPENGL_VERSION_21)
#if defined (ACGL_OPENGL_VERSION_21)
#include "gl_compatibility_21.inc"
#elif defined (ACGL_OPENGL_VERSION_30)
#include "gl_compatibility_30.inc"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment