BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to show the version number of OpenGL?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Ma Xiaoguang
Guest





PostPosted: Thu Apr 26, 2007 8:11 am    Post subject: How to show the version number of OpenGL? Reply with quote



Dear Ladies and Gentlemen,

I want to show the version number of OpenGL with TLabel. I added the
OpenGL library to the uses clause, and called the glGetString(GL_VERSION).
But this routine returns a PChar, I don't know how to convert it to a
string, and show it on the caption of a TLabel. Help me, please. Thank you
very much.

Best regards.

Xiaoguang
Back to top
Lord Crc
Guest





PostPosted: Fri Apr 27, 2007 1:50 am    Post subject: Re: How to show the version number of OpenGL? Reply with quote



On Thu, 26 Apr 2007 13:54:38 +0800, "Ma Xiaoguang"
<maxiaoguang10000 (AT) hotmail (DOT) com> wrote:

Quote:
I want to show the version number of OpenGL with TLabel. I added the
OpenGL library to the uses clause, and called the glGetString(GL_VERSION).
But this routine returns a PChar, I don't know how to convert it to a
string, and show it on the caption of a TLabel. Help me, please. Thank you
very much.

Delphi can convert PChar's "on the fly" to strings, so you should be
able to simply say

Label1.Caption:= glGetString(...);

- Asbjørn
Back to top
Ma Xiaoguang
Guest





PostPosted: Fri Apr 27, 2007 5:45 am    Post subject: Re: How to show the version number of OpenGL? Reply with quote



Hello,

Quote:
Delphi can convert PChar's "on the fly" to strings, so you should be
able to simply say

Label1.Caption:= glGetString(...);


Thanks for your reply. But the glGetString() gives me nothing. What's the
reason, please?

Best regards.

Xiaoguang
Back to top
Mitch
Guest





PostPosted: Fri Apr 27, 2007 7:47 pm    Post subject: Re: How to show the version number of OpenGL? Reply with quote

Ma Xiaoguang wrote:
Quote:
Hello,


Delphi can convert PChar's "on the fly" to strings, so you should be
able to simply say

Label1.Caption:= glGetString(...);



Thanks for your reply. But the glGetString() gives me nothing. What's the
reason, please?

Best regards.

Xiaoguang



Sounds like a driver or OS issue. Have you tried the other constants
GL_VENDOR and GL_RENDERER? What OS are you using? NVidia has had some
driver issues with Vista. Try it on another computer or ask your
question on the OpenGL.org forums where you'll find a more OpenGL
expertise then you can shake a stick at.

Mitch Wolberg,
RockWare, Inc.
Back to top
Lord Crc
Guest





PostPosted: Fri Apr 27, 2007 8:09 pm    Post subject: Re: How to show the version number of OpenGL? Reply with quote

On Fri, 27 Apr 2007 08:45:31 +0800, "Ma Xiaoguang"
<maxiaoguang10000 (AT) hotmail (DOT) com> wrote:

Quote:
Thanks for your reply. But the glGetString() gives me nothing. What's the
reason, please?

Do you have a valid opengl context active?

- Asbjørn
Back to top
Ma Xiaoguang
Guest





PostPosted: Sat Apr 28, 2007 8:11 am    Post subject: Re: How to show the version number of OpenGL? Reply with quote

Hi,

Quote:
Do you have a valid opengl context active?

I am not sure. Thanks for you reply.

Best regards.

Xiaoguang
Back to top
Ma Xiaoguang
Guest





PostPosted: Sat Apr 28, 2007 8:11 am    Post subject: Re: How to show the version number of OpenGL? Reply with quote

Hi Mitch,

Thanks for your reply.

Quote:
Sounds like a driver or OS issue. Have you tried the other constants
GL_VENDOR and GL_RENDERER? What OS are you using?

It still not work with GL_VENDOR and GL_RENDERER. My OS is Windows XP
Professional SP2, and I compiled the code with Delphi 6 Enterprise.

Best regards.

Xiaoguang
Back to top
Lord Crc
Guest





PostPosted: Sat Apr 28, 2007 3:15 pm    Post subject: Re: How to show the version number of OpenGL? Reply with quote

On Sat, 28 Apr 2007 14:51:22 +0800, "Ma Xiaoguang"
<maxiaoguang10000 (AT) hotmail (DOT) com> wrote:

Quote:
Do you have a valid opengl context active?

I am not sure. Thanks for you reply.

Uhm, are you using raw OpenGL or some form for wrapper?

If you're using raw OpenGL then you have to create and activate the
context before the glGetString() stuff. That would be wglCreateContext
and wglMakeCurrent calls.

If you're using some sort of package, they usually pull out the vendor
string and such and place it in some variable.

- Asbjørn
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.