Here is my include and the code that is causing me distress:
#include <iostream>
#include <vector>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
using namespace std;
GLuint CreateShader(GLenum eShaderType, const std::string &strShaderFile)
{
GLuint shader = glCreateShader(eShaderType);
const char *strFileData = strShaderFile.c_str();
glShaderSource(shader, 1, &strFileData, NULL);
glCompileShader(shader);
GLint status;
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE)
{
GLint infoLogLength;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLogLength);
GLchar *strInfoLog = new GLchar[infoLogLength + 1];
glGetShaderInfoLog(shader, infoLogLength, NULL, strInfoLog);
const char *strShaderType = NULL;
switch(eShaderType)
{
case GL_VERTEX_SHADER: strShaderType = "vertex"; break;
case GL_GEOMETRY_SHADER: strShaderType = "geometry"; break;
case GL_FRAGMENT_SHADER: strShaderType = "fragment"; break;
}
fprintf(stderr, "Compile failure in %s shader:\n%s\n", strShaderType, strInfoLog);
delete[] strInfoLog;
}
return shader;
}
That was the only way I could think of pointing out that crucial bit of code. (I am new to SO)
I am learning from a tutorial so besides the altered includes and the namespace, this is not my code.
Anyway, I am using Xcode to learn about using OpenGL in C++ and it is telling me that I am using an undeclared identifier GL_GEOMETRY_SHADER ... I have coded using OpenGL in java before so to me this seems really strange as GL_GEOMETRY_SHADER should be identified along with its vertex and fragment counterpart, which do not cause any problems. Any help would be appreciated.
(As an aside that I don't think warrants an entire question of its own since I simply opted to not use the function, glutExitMainLoop(); is not defined either)
Thank you