Commit 46ff8783 authored by Robert Menzel's avatar Robert Menzel
Browse files

core profile compatibility and gcc warning pragmas only for newer gcc versions

parent a33e18c6
......@@ -21,13 +21,18 @@
* and the log does not get flooded with GLM warnings that we can't fix anyway with the
* risk of not seeing ACGL warnings.
*/
#pragma GCC diagnostic push
#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4))
# pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wtype-limits"
#define GLM_SWIZZL
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#pragma GCC diagnostic pop
#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4))
# pragma GCC diagnostic pop
#endif
#include <ACGL/Math/Constants.hh>
#include <ACGL/Math/Functions.hh>
......
......@@ -4,9 +4,9 @@
////////////////////////////////////////////////////////////////////////////////
#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/GL.hh>
#include <ACGL/OpenGL/Tools.hh>
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>
namespace ACGL
{
......@@ -26,11 +26,8 @@ bool init(void)
Utils::error() << "could not init GLEW!" << std::endl;
}
// create a vertex array object
// needed on core profile
GLuint vao;
glGenVertexArrays(1,&vao);
glBindVertexArray(vao);
OpenGL::VertexArrayObject *vao = new OpenGL::VertexArrayObject();
vao->bind();
# else
GLenum errorCode = glewInit();
if ((errorCode != GLEW_OK) || (openGLCriticalErrorOccured())) {
......
......@@ -2,7 +2,10 @@
#include <ACGL/OpenGL/Tools.hh>
// not all functions are implemented right now, so ignore warnings about unused parameters
#pragma GCC diagnostic push
#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4))
# pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-variable"
......@@ -334,6 +337,10 @@ void mapDSAFromEMULATION()
glTextureSubImage2DEXT = glTextureSubImage2DEMULATION;
glTextureSubImage3DEXT = glTextureSubImage3DEMULATION;
glUnmapNamedBufferEXT = glUnmapNamedBufferEMULATION;
glVertexArrayVertexAttribIOffsetEXT = glVertexArrayVertexAttribIOffsetEMULATION;
glVertexArrayVertexAttribOffsetEXT = glVertexArrayVertexAttribOffsetEMULATION;
#ifndef ACGL_OPENGL_PROFILE_CORE
glVertexArrayColorOffsetEXT = glVertexArrayColorOffsetEMULATION;
glVertexArrayEdgeFlagOffsetEXT = glVertexArrayEdgeFlagOffsetEMULATION;
glVertexArrayFogCoordOffsetEXT = glVertexArrayFogCoordOffsetEMULATION;
......@@ -342,11 +349,7 @@ void mapDSAFromEMULATION()
glVertexArrayNormalOffsetEXT = glVertexArrayNormalOffsetEMULATION;
glVertexArraySecondaryColorOffsetEXT = glVertexArraySecondaryColorOffsetEMULATION;
glVertexArrayTexCoordOffsetEXT = glVertexArrayTexCoordOffsetEMULATION;
glVertexArrayVertexAttribIOffsetEXT = glVertexArrayVertexAttribIOffsetEMULATION;
glVertexArrayVertexAttribOffsetEXT = glVertexArrayVertexAttribOffsetEMULATION;
glVertexArrayVertexOffsetEXT = glVertexArrayVertexOffsetEMULATION;
#ifndef ACGL_OPENGL_PROFILE_CORE
glDisableClientStateIndexedEXT = glDisableClientStateIndexedEMULATION;
glDisableClientStateiEXT = glDisableClientStateiEMULATION;
glEnableClientStateIndexedEXT = glEnableClientStateIndexedEMULATION;
......@@ -1645,5 +1648,7 @@ void glDisableClientStateiEMULATION (GLenum array, GLuint index) {
} // ACGL
#pragma GCC diagnostic pop
#if (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6)) || (__GNUC__ > 4))
# pragma GCC diagnostic pop
#endif
Supports Markdown
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