How to obtain OpenGL 2.1. Revisited: Gods.. heed my call!
Albin Engström

This is pretty serious business my friends, I'm going mad with this old version of openGL.

My last thread about this began pretty nicely with Thomas Fjellstrom telling me to find some updated headers, i searched but found nothing. I'm not really sure what to go for and I'm not even sure exacly what version of openGL i have, I know i don't have 2.1 because i can't use the things that were made into core features for the 2.1 version, like for example glCreateProgram.

This is not about shaders or extentions at all, i just don't want to use something that's older than what i can use. (i do want to use shaders..).

Please share your wisdom. (and don't tell me to go for extensions or glut or similar things) Thanks!

Vanneto

Well, AFAIK updating just the headers wont do anything because the .dll will still be at version 1.2.

If you want a newer version, you will need updated headers + libraries + updated .dll. But I am not really sure where you can get all this.

Maybe the open source MESA 3D implementation uses a updated version of the .dll. I don't really know, why not give it a try?

Good luck.

Albin Engström

Thanks vanneto, unfortunately i found nothing except modified openGL headers :(.

No wait, here's something, the openGL32.dll and openGL32.lib.

Hmm.. As far as i know openGL 2.1 was released 2006, this openGL32.lib was created 2004. Besides i cannot find any pure openGL headers :/.

Vanneto

I could be wrong, but maybe there is no 2.1 version on Windows, maybe you DO need to use the features through the extensions. Thats just a guess though, I don't really know.

I hope there is someone who has an answer to this because now I got curious. :P

Kitty Cat

In Windows, OpenGL is stuck at version 1.1. Anything else, and you need extensions. Of course, you can always use helper libs to automagically load extensions for you.

Edgar Reynaldo

Here's an OpenGL extension viewer that Sirocco linked to a while back :
OpenGL Extension Viewer 3.03

It crashes during the rendering test if I run it on my laptop but not on my desktop , but it has all kinds of useful information about what extensions you have installed and what your graphics card can do.

- Kitty Cat -
Does having up to date graphics card drivers allow windows users to use later versions of OpenGL?

Thomas Fjellstrom
Quote:

Does having up to date graphics card drivers allow windows users to use later versions of OpenGL?

Only, and ONLY if the drivers replace the OpenGL32.dll file itself. Which I don't think happens (anymore, I thought it was something the drivers were aloud to do, but I've heard otherwise...), even though thats the way its done on linux, libGL.so.x is replaced/installed with your GFX drivers, which hook directly into your particular graphics hardware.

Milan Mimica

http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html
glGetString(GL_VERSION) returns... guess what.
glGetString(GL_EXTENSIONS) returns a list of supported extensions.

Updated headers don't help much. You can write your own declarations, that's trivial to do.

Kitty Cat
Quote:

glGetString(GL_VERSION) returns... guess what.

Unfortunately, that's just the driver's version for the current context. opengl32.dll and/or its import lib don't export core functions above version 1.1 (unless that's changed recently? Vista might have up to 1.4 exported (ooh, ahh..)).

Albin Engström

I cannot accept that one cannot use anything but openGL 1.1, I took another look at glew and it says:

glew said:

The latest release contains support for OpenGL 2.1 and the following extensions

note the "support for OpenGL 2.1", does that mean that if I use glew i get access to openGL 2.1 functionality?

Anyway, I tried to include glew into my project but I'm such a retard when it comes to linking and stuff like that >:(.

compiler said:

..\Objects\main.o:main.cpp: (.text+0x2a7)||undefined reference to `_imp____glewCreateProgram'|

This is how i include glew:

#ifdef WIN32
    #include <windows.h>
#endif

#include <gl/glew.h>
#include <gl/gl.h>

I'm using codeblocks so the linker is a bit retarded, I can't change the order of linking without removing everything from the list first, I'm not sure I'm in the right place so I'll post a picture:

{"name":"595364","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/e\/3e13a9c2fe0a31b7954721e47df0a42a.png","w":672,"h":514,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/e\/3e13a9c2fe0a31b7954721e47df0a42a"}595364
EDIT: where did that -dinput come from :-X.. I'll let it stick around if it won't do anything bad..

What's worse is that there are two different "build options" the one i posted a picture of was the "project build option" the other is named simply "build option"... It's very confusing having them both around.. please explain.

Thank you very much.

GullRaDriel
Albin said:

I can't change the order of linking without removing everything from the list first

{"name":"595365","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/c\/7c37a0476b193a01e4b43b596bd3aecf.png","w":672,"h":514,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/7\/c\/7c37a0476b193a01e4b43b596bd3aecf"}595365

Hahem, you see the two buttons there ?
Select one entry and push one of them, and see what happens.

Albin Engström

Tehe... :P...

Nothing changes when i switch their order, I mean, I still get linking errors about _imp____glewCreateProgram.

gnolam

So just use AllegroGL. :P

Thomas Fjellstrom
Quote:

note the "support for OpenGL 2.1", does that mean that if I use glew i get access to openGL 2.1 functionality?

Windows does NOT provide a OpenGL 2.x dll. GL however allows a driver to provide extensions to the spec which any and all OpenGL 2.x features will be pushed in as (most/all started as extensions to OpenGL 1.x anyhow)

Both glew and AllegroGL will load extensions for you. I'd personally go with AllegroGL if you're even remotely familiar with Allegro already and you don't want to switch away.

Wagner Soares

does AllegroGL have support to shaders?
is there a way to access the GPU opengl directly?
because if OpenGL on windows is at version 1.1 and the game must access opengl32.dll, how some games built on it have shaders working?

[EDIT]
when I was writing, Thomas hasn't posted yet. :P

Thomas Fjellstrom

edit: nm.

Milan Mimica
Quote:

Unfortunately, that's just the driver's version for the current context. opengl32.dll and/or its import lib don't export core functions above version 1.1

Exactly. If glGetString(GL_VERSION) returns a version that doesn't guarantee that the wanted feature is in the core (whatever the reason might be), you can check if the extension is listed in glGetString(GL_EXTENSIONS) and load it. This is how you do it with OpenGL, no matter what OS are you running.

AllegroGL and other libs can do this things for you.

Albin Engström

Yes yes, AllegroGL is fantastic, but I don't want to use AllegroGL. :(

Stupid glew..

Arthur Kalliokoski
Quote:

Nothing changes when i switch their order, I mean, I still get linking errors about _imp____glewCreateProgram.

IIRC, I seen some old code that needed to include at least one library twice due to circular dependencies.

Arvidsson

Have you tried including the sourcefiles directly into your project and not use the library?

Albin Engström

:-/.

When i try to include the source file instead of the library things go well up to a point where it says: "X:#Project\Source\glew.c|5413|undefined reference to `_imp__glewExperimental'|" It seems as if it checks this if openGL 2.1 has been defined.. Might it have something to do with me updating the gl headerfiles?

