Take the 2-minute tour ×

When creating a GLX context, you have to specify whether you want direct rendering or not. Direct rendering provides a performance advantage sometimes, so it's preferable to use that, but it can't be used with a remote X-server.

Is there a simple and reliable way to determine if my application is connected to a local server?

share|improve this question
s/advantage sometimes/advantage always/ It's just a question of "hardly noticeable" or "order of magnitude" advantage. –  Nathan Kidd Sep 18 '12 at 18:02
add comment

2 Answers

up vote 2 down vote accepted

I think you can just request a direct rendering context, and GLX will fallback to an indirect one if appropiate. Source: http://www.opengl.org/sdk/docs/man/xhtml/glXCreateContext.xml

share|improve this answer
add comment

In addition to the answer of @gpeche, you can test if a context is direct with glXIsDirect. Note, that by using Vertex Buffer Objects the performance differences between indirect and direct rendering are neglectible: All data is kept server side and only (short and small) drawing commands are used, that cause the rendering of large batches.

share|improve this answer
add comment

Your Answer


