 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ma Xiaoguang Guest
|
Posted: Thu Apr 26, 2007 8:11 am Post subject: How to show the version number of OpenGL? |
|
|
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
|
Posted: Fri Apr 27, 2007 1:50 am Post subject: Re: How to show the version number of OpenGL? |
|
|
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
|
Posted: Fri Apr 27, 2007 5:45 am Post subject: Re: How to show the version number of OpenGL? |
|
|
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
|
Posted: Fri Apr 27, 2007 7:47 pm Post subject: Re: How to show the version number of OpenGL? |
|
|
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
|
Posted: Fri Apr 27, 2007 8:09 pm Post subject: Re: How to show the version number of OpenGL? |
|
|
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
|
Posted: Sat Apr 28, 2007 8:11 am Post subject: Re: How to show the version number of OpenGL? |
|
|
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
|
Posted: Sat Apr 28, 2007 8:11 am Post subject: Re: How to show the version number of OpenGL? |
|
|
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
|
Posted: Sat Apr 28, 2007 3:15 pm Post subject: Re: How to show the version number of OpenGL? |
|
|
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 |
|
 |
|
|
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
|
|