[Mesa-users] problem with osmesa and glew
Aparajit Narayan [apn3]
apn3 at aber.ac.uk
Mon May 5 09:37:48 PDT 2014
Hi,
Please excuse me if I'm posting this to the wrong mailing list. I'm having a problem using osmesa with glew, and I've tried asking a number of people as well as other forums, but got no answers for this.
Osmesa initially din't compile with glew, because it needs the definition of GLAPI at line 119 of osmesa.h, while glew which needs to be included before #undef s it in its last line. I got around this by doing #define GLAPI extern to the GLAPI macro. I'm not sure if this is the reason for the problem I'm about to describe but from my (rather limited) understanding this does not seem to be the case. I'm using mesa 7 and glew 1.10 (latest).
Basically, I'm trying to run an opengl application on a remote computing cluster. I'm using osmesa as I intend to execute off-screen software rendering (no x11 forwarding etc). I want to use glew (to make life dealing with shaders and other extension related calls easier), and I seem to have built and linked both mesa and glew fine.
When I call mesa-create-context, glewinit gives a OPENGL Version not available output, which probably means the context has not been created. When I call glGetString(GL_EXTENSIONS) i dont get any output, which confirms this. This also shows that glew is working fine on its own. (Other glew commands like glew version etc also work).
Now when I (as shown below), add the mesa-make-context-current function, glewinit crashes with a segfault. Running glGetString(GL_EXTENSIONS) gives me a list of extensions now however (which means context creation is successful??)
I've spent hours trying to figure this out, tried tinkering but nothing works. Would greatly appreciate any help on this. Maybe some of you has experienced something similar before?? Please note that the node I'm working on contains both the regular libGL as well as the libOSMESA files.
I've heard earlier that this may cause crashes, and one needs to build osmesa just using the osmesa configuring options. Is the error I'm getting a cause of this??
(Surely osmesa from mesa version 7.0 can handle extensions and support glsl right?)
int Height = 1; int Width = 1;
OSMesaContext ctx; void *buffer;
ctx = OSMesaCreateContext( OSMESA_RGBA, NULL );
buffer = malloc( Width * Height * 4 * sizeof(GLfloat) );
if (!OSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, Width, Height )) {
printf("OSMesaMakeCurrent failed!\n");
return 0;
}
-- glewinit() crashes after this.
Thanks again!
?
Aparajit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-users/attachments/20140505/2583721c/attachment.html>
More information about the mesa-users
mailing list