Thread: [PyOpenGL-Users] GL_VENDOR
Brought to you by:
mcfletch
From: Mads I. <mp...@co...> - 2009-09-24 06:48:24
|
How come glGetString(GL_VENDOR) returns None if I don't have an OpenGL context? My innocent purpose of querying the vendor string is to display some driver info in an 'about box'. Normally I get the context by launching a QGLWidget from Qt, but it would be really silly to do this for the purpose of displaying an about box. All tricks and suggestions are most welcome, Mads -- +------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +------------------------------+-----------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Nørresøgade 27A | www: www.quantumwise.com | | DK-1370 Copenhagen, Denmark | email: mp...@qu... | +------------------------------+-----------------------------+ |
From: René D. <re...@gm...> - 2009-09-24 14:05:24
|
On Thu, Sep 24, 2009 at 7:48 AM, Mads Ipsen <mp...@co...> wrote: > How come glGetString(GL_VENDOR) returns None if I don't have an OpenGL > context? > > My innocent purpose of querying the vendor string is to display some > driver info in an 'about box'. Normally I get the context by launching a > QGLWidget from Qt, but it would be really silly to do this for the > purpose of displaying an about box. > > All tricks and suggestions are most welcome, > > Mads > Hi, That can crash on some machines too without a connection. It's for querying the GL connection, so you need a connection to use it. Reading from the glxinfo program might be another idea to try... if it's there on the platform. cheers, |
From: Mads I. <mp...@co...> - 2009-09-24 19:37:16
|
René Dudfield wrote: > On Thu, Sep 24, 2009 at 7:48 AM, Mads Ipsen <mp...@co...> wrote: > >> How come glGetString(GL_VENDOR) returns None if I don't have an OpenGL >> context? >> >> My innocent purpose of querying the vendor string is to display some >> driver info in an 'about box'. Normally I get the context by launching a >> QGLWidget from Qt, but it would be really silly to do this for the >> purpose of displaying an about box. >> >> All tricks and suggestions are most welcome, >> >> Mads >> >> > Hi, > > That can crash on some machines too without a connection. It's for > querying the GL connection, so you need a connection to use it. > > Reading from the glxinfo program might be another idea to try... if > it's there on the platform. > > cheers, > > OK, so how do I in the simplest possible manner set up an OpenGL context so I can query the vendor string, i.e. without opening any redundant windows? Calling glxinfo (or any other external program) is not an option, since we do cross platform development. Mads -- +------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +------------------------------+-----------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Nørresøgade 27A | www: www.quantumwise.com | | DK-1370 Copenhagen, Denmark | email: mp...@qu... | +------------------------------+-----------------------------+ |
From: Greg E. <gre...@ca...> - 2009-09-25 01:09:12
|
Mads Ipsen wrote: > How come glGetString(GL_VENDOR) returns None if I don't have an OpenGL > context? Because you don't *have* an OpenGL vendor until you have a context. Contexts belonging to different display devices can be using drivers from different vendors, so it's a property of the context rather than something global. Something it's easy to overlook about OpenGL is that it's really an object-oriented system, with almost all of the functions being methods of the context. But the API does a good job of hiding this by making the current context an implicit global parameter. -- Greg |
From: Mads I. <mp...@co...> - 2009-09-25 12:31:47
|
Greg Ewing wrote: > Mads Ipsen wrote: > >> How come glGetString(GL_VENDOR) returns None if I don't have an OpenGL >> context? >> > > Because you don't *have* an OpenGL vendor until you > have a context. Contexts belonging to different > display devices can be using drivers from different > vendors, so it's a property of the context rather > than something global. > > Something it's easy to overlook about OpenGL is > that it's really an object-oriented system, with > almost all of the functions being methods of the > context. But the API does a good job of hiding this > by making the current context an implicit global > parameter. > > Thanks for the answer. My question can then be boiled down to: How do I in the simplest possible manner set up an OpenGL context so I can query the vendor string? Best regards, Mads -- +------------------------------------------------------------+ | Mads Ipsen, Scientific developer | +------------------------------+-----------------------------+ | QuantumWise A/S | phone: +45-29716388 | | Nørresøgade 27A | www: www.quantumwise.com | | DK-1370 Copenhagen, Denmark | email: mp...@qu... | +------------------------------+-----------------------------+ |
From: René D. <re...@gm...> - 2009-09-26 01:06:37
|
On Fri, Sep 25, 2009 at 1:26 PM, Mads Ipsen <mp...@co...> wrote: > > How do I in the simplest possible manner set up an OpenGL context > so I can query the vendor string? > > Depends on which windowing toolkit you want to use. I know it's possible to create a context without a visible window on most platforms... but it's platform specific. I'm not sure how to do it in qt without one... but maybe it's possible. Either just load one of their widgets... or ask on a qt mailing list. cheers. |