Click to See Complete Forum and Search --> : Device & Rendering Context


hannibar
December 15th, 2005, 03:10 PM
I'm making an app which opens multiple windows at the same time. In all windows I want to draw using openGL. This works mostly, but I don't understand a few things though. I've searched on the msdn, but I couldn't get a straight and understandable answer to my questions. So I hope someone here could help me.

1) Do I have to make 1 rendering context for all windows ?
2) Do I have to make 1 device context for all windows ?

Or 1 DC and RC for each window ?

Thanks in advance.

kirants
December 15th, 2005, 03:26 PM
OO way would be to use seperate DCs for each window.
I don't know about RCs.

Mike Harnad
December 15th, 2005, 04:06 PM
A rendering context (rc) is associated with a dc. If all of your windows have the same pixel format (they probably do), then you can define one rendering context and use it with each dc that represents a window. You'll need to use wglMakeCurrent() to do the association.

hannibar
December 16th, 2005, 04:42 AM
Thanks for the help. I've got it working.

Marc G
December 16th, 2005, 07:07 AM
[ moved thread ]