[QUOTE=macsam;1292824]I have found a version 3.2 sample and would like to use that. ( Tutorial2: VAOs, VBOs, Vertex and Fragment Shaders (C / SDL) - OpenGL Wiki ).
I am stuck on the first hurdle - I cannot find GL3/gl3.h and possible the opengl library that goes with it.[/QUOTE]
This thread describes gl3.h. It’s not a standard header, but rather a paired down version of “gl.h” that tries to remove the declarations for much of the old pre-OpenGL 3.0 functionality.
As the thread mentions, you can just ignore this header and use GLEW to declare and load your OpenGL functions and other declarations. For more on that, see OpenGL Loading Library in the OpenGL wiki.
Here’s a short, stand-alone GLEW + GLUT test program to help you get started:
//------------------------------------------------------------------------------
// Stand-alone GLUT Test Program Shell
//------------------------------------------------------------------------------
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
//-----------------------------------------------------------------------
void checkGLError( const char hdr[] )
{
bool found = false;
GLint err;
while ( (err = glGetError()) != GL_NO_ERROR )
{
fprintf(stderr, "GL ERROR %s (at %s)
", gluErrorString(err), hdr);
found = true;
}
if ( found )
{
exit(1);
}
}
//-----------------------------------------------------------------------
void init()
{
//------------------------------------------------------------
// Put your GL resource creation here
// (buffer objects, textures, etc.)
//------------------------------------------------------------
checkGLError( "init()" );
}
//-----------------------------------------------------------------------
void reshape( int width, int height )
{
glViewport(0, 0, width, height);
}
//-----------------------------------------------------------------------
void display()
{
// Clear screen
glClearColor( 0.1f, 0.1f, 0.43f, 1.0f );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
// Load up PROJECTION and MODELVIEW
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-2,2,-2,2,-2,2);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//------------------------------------------------------------
// Put your GL draw calls here.
//------------------------------------------------------------
// Swap
glutSwapBuffers();
// Cause display() to be called again.
glutPostRedisplay();
checkGLError( "display()" );
}
//-----------------------------------------------------------------------
void keyboard( unsigned char key, int x, int y )
{
switch (key)
{
case 27: // ESC quits
exit(0);
break;
}
}
int main( int argc, char** argv )
{
// Init GLUT
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE );
glutCreateWindow( argv[0] );
glutKeyboardFunc( keyboard );
glutDisplayFunc( display );
glutReshapeFunc( reshape );
glutReshapeWindow( 400,400 );
// Init GLEW
GLenum err = glewInit();
if ( err != GLEW_OK )
{
// Problem: glewInit failed, something is seriously wrong.
fprintf( stderr, "Error: %s
", glewGetErrorString(err) );
exit(1);
}
printf( "GL_RENDERER = %s
", glGetString( GL_RENDERER) );
init();
glutMainLoop();
return 0;
}