Advertisement

multi windows?

Started by June 14, 2003 05:51 AM
4 comments, last by gameviet 21 years, 8 months ago
How to create multi windows with nehe source code?When I made multi windows in my application, there was only window can display what I want it to draw?Could any one help me?
Do you have a clue about the way OpenGL initialisation Work ? and do you know Win32 API ?
If you do and still can''t find out, you got a serious problem
if you don''t, they to learn it first
(you can find me on IRC : #opengl on undernet)
Advertisement
Take a look at the hWnd... It''s the handle to a window. So if you have 2 windows, you''ll have 2 hwnd''s. Next up: create openGL 2x, using the first hwnd for the first opengl, and the 2nd hwnd for the 2nd opengl... that should be it..
Also you will need to make a call to wglMakeCurrent each frame, to select the OpenGL context for the current window, render 1st scene. then call wglMakeCurrent for the second context, render 2nd scene and repeat.

You basically need to call the initialisation code twice to obtain two hdc's and two GLHRC's(one for each window)

EDIT: note you will also need to call swapbuffers after rendering each scene, for the appropriate hdc.

James

[edited by - jamessharpe on June 14, 2003 2:48:42 PM]
How much does that slow things down?
Is something like this possible in GLUT?

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.

This topic is closed to new replies.

Advertisement