Jump to content
  • Advertisement


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


glTexImage2D depends on wglMakeCurrent?

This topic is 5658 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
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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!