64-bit OpenGL

Started by
15 comments, last by V-man 14 years, 6 months ago
You load function with wglGetProcAddress, yes, or third party libraries. I recommend going with the latter if you are confused about this process so you can just get it work and forget about it.

If you want to use OpenGL 2.1, then forget about 1.1 and extensions. Load the functions for 2.1 and use them as if everything is just working. That means, include whatever header is needed (glee.h for GLEE for example), call the initialization function if needed, and just use whatever 2.1-functions you want.
Advertisement
Quote:Original post by Tom Backton
How exactly do I do that? And what about Linux?

No conceptual difference to Windows. Loading function pointers directly is done via glXGetProcAddress(), but using something like GLEW is much recommended, as it saves you from writing a ton of boiler-plate code.
Widelands - laid back, free software strategy
Now I see how it works...I'm still surprised none of the tutorials I read mentioned function pointer loading.

Anyway, I have another little question. About extensions. Few days ago I saw an extension list generated by glGetString(GL_EXTENSIONS). The graphics card if GeForce 7300, but the driver wasn't the original driver, but a newer one. The latest OpenGL version supported is 2.1.2 (or something else a little above 2.1), and - if I'm not mistaken - one of the extensions was GL_ARB_framebuffer_object . This extension was approved in 2008, so its full contents didn't exist when the driver was created. So is there a connection between the version and the supported extensions? The OpenGL specification files (which can be found at www.opengl.org) list the new ARB extensions, but GL_ARB_framebuffer_object is newer than the graphics card and is still supported. Can a driver support an extension that the hardware doesn't support, or GL_ARB_framebuffer_object guarantee that the card supports the extension? And in general, is it possible that a old card supports a new extension through a new driver (if it originally supported a limited EXT version and the new ARB one only adds features that don't require changing the hardware) ?

In other words, can I rely only on glGetString(GL_VERSION) the specification files or it's a better idea to check which extensions are supported using glGetString(GL_EXTENSIONS)?
You should check what you aim to use. If you want to use the extension ARB_framebuffer_object, then you have to check the extension string if it is supported. If you instead want to use the corresponding core functions, you must check the version number for correct core version. You can not rely on the version number to report extension support, nor rely on the extension string to report core support.

If a feature is reported as supported, whether via the extension string or the version number, you know that you can use that particular feature. It does not say anything about hardware support, performance, or anything, only that you can use it and it will behave as described in it's specification. However, you can often assume that a reported extension is supported by the hardware, as is the corresponding core feature.
Quote:Original post by Tom Backton
Now I see how it works...I'm still surprised none of the tutorials I read mentioned function pointer loading.

Anyway, I have another little question. About extensions. Few days ago I saw an extension list generated by glGetString(GL_EXTENSIONS). The graphics card if GeForce 7300, but the driver wasn't the original driver, but a newer one. The latest OpenGL version supported is 2.1.2 (or something else a little above 2.1), and - if I'm not mistaken - one of the extensions was GL_ARB_framebuffer_object . This extension was approved in 2008, so its full contents didn't exist when the driver was created. So is there a connection between the version and the supported extensions? The OpenGL specification files (which can be found at www.opengl.org) list the new ARB extensions, but GL_ARB_framebuffer_object is newer than the graphics card and is still supported. Can a driver support an extension that the hardware doesn't support, or GL_ARB_framebuffer_object guarantee that the card supports the extension? And in general, is it possible that a old card supports a new extension through a new driver (if it originally supported a limited EXT version and the new ARB one only adds features that don't require changing the hardware) ?

In other words, can I rely only on glGetString(GL_VERSION) the specification files or it's a better idea to check which extensions are supported using glGetString(GL_EXTENSIONS)?


Read what Brother Bob said and I can I add that GL_ARB_framebuffer_object should have been supported in the first place instead of GL_EXT_framebuffer_object. With the EXT version, if you bind a color buffer and depth buffer and any other attachments, they all must be the same dimensions. The ARB version got rid of that. The ARB version also merged a bunch of individual extensions
http://www.opengl.org/wiki/GL_EXT_framebuffer_object

It's too bad that OpenGL is so complicated.
I can suggest that you either use GL 2.1 + GL_EXT_framebuffer_object
or GL 3.0 (FBO is core) but the general public doesn't have GL 3.0 drivers.

Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
Quote:Original post by V-man...but the general public doesn't have GL 3.0 drivers.

NVIDIA have had OpenGL 3.0+ in their proper drivers for a while now. I'm not sure about ATI, I don't follow what they do.

Regards
elFarto

Quote:Original post by elFarto
Quote:Original post by V-man...but the general public doesn't have GL 3.0 drivers.

NVIDIA have had OpenGL 3.0+ in their proper drivers for a while now. I'm not sure about ATI, I don't follow what they do.

Regards
elFarto


I doubt you'll find GL 3.0 drivers on every machine today. Depends too much on drivers. ATI has 3.0 support since Catalyst 8.9. Not sure which GPUs.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement