Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: where glTexImage2D loading the image

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2013
    Posts
    6

    Exclamation where glTexImage2D loading the image

    Hi all, thanks in advance for the answers.
    My question is where glTexImage2D loading the image?
    because if I make a simple program with a window and with all the code in one file a link to this memory function, instead
    if I am using 2 windows made ​​sdl and move the stuff of texture transform it into a class and put it into another file does not work anymore?
    It may also depend on the mode multi-thread in Visual Studio?

    PS: sorry for my english.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    If you are using 2 windows each with its own OpenGL device context, the image is available in the device context current at the time you load the image. It is also possible to create a shared device context (separate to the window device context) that both windows can use. You make this context current when you load the image; now both windows can use the image.

  3. #3
    Intern Contributor
    Join Date
    May 2013
    Posts
    65
    If you use shared context make sure that the opengl objects are ready to be used before the other thread touches them! e.g. after loading an image with glTexImage2D call glFinish or use a fence before signaling the other thread that the texture can be used.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •