Jump to content
  • Advertisement
Sign in to follow this  
knobby67

OpenGL using an object/texture on two screens

This topic is 3827 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!