On 11-12-22 11:54 AM, DRC wrote:
> On 12/22/11 9:56 AM, Nathan Kidd wrote:
>> On 11-12-22 09:36 AM, Stefan Eilemann wrote:
>>> I need to detect within a C++ program whether or not I'm running under 
>>> VirtualGL, to enable certain optimizations. What is the recommended way to 
>>> do this?
>>
>> When VGL is running it overrides the GLX vendor strings with
>> "VirtualGL".  Try glXGetClientString() with GLX_VENDOR.
>> http://www.opengl.org/sdk/docs/man/xhtml/glXGetClientString.xml
>
> Forget what I said about VGL_AUTOTEST.  This is a much better approach,
> in general, although I think that, in the OP's case, he wanted to know
> about VGL's presence before the display connection was created.

If one really needs to know before "the" connection is made, it 
shouldn't be a difficulty to just:
tmpdpy=XOpenDisplay(); glXGetClientString(tmpdpy); XCloseDisplay(tmpdpy);

Trivia: I don't know why one would do this, but the way VGL hooks 
glXGetClientString, and _isremote is implemented, you technically could 
get away with passing in a bogus DPY, (though the API docs don't 
explicitly say that Xlib won't fall back to its error handler instead of 
just returning a NULL return value, in this case.)

-Nathan

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
VirtualGL-Devel mailing list
VirtualGL-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtualgl-devel

Reply via email to