Commit 68912e1a authored by Robert Menzel's avatar Robert Menzel

Initial commit of internal OpenGL loader.

This loader gets the OpenGL function pointers and checks for extensions. It is an alternative to GLEW and has the advantage that it works out of the box on MacOS with a core profile and also allows only to include the defines and function declarations of a specific OpenGL version. This way the usage of 'wrong' functions can get caught during compile time (e.g. when developing for 3.2 on a machine that supports GL 4+). GLEW can still be used if desired!
The loader code is based on a modified output of glLoadGen (1.0.3), a bunch of LUA scripts that create the loader code. It's not a ready to use external library so the resulting code gets embedded directly into ACGL.
parent 75baa2bf
This diff is collapsed.
......@@ -8,7 +8,7 @@
#define ACGL_OPENGL_GL_HH
/*
* This simple OpenGL wrapper is used to include OpenGL and GLEW
* This simple OpenGL wrapper is used to include OpenGL (and if needed GLEW)
* on different platforms.
*
* While these includes are located in a subdirectory of GL/ on most systems,
......@@ -16,26 +16,28 @@
*
*
* This wrapper can get configured with external defines:
* QT_OPENGL_LIB : include also the QT OpenGL headers and maybe use QT for other
* graphics related stuff, like image loading for textures.
* ACGL_OPENGL_SUPPORT_CORE_41 : (or other versions): basicly ACGL_OPENGL_PROFILE_* and ACGL_OPENGL_VERSION_*
* combined!
* ACGL_OPENGL_PROFILE_CORE : CORE: only support for CORE functions, demands a CORE OpenGL context
* FULL: support for CORE and deprecated functions
* ACGL_OPENGL_VERSION_41 : (or other versions): minimal OpenGL version that can be assumed to be present.
* The app can't run on older contexts and will probably terminate at startup.
* Set this to a low version and it will run on lost machines
* Set this to a high version and less run-time checks have to be performed to
* work around missing features (like querying extensions etc).
* ACGL_PLATFORM_DESKTOP : DESKTOP vs. MOBILE plattform = GL vs. GL ES
* ACGL_OPENGL_PROFILE_CORE : CORE: if possible include/load only core OpenGL functions
* FULL: support for CORE and deprecated functions
* (NOTE: the OpenGL context itself is not created by ACGL!)
* ACGL_OPENGL_VERSION_41 : (or other versions): minimal OpenGL version that can be assumed to be present.
* The app can't run on older contexts and will probably terminate at startup.
* Set this to a low version and it will run on lost machines
* Set this to a high version and less run-time checks have to be performed to
* work around missing features (like querying extensions etc).
* ACGL_OPENGL_INCLUDE_LATEST_GL : If this is set and GL function loading is done with the internal loader, all
* functions of the latest GL version are loaded (if available) and the header
* of the latest version gets included. ACGL however will only assume the version
* set by ACGL_OPENGL_VERSION_XY to be present.
* ACGL_PLATFORM_DESKTOP : DESKTOP vs. MOBILE plattform = GL vs. GL ES
*
* ACGL_USE_GLEW : if this is set, GLEW gets used to load the GL functions,
* otherwise an internal GL loader based on glLoadGen gets used on desktop systems.
*
* Note: If nothing is defined, core 3.2 gets defined but all functions are loaded.
* If *just* ACGL_OPENGL_INCLUDE_LATEST_GL is defined, the latest GL version gets defined *and* loaded
* (full/compatibility profile).
*/
// If there is a demand for a core context, we should include the new core headers as well,
// sadly, these are not very good supported yet, so this stays commented out for a while :-(
#ifdef ACGL_OPENGL_PROFILE_CORE
//# define ACGL_OPENGL_PROFILE_CORE_HEADER
#endif
// To compare the OpenGL version number we define a new ACGL_OPENGL_VERSION XY define here
// analog to ACGL_OPENGL_VERSION_XY
#if defined (ACGL_OPENGL_VERSION_21)
......@@ -57,26 +59,33 @@
#elif defined (ACGL_OPENGL_VERSION_43)
# define ACGL_OPENGL_VERSION 43
#else
// failback:
#warning "NO ACGL_OPENGL_VERSION_XY SET! Default to 3.2"
#define ACGL_OPENGL_VERSION_32
#define ACGL_OPENGL_VERSION 32
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL)
#define ACGL_OPENGL_VERSION_43
#define ACGL_OPENGL_VERSION 43
#define ACGL_OPENGL_PROFILE_FULL
#else
// fallback:
#warning "NO ACGL_OPENGL_VERSION_XY SET! Default to 3.2 core (but load all available functions)"
// *we* only assume OpenGL 3.2 core...
#define ACGL_OPENGL_VERSION_32
#define ACGL_OPENGL_VERSION 32
#define ACGL_OPENGL_PROFILE_CORE
// ... but include the latest header and try to load all function in case the app needs more:
// (only if the internal loader gets used, but GLEW will also try to load everything)
#define ACGL_OPENGL_INCLUDE_LATEST_GL
#endif // latest GL
#endif // version checks
// If we're compiling for an Apple system we need this to distinquish between Mac and iOS:
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <TargetConditionals.h>
#endif
// always include glew unless on iOS
#define ACGL_USE_GLEW
#if (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
# if (TARGET_OS_IPHONE == 1)
# define PLATFORM_IOS
# define ACGL_OPENGL_ES
# undef ACGL_USE_GLEW // no glew support on iOS
# endif
#else
// no iOS device...
......@@ -84,67 +93,96 @@
// ...but mobile:
// maybe maemo or android: first one to program for these plattforms should add
// the correct includes here!
# error "UNKNOWN mobile plattform! Dont know what to include!"
# define ACGL_OPENGL_ES
# endif
#endif
// we have allways to include glew first!
#ifdef ACGL_USE_GLEW
// if GLEW_STATIC is defined, GLEW gets linked statically. GLEW itself needs this define
// but for us its the sign that a local version of GLEW gets used, so we find it on
// GL/glew.h on every system.
#ifdef GLEW_STATIC
#include "GL/glew.h"
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Include the right headers with the OpenGL functions and defines:
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifdef ACGL_OPENGL_ES
#if (defined(__APPLE__) || defined(MACOSX))
//iOS:
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#else
#if defined(__APPLE__) || defined(MACOSX)
#include <OpenGL/glew.h>
#else
#include <GL/glew.h>
// Android et al.:
#error "UNKNOWN mobile plattform! Don't know what to include!"
#endif
#else // ACGL_OPENGL_ES
// desktop:
#if (defined(__APPLE__) || defined(MACOSX)) && defined(ACGL_OPENGL_PROFILE_FULL)
#if ACGL_OPENGL_VERSION > 21
#warning "On MacOS X only core profile is supported for OpenGL >= 3.2"
#undef ACGL_OPENGL_PROFILE_FULL
#define ACGL_OPENGL_PROFILE_CORE
#endif
#endif // !GLEW_LOCAL_PATH
#endif // ACGL_USE_GLEW
#if (defined(__APPLE__) || defined(MACOSX))
# ifdef ACGL_OPENGL_ES
// iOS:
# import <OpenGLES/ES1/gl.h>
# import <OpenGLES/ES1/glext.h>
# import <OpenGLES/ES2/gl.h>
# import <OpenGLES/ES2/glext.h>
# else
// Desktop MacOS X:
# if (!defined(ACGL_OPENGL_PROFILE_CORE) && (ACGL_OPENGL_VERSION > 21))
// e.g. FULL_32 on Mac won't work
# warning "Mac OS X only supports OpenGL >= 3.2 with Core profile only"
# define ACGL_OPENGL_PROFILE_CORE
# endif
# if defined(ACGL_OPENGL_PROFILE_CORE)
// On MacOS X, theres only OpenGL up till 2.1 (<=10.6) or 3.2 (min. 10.7)
// GLEW will define __gl_h_ and gl3.h will think we included gl.h and gl3.h,
// to prevent a warning, define this flag:
# define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
# include <OpenGL/gl3.h>
# undef GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
# else
// old MacOS X / OpenGL 2.1
# include <OpenGL/gl.h>
# endif
# endif
#else
// Windows/Linux
# ifdef ACGL_OPENGL_PROFILE_CORE_HEADER
# include <GL3/gl3.h>
# else
// in contrast to MacOS 10.7, the "old" header can be used for post 3.0 OpenGL!
# include <GL/gl.h>
# endif
#endif
#endif
#ifdef ACGL_USE_GLEW
// if GLEW_STATIC is defined, GLEW gets linked statically. GLEW itself needs this define
// but for us its the sign that a local version of GLEW gets used, so we find it on
// GL/glew.h on every system.
#ifdef GLEW_STATIC
#include "GL/glew.h"
#else
#if defined(__APPLE__) || defined(MACOSX)
#include <OpenGL/glew.h>
#else
#include <GL/glew.h>
#endif
#endif // !GLEW_LOCAL_PATH
#else
// use the internal loader:
#define ACGL_EXTENSION_LOADER_GLLOADGEN
//
// our own "extension":
//
#include <ACGL/OpenGL/EXT_direct_state_access.hh>
//
// Include the right header which has just what is needed to catch compatibility problems at compiletime.
// 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_OPENGL_VERSION_43)
#include <ACGL/OpenGL/glloaders/gl_core_43.hh>
#elif 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>
#elif defined (ACGL_OPENGL_VERSION_40)
#include <ACGL/OpenGL/glloaders/gl_core_40.hh>
#elif defined (ACGL_OPENGL_VERSION_41)
#include <ACGL/OpenGL/glloaders/gl_core_41.hh>
#elif defined (ACGL_OPENGL_VERSION_42)
#include <ACGL/OpenGL/glloaders/gl_core_42.hh>
#endif
#else
// compatibility profile:
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_OPENGL_VERSION_43)
#include <ACGL/OpenGL/glloaders/gl_compatibility_43.hh>
#elif defined (ACGL_OPENGL_VERSION_21)
#include <ACGL/OpenGL/glloaders/gl_21.hh>
#elif defined (ACGL_OPENGL_VERSION_30)
#include <ACGL/OpenGL/glloaders/gl_30.hh>
#elif defined (ACGL_OPENGL_VERSION_31)
#include <ACGL/OpenGL/glloaders/gl_31.hh>
#elif defined (ACGL_OPENGL_VERSION_32)
#include <ACGL/OpenGL/glloaders/gl_compatibility_32.hh>
#elif defined (ACGL_OPENGL_VERSION_33)
#include <ACGL/OpenGL/glloaders/gl_compatibility_33.hh>
#elif defined (ACGL_OPENGL_VERSION_40)
#include <ACGL/OpenGL/glloaders/gl_compatibility_40.hh>
#elif defined (ACGL_OPENGL_VERSION_41)
#include <ACGL/OpenGL/glloaders/gl_compatibility_41.hh>
#elif defined (ACGL_OPENGL_VERSION_42)
#include <ACGL/OpenGL/glloaders/gl_compatibility_42.hh>
#endif
#endif // ACGL_OPENGL_PROFILE_CORE
#endif // ACGL_USE_GLEW
#endif // ACGL_OPENGL_ES
#endif // ACGL_OPENGL_GL_HH
......@@ -107,7 +107,7 @@ public:
#if (ACGL_OPENGL_VERSION >= 33)
if (_queryType == GL_ANY_SAMPLES_PASSED) _queryType = GL_SAMPLES_PASSED; // GL_ANY_SAMPLES_PASSED is OpenGL 3.3 or later! But GL_SAMPLES_PASSED is a good substitute
#endif
if ((_queryType != GL_SAMPLES_PASSED) && (_queryType != GL_ANY_SAMPLES_PASSED)) {
if (_queryType != GL_SAMPLES_PASSED) {
Utils::error() << "OcclusionQuery type " << _queryType << " not supported" << std::endl;
_queryType = GL_SAMPLES_PASSED;
}
......
......@@ -32,9 +32,9 @@ inline GLint getGLTypeSize ( GLenum _type )
case GL_FLOAT: return sizeof(GLfloat);
case GL_DOUBLE: return sizeof(GLdouble);
case GL_INT64_NV: return sizeof(GLint64);
case GL_UNSIGNED_INT64_NV: return sizeof(GLuint64);
case GL_HALF_FLOAT: return sizeof(GLhalf);
//case GL_INT64_NV: return sizeof(GLint64);
//case GL_UNSIGNED_INT64_NV: return sizeof(GLuint64);
//case GL_HALF_FLOAT: return sizeof(GLhalf);
case GL_FIXED: return 4; // fixed are packed in a 32bit int (see 2.1.2 of the spec.)
}
return 0;
......@@ -42,10 +42,10 @@ inline GLint getGLTypeSize ( GLenum _type )
inline GLuint getNumberOfChannels( GLenum _format )
{
if (_format == GL_R || _format == GL_R8I || _format == GL_R16I || _format == GL_R32I
if (/*_format == GL_R || */_format == GL_R8I || _format == GL_R16I || _format == GL_R32I
|| _format == GL_R8UI || _format == GL_R16UI || _format == GL_R32UI
|| _format == GL_R16F || _format == GL_R32F ) return 1;
if (_format == GL_RED_INTEGER || _format == GL_GREEN_INTEGER || _format == GL_BLUE_INTEGER || _format == GL_ALPHA_INTEGER) return 1;
if (_format == GL_RED_INTEGER || _format == GL_GREEN_INTEGER || _format == GL_BLUE_INTEGER /*|| _format == GL_ALPHA_INTEGER*/) return 1;
if (_format == GL_RG || _format == GL_RG8I || _format == GL_RG16I || _format == GL_RG32I
|| _format == GL_RG8UI || _format == GL_RG16UI || _format == GL_RG32UI
......@@ -76,6 +76,19 @@ bool doesSupportTessellationShader();
bool doesSupportComputeShader();
// define the shader kinds for older GL versions so the file extension detection
// can work correctly
#ifndef GL_GEOMETRY_SHADER
#define GL_GEOMETRY_SHADER 0x8DD9
#endif
#ifndef GL_TESS_CONTROL_SHADER
#define GL_TESS_EVALUATION_SHADER 0x8E87
#define GL_TESS_CONTROL_SHADER 0x8E88
#endif
#ifndef GL_COMPUTE_SHADER
#define GL_COMPUTE_SHADER 0x91B9
#endif
struct ShaderEndings
{
const char *ending;
......
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
/**
* Basic checks if an extension is available.
* Depending on whether GLEW, the internal loader or anything else was
* used to get the OpenGL function pointers and extensions, the implementation
* will differ.
* Only the extensions are listed here that are needed inside of ACGL itself,
* it is not a complete list! It can also change and checks can get removed
* if they are not needed inside of ACGL.
* Applications should perform there own checks depending on the extension
* loader choosen for the app and not rely on these checks!
*
* Each check will return true if the extension is available.
**/
#ifndef ACGL_OPENGL_EXTENSIONS_HH
#define ACGL_OPENGL_EXTENSIONS_HH
#include <ACGL/OpenGL/GL.hh>
namespace ACGL{
namespace OpenGL{
// anisotrophic texture filtering
inline bool ACGL_EXT_texture_filter_anisotrophic() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_EXT_texture_filter_anisotropic != ogl_LOAD_FAILED);
#elif ACGL_USE_GLEW
return GLEW_EXT_texture_filter_anisotropic;
#else
// if needed define the constants so the code will compile, it
// will never be run anyway as this check will return false!
#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#endif
#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
#endif
return false;
#endif
}
// EXT_geometry_shader4 & ARB_geometry_shader4 are identical and may not be available if the context is 3.2+ anyway!
inline bool ACGL_EXT_geometry_shader4() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_EXT_geometry_shader4 != ogl_LOAD_FAILED);
#elif ACGL_USE_GLEW
return GLEW_EXT_geometry_shader4;
#else
return false;
#endif
}
// EXT_geometry_shader4 & ARB_geometry_shader4 are identical and may not be available if the context is 3.2+ anyway!
inline bool ACGL_ARB_geometry_shader4() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_ARB_geometry_shader4 != ogl_LOAD_FAILED);
#elif ACGL_USE_GLEW
return GLEW_ARB_geometry_shader4;
#else
return false;
#endif
}
inline bool ACGL_ARB_tessellation_shader() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_ARB_tessellation_shader != ogl_LOAD_FAILED);
#elif ACGL_USE_GLEW
return GLEW_ARB_tessellation_shader;
#else
return false;
#endif
}
inline bool ACGL_ARB_compute_shader() {
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
return (ogl_ext_ARB_compute_shader != ogl_LOAD_FAILED);
#elif ACGL_USE_GLEW
return GLEW_ARB_compute_shader;
#else
return false;
#endif
}
} // OpenGL
} // ACGL
#endif // ACGL_OPENGL_EXTENSIONS_HH
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.
This diff is collapsed.
......@@ -25,15 +25,21 @@ bool init(void)
# ifdef ACGL_OPENGL_PROFILE_CORE
glewExperimental = GL_TRUE;
# endif
GLenum errorCode = glewInit();
if ((errorCode != GLEW_OK) || (openGLCriticalErrorOccured())) {
Utils::error() << "could not init GLEW!" << std::endl;
#ifdef ACGL_OPENGL_PROFILE_CORE
Utils::error() << "Make sure your version of GLEW is compatible with core contexts (see glew branch coreprofile)" << std::endl;
Utils::error() << "Make sure your version of GLEW is compatible with core contexts" << std::endl;
#endif
return false;
}
#else
int loaded = ogl_LoadFunctions();
if (loaded == ogl_LOAD_FAILED)
{
Utils::error() << "could not load OpenGL functions!" << std::endl;
return false;
}
#endif // GLEW
//
......@@ -47,12 +53,6 @@ bool init(void)
return false;
}
//
// Init DirectStateAccess functions:
// (using the extension versions or our own (slower) emulation)
//
OpenGL::initDirectStateAccessFunctions();
//
// Register file types for loading. This has to be done if the library is
// linked statically, because otherwise, the static registration of the
......
This diff is collapsed.
......@@ -5,6 +5,7 @@
**********************************************************************/
#include <ACGL/OpenGL/Objects/Sampler.hh>
#include <ACGL/OpenGL/glloaders/extensions.hh> // for anisotrophic filtering
#if (ACGL_OPENGL_VERSION >= 33)
......@@ -28,8 +29,7 @@ Sampler::~Sampler(void)
void Sampler::setMaxAnisotropy( GLfloat _sampleCount )
{
#ifdef ACGL_USE_GLEW
if (GLEW_EXT_texture_filter_anisotropic) {
if ( ACGL_EXT_texture_filter_anisotrophic() ) {
// anisotrophic filtering is supported:
GLfloat maxAnisotropicSamples;
glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropicSamples );
......@@ -38,7 +38,6 @@ void Sampler::setMaxAnisotropy( GLfloat _sampleCount )
glSamplerParameterf( mObjectName, GL_TEXTURE_MAX_ANISOTROPY_EXT, _sampleCount );
openGLRareError();
} else
#endif
{
if (_sampleCount != 1.0f ) {
// anisotropic filtering will just increase the image quality, so this is just
......
......@@ -232,7 +232,7 @@ std::string ShaderParser::getFileNamesPrintable()
{
std::string rString;
for (size_t i = 0; i < mSourceFileNames.size(); ++i) {
rString += " " + StringOperations::toString(i+1) + " " + mSourceFileNames[i] + "\n";
rString += " " + StringOperations::toString<unsigned int>(i+1) + " " + mSourceFileNames[i] + "\n";
}
return rString;
}
......
......@@ -5,6 +5,7 @@
**********************************************************************/
#include <ACGL/OpenGL/Objects/Texture.hh>
#include <ACGL/OpenGL/glloaders/extensions.hh> // for anisotrophic filtering
using namespace ACGL::OpenGL;
......@@ -54,8 +55,7 @@ void Texture::setWrap( GLenum _wrapS, GLenum _wrapT, GLenum _wrapR )
void Texture::setAnisotropicFilter( GLfloat _sampleCount )
{
#ifdef ACGL_USE_GLEW
if (GLEW_EXT_texture_filter_anisotropic) {
if ( ACGL_EXT_texture_filter_anisotrophic() ) {
// anisotrophic filtering is supported:
GLfloat maxAnisotropicSamples;
glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropicSamples );
......@@ -65,7 +65,6 @@ void Texture::setAnisotropicFilter( GLfloat _sampleCount )
glTexParameterf( mTarget, GL_TEXTURE_MAX_ANISOTROPY_EXT, _sampleCount );
openGLRareError();
} else
#endif
{
if (_sampleCount != 1.0f ) {
// anisotropic filtering will just increase the image quality, so this is just
......
......@@ -7,6 +7,7 @@
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Tools.hh>
#include <ACGL/Base/FileHelpers.hh>
#include <ACGL/OpenGL/glloaders/extensions.hh>
namespace ACGL{
namespace OpenGL{
......@@ -84,11 +85,7 @@ bool doesSupportGeometryShader()
#ifdef ACGL_OPENGL_ES
return false;
#else
# if defined(ACGL_USE_GLEW)
return (GLEW_EXT_geometry_shader4 || GLEW_ARB_geometry_shader4 || (getOpenGLVersionNumber() >= 32));
# else
return (getOpenGLVersionNumber() >= 32);
# endif
return (ACGL_EXT_geometry_shader4() || ACGL_ARB_geometry_shader4() || (getOpenGLVersionNumber() >= 32));
#endif
}
......@@ -97,11 +94,7 @@ bool doesSupportTessellationShader()
#ifdef ACGL_OPENGL_ES
return false;
#else
# if defined(ACGL_USE_GLEW)
return ( GLEW_ARB_tessellation_shader || (getOpenGLVersionNumber() >= 40));
# else
return (getOpenGLVersionNumber() >= 40);
# endif
return ( ACGL_ARB_tessellation_shader() || (getOpenGLVersionNumber() >= 40));
#endif
}
......@@ -110,11 +103,7 @@ bool doesSupportComputeShader()
#ifdef ACGL_OPENGL_ES
return false;
#else
# if defined(ACGL_USE_GLEW)
return ( GLEW_ARB_compute_shader || (getOpenGLVersionNumber() >= 43));
# else
return (getOpenGLVersionNumber() >= 43);
# endif
return ( ACGL_ARB_compute_shader() || (getOpenGLVersionNumber() >= 43));
#endif
}
......
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.
This diff is collapsed.
/***********************************************************************
* Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
* All rights reserved. *
* Distributed under the terms of the MIT License (see LICENSE.TXT). *
**********************************************************************/
#include <ACGL/OpenGL/GL.hh>
// don't do anything if an other extension loader (e.g. GLEW) should get used:
#ifdef ACGL_EXTENSION_LOADER_GLLOADGEN
#if (__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wwrite-strings"
#endif
#ifdef ACGL_OPENGL_PROFILE_CORE
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_OPENGL_VERSION_43)
#include "gl_core_43.inc"
#elif defined (ACGL_OPENGL_VERSION_32)
#include "gl_core_32.inc"
#elif defined (ACGL_OPENGL_VERSION_33)
#include "gl_core_33.inc"
#elif defined (ACGL_OPENGL_VERSION_40)
#include "gl_core_40.inc"
#elif defined (ACGL_OPENGL_VERSION_41)
#include "gl_core_41.inc"
#elif defined (ACGL_OPENGL_VERSION_42)
#include "gl_core_42.inc"
#else
#error "unsupported core GL version requested"
#endif
#else
// compatibility profile:
#if defined (ACGL_OPENGL_INCLUDE_LATEST_GL) || defined (ACGL_OPENGL_VERSION_43)
#include "gl_compatibility_43.inc"
#elif defined (ACGL_OPENGL_VERSION_21)
#include "gl_compatibility_21.inc"
#elif defined (ACGL_OPENGL_VERSION_30)
#include "gl_compatibility_30.inc"
#elif defined (ACGL_OPENGL_VERSION_31)
#include "gl_compatibility_31.inc"
#elif defined (ACGL_OPENGL_VERSION_32)
#include "gl_compatibility_32.inc"
#elif defined (ACGL_OPENGL_VERSION_33)