Results 1 to 2 of 2

Thread: glTexImage2D depends on wglMakeCurrent?

  1. #1
    Member Contributor
    Join Date
    Jan 2001
    Location
    Irving TX USA
    Posts
    58

    glTexImage2D depends on wglMakeCurrent?

    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 (daltxcoltsfan.tripod.com/OpenGL/OpenGL.htm).

    Has anyone else ever encountered this??? Is it by design or am I doing something wrong?

    Thanks
    Joe

  2. #2
    Member Contributor
    Join Date
    Mar 2003
    Location
    Suffolk, United Kingdom
    Posts
    99

    Re: glTexImage2D depends on wglMakeCurrent?

    It's by design.

    Unless you use wglShareLists(), each rendering context will have its own texture objects.

Similar Threads

  1. Simulation speed depends on load
    By TheDestroyer in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-18-2011, 10:49 AM
  2. size of screen depends on what?
    By somnath in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-24-2011, 07:45 AM
  3. 3D-Texturing depends on hardware ???
    By Mahdy in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 04-06-2001, 11:47 PM
  4. Strange behavior... It depends by the compiler?
    By Teofuzz in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-08-2001, 03:13 PM
  5. My life depends on this But not really hah hah ..........
    By Na2uRITS in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-18-2000, 10:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean