Problem with OpenGL and ATI HD3850
Roland Smith
rsmith at xs4all.nl
Thu Apr 30 13:16:14 UTC 2009
On Thu, Apr 30, 2009 at 02:21:55PM +0200, Oliver Lehmann wrote:
> Tom Evans writes:
> >
> > fprint(stderr, "%x %s\n", pcVer, pcVer);
>
> What I now did is (stolen from glxgears):
>
> // Set version string
> const GLubyte* pcVer = glGetString(GL_VERSION);
> fprintf(stderr,"100\n");
> printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
> printf("GL_VERSION = %s\n", (char *) glGetString(GL_VERSION));
> printf("GL_VENDOR = %s\n", (char *) glGetString(GL_VENDOR));
> printf("GL_EXTENSIONS = %s\n", (char *) glGetString(GL_EXTENSIONS));
> assert(pcVer && "Problems getting GL version string using
> glGetString");
> fprintf(stderr,"101\n");
> String tmpStr = (const char*)pcVer;
>
> Just to see what glGetString returns - independently what is in pcVer.
> The output I'm getting is:
>
> olivleh1 at kartoffel olivleh1> freeorion
> unknown chip id 0x9515, can't guess.
> 100
> GL_RENDERER = (null)
> GL_VERSION = (null)
> GL_VENDOR = (null)
> GL_EXTENSIONS = (null)
> 101
> main() caught exception(std::exception): basic_string::_S_construct NULL
> not valid
> olivleh1 at kartoffel olivleh1>
>
>
> Could it be, that there was no "GL context" created before? But than I
> wonder about the output "unknown chip id...". And why the assert() is not
> handling it.
According to the manual page (1), glGetString returns 0 when an error
occurs. E.g. if the name argument isn't recognized, or if it is called
between a glBegin and glEnd call. Maybe the latter is the case here?
Because otherwise it should just return a pointer to a static string.
Roland
(1) http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/getstring.html
--
R.F.Smith http://www.xs4all.nl/~rsmith/
[plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated]
pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-x11/attachments/20090430/4b8c23b3/attachment.pgp
More information about the freebsd-x11
mailing list