Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DalTXColtsFan

glTexImage2D depends on wglMakeCurrent?

This topic is 5574 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

Greetings all, I''m working on a rudimentary modelling tool in MFC just for a learning experience. It''s still in very infantile stages. I have a splitter view where one side is a tabbed dialog and the other is the OpenGL view, and each tab is either a light, the rectangles, prism, spheres, and textures. On the texture tab you browse to your .bmp files and it displays a preview. I was too lazy to look up how to take general data and map it to a child window, so I just made the child window an OpenGL context and just drew it in ortho mode. Something really strange then happened. The first texture in the preview window was always blank, but subsequent textures always appeared. Then went I went to apply the textures to my prisms, and only one of the textures would appear in the main window! This seems totally insane, but it seems like whichever of the contexts was most recently set with wglMakeCurrent was the only one "receiving" the texture - I was so fascinated by this that I gave my texture class two IDs - one for the preview and one for the main window, and just loaded it into GL twice. I most certainly won''t code it that way going forward but it''s sure an interesting phenomenon! If anyone would like to see this effect in action I''ve uploaded the infantile code to my page (see my sig). Has anyone else ever encountered this??? Is it by design or am I doing something wrong? Thanks Joe Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
This is the way it is meant to be. Textures are only valid for the context in which they are bound.
You can share textures and display lists etc across different contexts by using wglShareLists.

Share this post


Link to post
Share on other sites

  • 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!