Archived

This topic is now archived and is closed to further replies.

glGreenhorn

multiple glwindows

Recommended Posts

glGreenhorn    122
hey just out of curiosity... is it possible to create multiple simultaneously running glwindows (eg use them like the UT map editor uses D3D in perspective view)? moreover, is it possible to project a glscene onto eg a dialog box or a Win32 control? keep cool

Share this post


Link to post
Share on other sites
EC_ToASter    122
Yes, both is possible.
to the first one: you have to save some DC''s and RC''s (for every one window you want), actually i haven''t tested it in VC6 but i did something in Delphi5, here''s the code for switchin the windows:

wglMakeCurrent(getDC(ViewPort.Handle),ViewPorts_Stat[ID].RC);

ViewPort is a simple TPanel and in ViewPorts_Stat[ID].RC i saved the RenderingContext of this specific window
you get the RC with:

ViewPorts_Stat[ID].RC:=CreateRenderingContext(getDC(ViewPort.Handle),[opDoubleBuffered],0,0,0,0,0);
ActivateRenderingContext(getDC(ViewPort.Handle),ViewPorts_Stat[ID].RC);

to the second one: you can turn everything into an GLwindow, as long as you can get the DC of this object

Share this post


Link to post
Share on other sites