|
From: Owen K. <Owe...@sc...> - 2009-03-18 05:25:32
|
Hi, I'm having a problem using OSMesa for off-screen rendering. Our software is designed to run using glx for output and optionally on cluster nodes with visual output going to files using OSMesa. This all works fine as as separate solutions but we want the output type controlled by a user setting and it seems that if the OSMesa library is linked but glx used instead it causes the program to segfault on a call to a non-specific GL function. I also discovered that the order of linking effects this behaviour, if -lOSMesa is specified before -lGL on the compile command line then OSMesa output works but using GL functions through glx will segfault. If the order is reversed then it works fine through glx and OSMesa appears to run ok (no error codes are returned) but none of the graphics commands produce output to the OSMesa buffer and a blank image results. I've attached a sample program to demonstrate this, it produces opengl output in a window when run without any command line args, writes to osmesa and a png file if anything is passed on the command line If compiled with: gcc -o glx glx11.c -lGL -lGLU -lOSMesa -lpng Runs fine in window but osmesa produces blank output When compiled with: gcc -o glx glx11.c -lOSMesa -lGL -lGLU -lpng Segfault in window, osmesa produces output correctly Is there any way to get both working together without recompiling? Regards, Owen Kaluza |