I'm trying to make a opengl program to display a point on the screen but i'm getting this error while compiling.
cannot convert ‘GLuint {aka unsigned int}’ to ‘GLuint() {aka unsigned int()}’ in assignment
GLuint renderingProgram(); //global variable *Edit, this variable doesn't have any "="
void init(GLFWwindow* window)
{
renderingProgram = createShaderProgram();
glGenVertexArrays(numVAOs, vao);
glBindVertexArray(vao[0]);
}
This is the only error I'm getting and I don't really know how I could fix this as I'm new to OpenGL :)
Edit
GLuint createShaderProgram()
{
const char *vshaderSource =
"#version 330 \n"
"void main(void) \n"
"{ gl_Position = vec4(0.0,0.0,0.0,1.0); }";
const char *fshaderSource =
"#version 330 \n"
"out vec4 color; \n"
"void main(void) \n"
"{ color = vec4(0.0,0.0,1.0,1.0); }";
GLuint vShader = glCreateShader(GL_VERTEX_SHADER);
GLuint fShader = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(vShader, 1, &vshaderSource, NULL);
glShaderSource(fShader, 1, &fshaderSource, NULL);
glCompileShader(vShader);
glCompileShader(fShader);
GLuint vfProgram = glCreateProgram();
glAttachShader(vfProgram, vShader);
glAttachShader(vfProgram, fShader);
glLinkProgram(vfProgram);
return vfProgram;
}