PDA

View Full Version : check OpenGl version ?????



programmer
21-11-2006, 06:47 AM
Hi ...
I want code to check what's the OpenGl version on my computer

WILL
21-11-2006, 07:00 AM
This thread belongs here in the Graphics forum more so than it does in the GLScene forum so I moved it. Also, I've noticed that the number of question marks seems to keep growing with your subject titles. Just one will suffice my friend. ;)


I think that if you try out a neat little tool called GLInfo created by Tom Nuydens it will tell you exactly what functions are supported by your card and what version of OpenGL is supported. Also, it gathers in a huge database all the information from users that choose to contribute their video card's specs. You can find it here (http://www.delphi3d.net/hardware/index.php).

grudzio
21-11-2006, 08:14 AM
Use glGetString(GL_VERSION) function.

programmer
21-11-2006, 09:35 PM
why didn't work ?



uses OpenGL1X;

procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.text := glGetString(GL_VERSION);
// no value in edit1
end;

cragwolf
22-11-2006, 04:18 AM
I think there needs to be an active OpenGL rendering context before that function will work.

chronozphere
22-11-2006, 11:05 AM
Maybe this will work:

uses OpenGL; //changed Opengl1x to OpenGL

procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('OpenGL vendor ' + glGetString(GL_VENDOR));
ShowMessage('OpenGL renderer ' + glGetString(GL_RENDERER));
ShowMessage('OpenGL version ' + glGetString(GL_VERSION));
ShowMessage('Supported OpenGL extensions ' + glGetString(GL_EXTENSIONS));
end;


good luck :)

Edit: Oops just tested... unfortunatly it didn't work on my pc :( :oops:

chronozphere
22-11-2006, 11:14 AM
I think there needs to be an active OpenGL rendering context before that function will work.

You are right ;) i downloaded Nehe's first tutorial and included the code at the end of the "CreateGLWindow" routine. And it worked.

You should try to find out which OpenGL routine(s) need to be called before you can get the GL version. :)

programmer
22-11-2006, 09:24 PM
Please can you write the full code now :)

cragwolf
22-11-2006, 09:38 PM
So for example, if you're using SDL as your windowing system, then the glGetString(GL_VERSION) function won't work until after you call the SDL_SetVideoMode function. If you're on Windows I suspect it would be after the call to the CreateWindowEx function. If you're using GLUT I think it would be after the call to the glutCreateWindow function.

chronozphere
24-11-2006, 02:38 PM
Go to this (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=01) page and download the delphi source. It contains the source for setting up a OGL window.

Just add the glGetString at the end of the window creation routine and then it should work. :)

Good luck :)

programmer
26-11-2006, 08:55 PM
Sorry about the many questions .

But I use GLScene library , When I must write that code ... :oops:

Please step by step .

grudzio
27-11-2006, 04:59 AM
Try calling glGetString in TGLSceneViewer.OnCreate event.