diff --git a/include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh b/include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh index aa5f1abd6d4ccdfc1767f9a671854e20572c3b6c..eb687e755d9bde11530d8eb673cac3d7f1b93618 100644 --- a/include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh +++ b/include/ACGL/OpenGL/Controller/ShaderProgramControlFiles.hh @@ -82,7 +82,7 @@ public: inline ShaderProgramControlFiles& andFile (const std::string &_fileName) { addFile( _fileName ); mShaderType.push_back( GL_INVALID_VALUE ); return *this; } //! adds a single file, the shader type is explicitly given and must be one of: - //! GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER + //! GL_VERTEX_SHADER, GL_TESS_CONTROL_SHADER, GL_TESS_EVALUATION_SHADER, GL_GEOMETRY_SHADER, GL_FRAGMENT_SHADER, GL_COMPUTE_SHADER inline ShaderProgramControlFiles& andFile (const std::string &_fileName, GLenum _type) { addFile( _fileName ); mShaderType.push_back( _type ); return *this; } //! adds all files begining with the given name, the shader type will be guessed by the ending: diff --git a/include/ACGL/OpenGL/GL.hh b/include/ACGL/OpenGL/GL.hh index 502da712f4505c6a5415a5773ff82d026a5cdd47..0ee7d82897bf905ab0aa7ed09719c245245ff480 100644 --- a/include/ACGL/OpenGL/GL.hh +++ b/include/ACGL/OpenGL/GL.hh @@ -54,6 +54,8 @@ # define ACGL_OPENGL_VERSION 41 #elif defined (ACGL_OPENGL_VERSION_42) # define ACGL_OPENGL_VERSION 42 +#elif defined (ACGL_OPENGL_VERSION_43) +# define ACGL_OPENGL_VERSION 43 #else // failback: #warning "NO ACGL_OPENGL_VERSION_XY SET! Default to 3.2" diff --git a/src/ACGL/OpenGL/Controller/GeometryDataControlFileATB.cc b/src/ACGL/OpenGL/Controller/GeometryDataControlFileATB.cc index 082d253d5a979f0d41dcba075b5333a615d28a31..da3eb82eda9d3c8a35b9d0ab13ebc20a7e010bc5 100644 --- a/src/ACGL/OpenGL/Controller/GeometryDataControlFileATB.cc +++ b/src/ACGL/OpenGL/Controller/GeometryDataControlFileATB.cc @@ -157,7 +157,7 @@ bool GeometryDataControlFileATB::load(SharedGeometryData& _geometry) const std::memcpy(data, &dataVector[0], dataVector.size() * sizeof(GLfloat)); // Name the attribute according to the filename - ArrayBuffer::Attribute attr = { mAttributeName, GL_FLOAT, attributeDimension, 0, GL_FALSE, 0 }; + ArrayBuffer::Attribute attr = { mAttributeName, GL_FLOAT, attributeDimension, 0, GL_FALSE, 0, GL_FALSE }; _geometry->mAttributes.push_back(attr); // Tell the _geometry object where it finds the data diff --git a/src/ACGL/OpenGL/Controller/GeometryDataControlFileOBJ.cc b/src/ACGL/OpenGL/Controller/GeometryDataControlFileOBJ.cc index 6538f678bfd411220f9e41207911b73c68182d75..6d1ca111d01151de2f5edf533325f365537994c9 100644 --- a/src/ACGL/OpenGL/Controller/GeometryDataControlFileOBJ.cc +++ b/src/ACGL/OpenGL/Controller/GeometryDataControlFileOBJ.cc @@ -280,18 +280,18 @@ bool GeometryDataControlFileOBJ::load(SharedGeometryData& geometry) const geometry->setData( (GLubyte*)data ); geometry->setStrideSize( components * sizeof(float) ); - ArrayBuffer::Attribute apos = { "aPosition", GL_FLOAT, 4, 0, GL_FALSE, 0 }; + ArrayBuffer::Attribute apos = { "aPosition", GL_FLOAT, 4, 0, GL_FALSE, 0, GL_FALSE }; geometry->mAttributes.push_back( apos ); if (hasNormals) { - ArrayBuffer::Attribute anorm = { "aNormal", GL_FLOAT, 3, 4*sizeof(float), GL_FALSE, 0 }; + ArrayBuffer::Attribute anorm = { "aNormal", GL_FLOAT, 3, 4*sizeof(float), GL_FALSE, 0, GL_FALSE }; geometry->mAttributes.push_back( anorm ); } if (texCoordDimension > 0) { int offset = (hasNormals?7:4); offset *= sizeof(float); - ArrayBuffer::Attribute atex = { "aTexCoord", GL_FLOAT, texCoordDimension, offset, GL_FALSE, 0 }; + ArrayBuffer::Attribute atex = { "aTexCoord", GL_FLOAT, texCoordDimension, offset, GL_FALSE, 0, GL_FALSE }; geometry->mAttributes.push_back( atex ); } diff --git a/src/ACGL/OpenGL/Controller/ShaderControlFile.cc b/src/ACGL/OpenGL/Controller/ShaderControlFile.cc index 751215f192837268d15a32093663b866d5003f08..625fcf3fc8469550356cef2295727ac6799974e1 100644 --- a/src/ACGL/OpenGL/Controller/ShaderControlFile.cc +++ b/src/ACGL/OpenGL/Controller/ShaderControlFile.cc @@ -23,14 +23,22 @@ SharedShader ShaderControlFile::create(void) if(extension == "vsh") mType = GL_VERTEX_SHADER; + else if(extension == "fsh") + mType = GL_FRAGMENT_SHADER; +#if (ACGL_OPENGL_VERSION >= 43) + else if(extension == "csh") + mType = GL_COMPUTE_SHADER; +#endif +#if (ACGL_OPENGL_VERSION >= 40) else if(extension == "tcsh") mType = GL_TESS_CONTROL_SHADER; else if(extension == "tesh") mType = GL_TESS_EVALUATION_SHADER; +#endif +#if (ACGL_OPENGL_VERSION >= 32) else if(extension == "gsh") mType = GL_GEOMETRY_SHADER; - else if(extension == "fsh") - mType = GL_FRAGMENT_SHADER; +#endif else return SharedShader(); } diff --git a/src/ACGL/OpenGL/Controller/ShaderProgramControlFiles.cc b/src/ACGL/OpenGL/Controller/ShaderProgramControlFiles.cc index 107656f8e1efe1de0d397c183e6668b77edda315..4a8d9992d5d4b3443f0d198e0171b5d906ba35b3 100644 --- a/src/ACGL/OpenGL/Controller/ShaderProgramControlFiles.cc +++ b/src/ACGL/OpenGL/Controller/ShaderProgramControlFiles.cc @@ -29,6 +29,9 @@ const ShaderProgramControlFiles::ShaderEndings ShaderProgramControlFiles::sShade {"tesh", GL_TESS_EVALUATION_SHADER}, {"gsh", GL_GEOMETRY_SHADER}, {"geo", GL_GEOMETRY_SHADER}, +#if (ACGL_OPENGL_VERSION >= 43) + {"csh", GL_COMPUTE_SHADER}, +#endif #endif {"vsh", GL_VERTEX_SHADER}, {"vert", GL_VERTEX_SHADER}, diff --git a/src/ACGL/OpenGL/Objects/FrameBufferObject.cc b/src/ACGL/OpenGL/Objects/FrameBufferObject.cc index 8a1116d384e4f3ab23035b9b39629f984bce743a..111d0c5d33d9ddf801010033ebc5a145e63edc12 100644 --- a/src/ACGL/OpenGL/Objects/FrameBufferObject.cc +++ b/src/ACGL/OpenGL/Objects/FrameBufferObject.cc @@ -93,7 +93,7 @@ bool FrameBufferObject::attachColorAttachment( const Attachment &_attachment ) if (mColorAttachments[i].name == _attachment.name) { // replace this attachment GLuint newLocation = _attachment.location; - if (newLocation > maxColorBuffers) { + if (newLocation > (GLuint) maxColorBuffers) { // we have to find a place, but luckily we can use the old location of the same-named attachment: newLocation = mColorAttachments[i].location; } @@ -105,7 +105,7 @@ bool FrameBufferObject::attachColorAttachment( const Attachment &_attachment ) if (realLocation == -1) { // it's a new attachment GLuint newLocation = _attachment.location; - if (newLocation > maxColorBuffers) { + if (newLocation > (GLuint) maxColorBuffers) { // we have to find a place: newLocation = mColorAttachments.size(); }