From: Brian P. <bri...@tu...> - 2008-06-24 15:11:33
|
Alexander Mont wrote: > I have a GLUT-based data visualization application that allows a user to > view a scene and manipulate that view using a UI. I want to add a > “scripting mode” to the application where the user specifies an input > file containing a sequence of commands to execute, and then the program > executes those commands and then writes the contents of the display to a > file. > > > > I am trying to use OSMesa for this by using an OSMesa rendering context > instead of the one generated by GLUT. I have tried to do this by calling > the functions needed to make the OSMesa context instead of the > glutCreateWindow() function. However, this doesn’t work: it gives an > access violation exception as soon as glutPostRedisplay() is called. > > > > Is it even possible to get GLUT to recognize an OSMesa rendering > context, and if so, how? GLUT doesn't know anything about OSMesa, but I think it should be possible to use both libraries in one app. Basically, if you're starting with a regular GLUT app, you should be able to create and bind an OSMesa rendering context and draw something off-screen. But then, when you're done drawing with OSMesa, you should try calling glutSetWindow() to re-bind the original GLUT rendering context. If you try that and have trouble, if you could send me a simple test program I could look into it. > (I am using the GLUT libraries that are generated by Mesa, not the > system’s native GLUT libraries.) > > > > -Alexander Mont > > > > (Note that I already have the scripting mode working with the system’s > own OpenGL libraries, and copying the contents of a window to a file > from there. The reason I want to use OSMesa is because I want to run the > scripting mode on machines which do not have windowing systems or even > graphics cards.) -Brian |