PDA

View Full Version : Multiple Windows...



McZ
09-10-2002, 11:49 PM
how to use multiple windows? I have created an editor that will use 4 windows top,left,front,camera and I use one thread for each view.. the problem is that when I start the editor I have told it to load one object to render it.. and then it only render the object in one view.. it is like when one thread get it's hands on the rendering contex it wont let it go even though I have told it to render the objectt once and then wait for redraw state

pATChes11
09-12-2002, 10:33 AM
Pass your GL rendering context handle to each of your threads, and use glSelectRC() (or something like that, I don't remember) to select it when the thread starts. Then you can set your viewport and scissor (or whatever it all is... it's been so long!) to render to each window. The only problem I can think of is if one thread starts drawing while another is sending up a list of vertices. A better idea would be to have a separate thread that handles the rendering with a FIFO-style buffering system. Use an array of structures describing each "job," and store your read and write positions for that in persistent variables. Using a class would be a good idea.

Jlh
09-12-2002, 06:08 PM
It need't use muti-threads.
The problem that you can't render many windows is RC only one.So you must release your RC whenever a window's rendering has finished.And you must get your RC before rendering a window.If you need it,you can email to me.I will give you an article about it.

Jlh
09-12-2002, 06:30 PM
It need't use muti-threads.
The problem that you can't render many windows is RC only one.So you must release your RC whenever a window's rendering has finished.And you must get your RC before rendering a window.If you need it,you can email to me.I will give you an article about it.