Thanks
There is another class and i am declaring a variable of type GLuint and the compiler is not complaining at all.
Any explanation that this particular class needs this inclusion. Details of the class definition are provided in the following:
#ifndef TESSELLATIONSCENE_H
#define TESSELLATIONSCENE_H
#include <GL/gl.h>
#include "defines.h"
#include "AbstractScene.h"
class QOpenGLFunctions_4_3_Core;
class GLSLShader;
class TeapotVboPatch;
class TessellationScene : public AbstractScene
{
Q_OBJECT
public:
TessellationScene
(QObject *parent
= 0);
~TessellationScene();
//scene related functions
virtual void initialise();
virtual void update(float t);
virtual void render();
virtual void resize(int w, int h);
private:
void loadShaders();
QOpenGLFunctions_4_3_Core *mFuncs;
GLSLShader *mTessellationShader;
TeapotVboPatch *mTeapotPatch;
//hold the maximum number of vertices
//inside a patch
GLint mMaxPatchVertices;
};
#endif // TESSELLATIONSCENE_H
#ifndef TESSELLATIONSCENE_H
#define TESSELLATIONSCENE_H
#include <GL/gl.h>
#include "defines.h"
#include "AbstractScene.h"
class QOpenGLFunctions_4_3_Core;
class GLSLShader;
class TeapotVboPatch;
class TessellationScene : public AbstractScene
{
Q_OBJECT
public:
TessellationScene(QObject *parent = 0);
~TessellationScene();
//scene related functions
virtual void initialise();
virtual void update(float t);
virtual void render();
virtual void resize(int w, int h);
private:
void loadShaders();
QOpenGLFunctions_4_3_Core *mFuncs;
GLSLShader *mTessellationShader;
TeapotVboPatch *mTeapotPatch;
//hold the maximum number of vertices
//inside a patch
GLint mMaxPatchVertices;
};
#endif // TESSELLATIONSCENE_H
To copy to clipboard, switch view to plain text mode
As you can see above that the class definition contains the inclusion of GL/gl.h after your suggestion and now please check the following class structure:
#ifndef TEAPOTVBOPATCH_H
#define TEAPOTVBOPATCH_H
#include "defines.h"
#include "teapotdata.h"
class QOpenGLFunctions_4_3_Core;
class GLSLShader;
class TeapotVboPatch
{
private:
GLuint mTeapotVAOID;
GLuint mTeapotBufferID;
QOpenGLFunctions_4_3_Core *mTeapotRenderFunc;
void generatePatches(float *v);
void buildPatchReflect(int patchNum,
float *v,
int &index,
bool reflectX,
bool reflectY);
void buildPatch(glm::vec3 patch[][4],
float *v,
int &index,
glm::mat3 reflect);
void getPatch(int patchNum,glm::vec3 patch[][4],bool reverseV);
public:
TeapotVboPatch(GLSLShader *);
~TeapotVboPatch();
void render(GLSLShader *shader);
};
#endif // TEAPOTVBOPATCH_H
#ifndef TEAPOTVBOPATCH_H
#define TEAPOTVBOPATCH_H
#include "defines.h"
#include "teapotdata.h"
class QOpenGLFunctions_4_3_Core;
class GLSLShader;
class TeapotVboPatch
{
private:
GLuint mTeapotVAOID;
GLuint mTeapotBufferID;
QOpenGLFunctions_4_3_Core *mTeapotRenderFunc;
void generatePatches(float *v);
void buildPatchReflect(int patchNum,
float *v,
int &index,
bool reflectX,
bool reflectY);
void buildPatch(glm::vec3 patch[][4],
float *v,
int &index,
glm::mat3 reflect);
void getPatch(int patchNum,glm::vec3 patch[][4],bool reverseV);
public:
TeapotVboPatch(GLSLShader *);
~TeapotVboPatch();
void render(GLSLShader *shader);
};
#endif // TEAPOTVBOPATCH_H
To copy to clipboard, switch view to plain text mode
The compiler did not complain at all for the TeapotVboPatch class even though i have declaration of GLuint type without the inclusion of GL/gl.h.
Why is that so ?
Thanks
Bookmarks