Multiple Rendering Windows
Suppose I am doing an MMORPG, and I want to take great advantage of WINAPI interface, so I want to use one windows to be rendering the 3d world, where the character is, and another windows for character management(inventory, spells, skills, etc).
Since character management won''t need much 3d thing, I could do it in plain GDI, but I want to use OpenGL on both windows. How could I manage to do that?
I mean, "OpenGL is a state machine", so I think about doing this:
-Select one dc(or rc, dont know how exactly) for the main window
-glViewPort(..);
-glClear(...);
-Draw the ingame world
-swap buffer;
-Select the dc for the other window
-glViewPort(...);
-glClear(...);
-Draw the management things
But I was wondering how much fps I would get in the main window and the sincronization, this seems to be a very cpu consuming solution. Would apreciate some ideas and/or links to tutorials about this.
----------------------------I would rather burn dollars than USA flags... but they are too expensive!
I''m writing an OpenGL-based app which is using OpenGL both for the document rendering, and for a few of the more funky controls.
OpenGL was originally designed as a client/server thing (for X11) and so, it''s meant to happily handle more than one active context.
My thing runs fine. A better example would be WorldCraft, the HL editor - it uses OpenGL for all 4 view windows and works fine.
Bear in mind that you can have one context active per thread - this means that if you were to create a seperate thread for each window, you could have all the contexts selected in at once. But to be honest, it''s easier to work single-threaded.
But yeah, that''s really not CPU consuming at all.
Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
OpenGL was originally designed as a client/server thing (for X11) and so, it''s meant to happily handle more than one active context.
My thing runs fine. A better example would be WorldCraft, the HL editor - it uses OpenGL for all 4 view windows and works fine.
Bear in mind that you can have one context active per thread - this means that if you were to create a seperate thread for each window, you could have all the contexts selected in at once. But to be honest, it''s easier to work single-threaded.
But yeah, that''s really not CPU consuming at all.
Superpig
- saving pigs from untimely fates, and when he''s not doing that, runs The Binary Refinery.
Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement