From: Brian P. <bri...@tu...> - 2008-06-26 17:23:40
|
Alexander Mont wrote: > You may have misunderstood what I was attempting to do. > > I do not want to have *two* separate rendering contexts: one for the > offscreen rendering and one for the onscreen rendering. Rather, I want to > have a *single* offscreen rendering context, but I want the GLUT display > functionality to still work. > > The attached file is a simple test program that explains what I am > attempting to do. The OSTEST preprocessor definition controls whether OSMesa > is used, while the CREATEWINDOW preprocessor definition controls whether > GLUTCreateWindow is called. > > If OSTEST is turned off, it is a simple GLUT application that uses the > window, and it works correctly. If OSTEST is turned on, what I am doing is > creating the window, then switching the rendering context to the OSMesa one. > In this case, when I run the program, a window comes up, which appears > broken. If you wait several seconds and then close the window, however, the > files will have come up as desired. > > What I want to do is have exactly this behavior, except for it not to have > to create an actual window at all. This is because I want to run it on a > machine (such as a cluster node) that does not have a windowing system. If I > try to avoid creating the window by simply removing the call to > GLUTCreateWindow() (which can be done in this test program by removing the > #define CREATEWINDOW) then the program immediately fails with an access > violation when glutMainLoop() is called. > > Is it even possible to use GLUT without creating an actual window, and if so > how? No, I don't think that's possible. I seem to recall that GLUT should issue an error message if you try to enter the main loop without creating a window. > (It is possible that the only way to do this would be to modify the GLUT > libraries that come with Mesa. If that is the case, then I would be willing > to submit any modifications I make back to the Mesa project so that other > users who desire the same functionality could use it.) I guess what I'm wondering is this: why make any GLUT calls at all if you're just going to use OSMesa to render to an off-screen buffer? -Brian |