From: tom f. <tf...@al...> - 2010-02-17 21:02:01
|
"Viral Patel" <Vir...@an...> writes: > You can link in both Mesa and Non-Mesa gl implementations, the key is > to use mesa in mangled mode, such that, when calling into mesa all gl > calls are: > > mgl* > > but calling into non-mesa the calls are, > > gl* > > This either means you need to write all your code twice or preferably > use function pointers/virtual interfaces to reference each > implementation. A better way to do this (transparently) is to just use GLEW, my GLEW in particular: git://shigeru.sci.utah.edu/glew.git make sure to use the 'sci' branch. You want to use GLEW (or something similar) anyway, because otherwise extension management is a custom-hacked nightmare. The only caveat as compared to regular GLEW is that you must call glewInitLibrary() before calling any glX or OSMesa functions (i.e. including ones to set up your context). When you want to switch which library is in use, just call glewInitLibrary again. Don't do so in an inner loop. At some point I will get not-lazy and most of that work should make it upstream. You'll also need a recent version of Mesa -- git on Windows, 7.4 IIRC on Mac, and 7.3 IIRC on Linux or AIX (assuming 7.3 builds on AIX). I don't test with other systems. One very nice thing about this setup is that you don't need to link your app with any OpenGL implementation. This is particular nice when you're using nvidia's OpenGL (as you say you are), because it is incredibly difficult to run through valgrind -- it triggers errors of its own, as almost all libs do, but it also messes up client code. HTH, -tom |