Article View: comp.graphics.api.opengl
Article #21Re: Getting NULL insted of information from glGetString(GLenum)
From: Marcin Romaszewicz
Date: Wed, 20 Oct 1999 00:00
Date: Wed, 20 Oct 1999 00:00
46 lines
1968 bytes
1968 bytes
You must have a valid rendering context before you can call glGetString.
Open up a window, get a context, and then call glGetString and you will
get the correct behavior.
-- Marcin
"Dr. Antoni Kajetan Wisor" wrote:
>
> Hi folks!
>
> I have a small problem with OpenGL. Because I am not very deep in this topic, I
> do not know what to do further. If any one can help me, please post it. Here is
> an excerpt of my problem, which should run without any problem after
> compilation:
>
> #include <stdio.h> //Standard C I/O functions
> #include <windows.h> //For Win32-API Applications
> #include <gl/gl.h> //OpenGL
>
> /* Declaration of prototypes */
> LONG __cdecl main();
>
> /* Mainprog */
>
> LONG __cdecl main()
> {
> char* vendor = (char*)glGetString((GLenum)GL_VENDOR);
> char* renderer = (char*)glGetString((GLenum)GL_RENDERER);
> char* version = (char*)glGetString((GLenum)GL_VERSION);
> char* extensions = (char*)glGetString((GLenum)GL_EXTENSIONS);
>
> glFlush();
>
> printf("Vendor: %s\n", vendor);
> printf("Renderer: %s\n", renderer);
> printf("Version: %s\n", version);
> printf("Extensions: %s", extensions);
>
> return (LONG)0;
> }
>
> Thanks!
>
> Jakob Wisor
Technical Details
Message-ID:
<380E2814.56754007@sgi.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<380E1E8F.6275AFA@cityweb.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f65bb,89bcb65e54c50f64 X-Google-Attributes: gidf65bb,public X-Google-Thread: f4527,89bcb65e54c50f64 X-Google-Attributes: gidf4527,public From: Marcin Romaszewicz <marcin@sgi.com> Subject: Re: Getting NULL insted of information from glGetString(GLenum) Date: 1999/10/20 Message-ID: <380E2814.56754007@sgi.com> X-Deja-AN: 538563843 Content-Transfer-Encoding: 7bit References: <380E1E8F.6275AFA@cityweb.de> X-Accept-Language: pl Content-Type: text/plain; charset=us-ascii Organization: Silicon Graphics Inc., Mountain View, CA Mime-Version: 1.0 Newsgroups: comp.graphics.api.opengl,3dfx.linux.dev.opengl