Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Apr 2009 15:16:12 +0200
From:      Roland Smith <rsmith@xs4all.nl>
To:        Oliver Lehmann <oliver@freebsd.org>
Cc:        Tom Evans <tevans.uk@googlemail.com>, x11@freebsd.org
Subject:   Re: Problem with OpenGL and ATI HD3850
Message-ID:  <20090430131612.GA59668@slackbox.xs4all.nl>
In-Reply-To: <20090430122155.6643.qmail@avocado.salatschuessel.net>
References:  <20090429164113.f0b48048.lehmann@ans-netz.de> <20090429163843.GB370@slackbox.xs4all.nl> <18936.36210.823588.838523@gromit.timing.com> <20090430063454.969303d0.lehmann@ans-netz.de> <1241092672.3294.6.camel@localhost> <20090430122155.6643.qmail@avocado.salatschuessel.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--gBBFr7Ir9EOA20Yy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 30, 2009 at 02:21:55PM +0200, Oliver Lehmann wrote:
> Tom Evans writes:
> >=20
> > fprint(stderr, "%x %s\n", pcVer, pcVer);=20
>=20
> What I now did is (stolen from glxgears):=20
>=20
>         // Set version string
>         const GLubyte* pcVer =3D glGetString(GL_VERSION);
> fprintf(stderr,"100\n");
>       printf("GL_RENDERER   =3D %s\n", (char *) glGetString(GL_RENDERER));
>       printf("GL_VERSION    =3D %s\n", (char *) glGetString(GL_VERSION));
>       printf("GL_VENDOR     =3D %s\n", (char *) glGetString(GL_VENDOR));
>       printf("GL_EXTENSIONS =3D %s\n", (char *) glGetString(GL_EXTENSIONS=
));
>         assert(pcVer && "Problems getting GL version string using=20
> glGetString");
> fprintf(stderr,"101\n");
>         String tmpStr =3D (const char*)pcVer;=20
>=20
> Just to see what glGetString returns - independently what is in pcVer.
> The output I'm getting is:=20
>=20
> olivleh1@kartoffel olivleh1> freeorion
> unknown chip id 0x9515, can't guess.
> 100
> GL_RENDERER   =3D (null)
> GL_VERSION    =3D (null)
> GL_VENDOR     =3D (null)
> GL_EXTENSIONS =3D (null)
> 101
> main() caught exception(std::exception): basic_string::_S_construct NULL=
=20
> not valid
> olivleh1@kartoffel olivleh1>=20
>=20
>=20
> Could it be, that there was no "GL context" created before? But than I=20
> wonder about the output "unknown chip id...". And why the assert() is not=
=20
> 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
--=20
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)

--gBBFr7Ir9EOA20Yy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAkn5pJwACgkQEnfvsMMhpyXxcwCeMeJHGyCe03rO3BL1R5ZHsvLr
UAQAn11p9310V1srZgMjruOy0yrWNF8F
=b0hA
-----END PGP SIGNATURE-----

--gBBFr7Ir9EOA20Yy--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090430131612.GA59668>