Maybe I was a bit unclear.
And yes I was confused about static and dynamic libraries.
I know how OpenGL normally works on Windows(32).
The real thing I should like to do is:
I’ve a main program, which the user starts up.
If the user has only OpenGL 1.1 capabilities I want to “import” my own dynamic libraries for this version.
So if the user should have OpenGL 2.1 (supported on the video-card) I want to import my own created dynamic libraries for this version, which makes use many more capabilities.
So for (a simple) example:
OpenGL 1.1: Every time on draw:
glBegin(GL_QUAD);
glVector2d(-1, 1);
glVector2d( 1, 1);
glVector2d( 1, -1);
glVector2d(-1, -1);
OpenGL 2.1: global-variables:
#define VERTICES 0
#define INDICES 1
#define NUM_BUFFERS 2
GLuint buffers[NUM_BUFFERS];
OpenGL 2.1: init:
GLdouble vertices[][2] = {{-1, 1},
{ 1, 1},
{ 1, -1},
{-1, -1}};
GLubyte indices[][4] = {0, 1, 2, 3};
glGenBuffers(NUM_BUFFERS, buffers);
glBindBuffer(GL_ARRAY_BUFFER, buffers[VERTICES]);
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
glVertexPointer(2, GL_DOUBLE, 0, ((GLubyte*) NULL + 0));
glEnableClientState(GL_VERTEX_ARRAY);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buffers[INDICES]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW);
OpenGL 2.1: Every time on draw:
glDrawElements(GL_QUADS, 1, GL_UNSIGNED_BYTE, ((GLubyte*) NULL + 0));
So you see, for every version I could make an other library which works. How newer the OpenGL version of the user is, how better the program could make use of the newest functions. But it has also to support lower versions.
So it should be nice to first know which library for running it has to take, and than run with it, to make full use of all capabilities.