glGetString out of context

Started by
4 comments, last by superpig 20 years, 1 month ago
Is it possible to call glGetString without creating a context first? Failing that, is it possible to create a context without a visible window? I want to check the various things glGetString tells me (like the available OpenGL extensions) without actually creating a window/initializing the renderer.

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

Advertisement
i think you''ll find pretty much ALL the OGL commands require a context, however you can create one without a visable window, just dont tell windows to show it
The OpenGL Extension Viewer uses this system afaik (and i''ll be using the same trick)
in my experience that depends on:

years ago, when the first TNT cards went out,
and when ATI''s current card was this shitty-8MB-software-only-card (i forgot the name), i encountered different situations:
on nvidia cards it worked without creating a context and activating it, on ATI card''s it didn''t work - since then i''m creating always a context.
i wouldn''t rely on such topics; do it the save way...

DJSnow
---
this post is manually created and therefore legally valid without a signature
DJSnow---this post is manually created and therefore legally valid without a signature
Yes, glGetString does require a valid rendering context. However I don''t think you need a window : you should try creating a rendering context for the desktop.
quote:Original post by superpig
I want to check the various things glGetString tells me (like the available OpenGL extensions) without actually creating a window/initializing the renderer.

Creating an invisible context would be about the only way to do it IIRC, but you might not get the results you expect. The extensions avalible can be different depending on the context.
creating a pretty generic window seems to do the trick something like 16bit color, 16bit z-buffer, no stencil, 800*600, no accum - if your gfx card cant hardware accelrate that then ya doomed tbh :D

As for getting the context from the desktop, bad bad bad naughty and bad and not remotely recomended, it can cause problems, ya better of building and making your own window, setting it up with a tempory context, finding ya info and then shuting down again.
With the desktop system i think you can get ownership problems and just because it happens to work now doesnt mean it will forever, best not to take the chance imo

This topic is closed to new replies.

Advertisement