Well, dammit, does glew only load extensions? I think I can do that myself.

Thomas Fjellstrom

You know, if you don't use AllegroGL you're going to have to implement all of what it does yourself. Whats the point in that? You could have started working on your actual program already.

Allegro alone does NOT work well with GL. Infact if you just use plain Allegro 4.2, you're stuck with a non GL compatible window. So now you need to stop using allegro's gfx, and input (input is tied to the window) all together and code all of that stuff yourself. The only way to use allegro's GFX with GL and not use AllegroGL is to draw to memory bitmaps and turn them into textures yourself (AllegroGL provides a function for that, but you don't want to use AllegroGL for some unknown and silly reason).

GullRaDriel

In case it helps, here is what I use in my Makefile. Please only take a look at the opengl and gl things ;-p

-lnilorea -lagl_s -lalleg -luser32 -lgdi32 -lopengl32 -lglu32 -lglaux -lwsock32 -lws2_32 -lpthreadGC2 -lWinmm -mwindows

Albin Engström

Sorry for the delay, I've been sick and my head hasn't worked well, I don't want to program when I'm such a state.

Thomas Fjellstrom said:

You know, if you don't use AllegroGL you're going to have to implement all of what it does yourself. Whats the point in that? You could have started working on your actual program already.

Allegro alone does NOT work well with GL. Infact if you just use plain Allegro 4.2, you're stuck with a non GL compatible window. So now you need to stop using allegro's gfx, and input (input is tied to the window) all together and code all of that stuff yourself. The only way to use allegro's GFX with GL and not use AllegroGL is to draw to memory bitmaps and turn them into textures yourself (AllegroGL provides a function for that, but you don't want to use AllegroGL for some unknown and silly reason).

While AllegroGL makes the job a lot easier, it makes it's user miss a lot of things that I feel is important to know. On a friends computer any allegro application takes 15-30 seconds to load, this makes me feel like I have no control over certain aspects of my game, and I hate that feeling. You might think it's a dumb decision to not use AllegroGL but I feel like I gain a lot from doing so, it increases my understanding of how things work and makes it easier for me to overcome other problems.

Thank you Gull, unfortunately I'm not sure i can absorb the help you are trying yo give me. I link against 3 of the things you link against (-lgdi32 -lopengl32 -lglu32), i changed their order to match yours, I don't know what to think about lglaux, isn't glaux some old out dated library with a similar purpose of glut?

Maybe i should try to restore the original openGL header and try the direct include approach again.

Milan Mimica

Headers are not crucial. All you need is wglGetProcAdress() on Windows and glxGetProcAdress() on X11. These are defined in OpenGL libs. You use them to get the address of the function, after you have checked that the extension is supported by examining the output of glGetString(GL_EXTENSIONS).

Then when you have the pointer to a function you want to call, you call it. That's when the headers kick in, for various #defines for functions arguments, and actual argument list. The most up to date headers and extension documentation is on http://www.opengl.org/registry/.

Thomas Fjellstrom
Quote:

On a friends computer any allegro application takes 15-30 seconds to load, this makes me feel like I have no control over certain aspects of my game, and I hate that feeling.

What kind of computer? a 386? AllegroGL is not causing that extra load time, if it is, its a bug.

Allegro 4.9 had a little bug (and still might) which caused initialization of the font addon to take a long time...

Quote:

You might think it's a dumb decision to not use AllegroGL but I feel like I gain a lot from doing so, it increases my understanding of how things work and makes it easier for me to overcome other problems.

Thats a perfectly valid reason to pick doing something this complex and time consuming yourself. But once you've done it yourself, it would be stupid to do it again :P

Thread #596392. Printed from Allegro.cc