using an object/texture on two screens

Started by
1 comment, last by knobby67 16 years ago
Hi all, I've written a model loader which works fine, however I've found that if I try to use the model on a second screen, I need to load it a second time. To explain in greater detail I load a 3ds model and texture from a file, I need to set the context of the screen using glXMakeCurrent(DisplayPointer, ScreenNumber1.win, ScreenNumber1.ctx); (I'm using linux glx) then load the model in. If I was to draw the model to a second screen I need to use glXMakeCurrent(DisplayPointer, ScreenNumber2.win, ScreenNumber2.ctx); and load the model again. Is there a way I can share a model between multiple screens in opengl, as it seems I have to load a model in twice. I'm using linux with glx, nvidia and using display lists. Thanks for the help :)
Advertisement
what you need is to share your display lists between 2 or more contexts. in Windows this is done with the wglShareLists commands. on Linus it appears to be done when you create your context: glXCreateNewContext
Thanks I think that's what I need, problem is all the descriptions of it I can find don't seem to give very much help on how to use it. The bits of code I can find, (to me) are almost unreadable. Can anyone point me in the direction of how to use it or to a tutorial?
The problem seems it calls all structures I never touch, I simply set up the screens then set the context with
glXMakeCurrent(DisplayPointer, screen->win, screen->ctx);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(screen->background_colour->red, screen->background_colour->green,
screen->background_colour->blue, screen->background_colour->alpha);

then double buffer with

glXSwapBuffers(DisplayPointer, screen->win);

Thanks

This topic is closed to new replies.

Advertisement