Skip to main content
GameDev.net gamedev.net
🔒 Locked

Multithreading win32

Started by __tunjin__ Oct 28, 2002 at 2:30 AM 4 replies 600+ views
Original Post
__tunjin__
__tunjin__
Does anyone know a nice doc about opengl and multithreading on win32? My problem is the following: * my main process creates a window / dc / glrc * sometimes another thread needs to draw into the same window. Now simply calling wglMakeCurrent() with the dc/glrc of the main process does not work... * i used google , but didn''t find a whole lot except for some newsgroup posts that were not that helpful any ideas / hints?
Andrew Russell
Andrew Russell
It is not posible to use OpenGL accross threads.

The only way of doing OGL in a multithreaded app is if only one thread does the OGL stuff.

Can''t be done any other way.

Do not meddle in the affairs of moderators, for they are subtle and quick to anger.


ANDREW RUSSELL STUDIOS
Cool Links :: [ GD | TG | MS | NeHe | PA | SA | M&S | TA | LiT | H*R ]
Got Clue? :: [ Start Here! | Google | MSDN | GameDev.net Reference | OGL v D3D | File Formats | Go FAQ yourself ]

Dean Harding
Dean Harding
Just further to what Andrew said, each GLRC is associated with a single thread. You can have multiple threads using multiple GLRCs, or multiple GLRCs in one thread, but not multiple threads using one GLRC.

If I had my way, I''d have all of you shot!


codeka.com - Just click it.

__tunjin__
__tunjin__
now would it be possible to create the multiple rc''s for each thread from the same hdc?
niyaw
niyaw
would it be too hard to try that out?
__tunjin__
__tunjin__
stuck here without a compiler - want to save myself some time when i get home ;-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.