Graphics Reference
In-Depth Information
if( gle != GL_NO_ERROR )
{
fprintf(stderr,“GL Error discovered from caller %s:”,
caller);
switch (gle)
{
case GL_INVALID_ENUM:
fprintf( stderr, “Invalid enum.\n” );
break;
case GL_INVALID_VALUE:
fprintf( stderr, “Invalid value.\n” );
break;
case GL_INVALID_OPERATION:
fprintf(stderr,“Invalid Operation.\n”);
break;
case GL_STACK_OVERFLOW:
fprintf( stderr, “Stack overflow.\n” );
break;
case GL_STACK_UNDERFLOW:
fprintf(stderr, “Stack underflow.\n” );
break;
case GL_OUT_OF_MEMORY:
fprintf( stderr, “Out of memory.\n” );
break;
case GL_INVALID_FRAMEBUFFER_OPERATION;
fprintf( stderr, “Framebuffer object is not
complete.\n” );
break;
}
return;
}
return;
}
Creating, Attaching, Linking,
and Activating Shader Programs
Once you have created the shader object(s) you want to use, you must create
an overall shader program and atach the individual shaders to it. The shader
program is the vehicle for making shader objects available to the OpenGL sys-
tem, and activating a shader program tells the graphics card to use it to replace
the appropriate parts of the fixed-function graphics operations.
Search WWH ::




Custom Search