<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 7, 2013 at 8:44 PM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On 10/06/2013 04:34 AM, Ardillas del Monte wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi,<br>
<br>
I'm planning a system which would need to use the (non-Mesa) system<br>
implementation at some times, and OSMesa at other times (by "system<br>
implementation" I mean whatever -commercial- system driver has the user<br>
installed as provided by the hardware vendor of their graphics hardware).<br>
<br>
The reason for this is that I need to render with floating point color<br>
(in software) sometimes, while rendering the same scene at lower quality<br>
and the fastest hardware-accelerated performance at other times.<br>
<br>
I've thought some possibilities for doing this. The one I thought as<br>
most realistic would be to put the Mesa implementation inside a C++<br>
namespace, and render OpenGL through a C++ object: if you select the<br>
OSMesa object, commands are sent to the Mesa namespace, and if you<br>
select the system object, commands are sent raw, with no namespace, to<br>
the system OpenGL driver.<br>
<br>
However, I don't know if there would be some approach more practical<br>
than this, and moreover, maybe I'm ignoring some problem or issue I<br>
might face with the namespace idea.<br>
<br>
This software would need to run on OSX, Linux, and Windows, so I need<br>
either an approach which would work on all these OSs, or a different<br>
approach for each OS.<br>
<br>
I'll appreciate any ideas or suggestions you might have.<br>
<br>
</blockquote>
<br></div></div>
Other people have done this.  I think the usual approach is to build Mesa/OSMesa with name "mangling" then add a layer to your app to choose between the normal "glFoo" function and the mangled "mglFoo" functions at runtime.<br>

<br>
Basically, if you build mesa with --enable-mangling all the GL entrypoints with "mgl" prefixes instead of "gl".  You'll also want --enable-osmesa or --enable-gallium-osmesa<br>
<br>
-Brian<br>
<br></blockquote><div><br></div><div><div style="font-family:arial,sans-serif;font-size:13px">Thanks a lot!! Very good advice!</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
Ardi</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div></div></div></div>