GL_INVALID_VALUE using a simple shader

Hi All,

I cannot understand why this code always generates an GL_INVALID_VALUE error.

Is it because the shader cannot be used on a ‘FBO render to texture’?

glClearColor(0, 0, 0, 0);				                    
glClear(GL_COLOR_BUFFER_BIT);	                        	

glMatrixMode(GL_PROJECTION);								
glLoadIdentity();											

glOrtho(-bestSize / 2, +bestSize / 2,
                     -bestSize / 2, +bestSize / 2,
                        -1e6, +1e6);

glMatrixMode(GL_MODELVIEW);								 
glLoadIdentity();
glu.LookAt(center.x, center.y, 1,
           center.x, center.y, 0,
           0, 1, 0);

glViewport(0, 0, shadowTextureSize, shadowTextureSize);

glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glDisable(GL_BLEND);
glDisable(GL_LIGHTING);

glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
           


glUseProgram(myProgram);

glBegin(GL_TRIANGLES);
glVertex2i(0, 0);
glVertex2i(100, 0);
glVertex2i(100, 100);
glEnd();

glUseProgram(0);

Shaders code:

void main()
{

  gl_Position = ftransform();
	
}

void main()
{

   gl_FragColor = vec4(0.9,0.4,0.8,1.0);

}

Which function generated the error?

Solved, thanks. It was my fault.

I have a new question now, I will start a new thread.

Thanks again,

Alberto

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.