Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Drawing from different threads in OpenGL

Drawing from different threads in OpenGL

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsgame-devdata-structuresquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RichardS
    wrote on last edited by
    #1

    Hi, I have created an OpenGL window and can draw on it fine in the same thread as the one that created the window and processes the message queue. If I move the gl code to another thread, it does not draw anymore. Does anyone know if this is possible? thanks, Rich

    "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook

    D 1 Reply Last reply
    0
    • R RichardS

      Hi, I have created an OpenGL window and can draw on it fine in the same thread as the one that created the window and processes the message queue. If I move the gl code to another thread, it does not draw anymore. Does anyone know if this is possible? thanks, Rich

      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook

      D Offline
      D Offline
      Dexterus
      wrote on last edited by
      #2

      From what I've read in every place I've seen, this doesn't really work, as in drawing from one thread into another thread's hwnd, at least it's not supposed to be done that way. And from my own attempts to do it before I read it windows handles got quite mixed up in the process and nice amount of asserts in MFC code. But as I wrote this was basic MFC app and cannot vouch it is totally true for you. Basicly what you would do is do the work in a thread and message the window owner to do the drawing with the params you calced.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups