PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Fullscreen/windowed switching (Win32 desktop pc)

Hi EdgeLib Team,

Our newest game needs to be run at fullscreen and windowed mode on desktop PCs as well - and switching between these modes must be done on-the-fly without restarting the app.

You mentioned in an earlier post that an "unofficial" hack might solve the problem:

1. ecd.dsp->Close();
2. ecd.dsp->Open(wnd, &ecd;, ecd.cfg->videotype, res_x, res_y, true);

However, this syntax of Open() does not work anymore in Edge V3.5 (The new syntax refers to two inaccessible ECOREOBJ params).

Falling back to Edge V2.95 *almost works* if used with this hack:

1. Init Edge in Windowed mode
2. on display mode change, shut down Edge video render:
Code:
ecd.dsp->Close();

3. switch to fullscreen:
Code:
ChangeDisplaySettings(&dmScreenSettings;, CDS_FULLSCREEN);

4. change window style to popup:
Code:
SetWindowLong( wnd, GWL_STYLE, WS_POPUP | WS_VISIBLE );

5. restart Edge video render:
Code:
ecd.dsp->Open(wnd, &ecd;, ecd.cfg->videotype, res_x, res_y, true);


There is a side-effect, however: even after the window style change, Edge seems to render the graphics off-position within the window. It seems that Edge still calculates the width/height of invisible window caption and borders to the render output.


So, our question is the following:

a.) Ideally, does Edge V3.5/V3.6 address the dynamic screen mode change issue in a safer, hack-free way?
b.) Less ideally, can we use the aforementioned hack in Edge V3.5/V3.6? If yes, how can we use ecd.dsp->Open() 's new syntax? (We assume the two params are the window instance handle and a window style constant...)
c.) Sticking to Edge V2.95, can we re-set Edge's internal render coords after a window style change?


Thank you in advance,

Regards,
Laszlo

PS: Keep up the excellent work on Edge.
Hi Laszlo,

There is no function of ClassEDisplay yet that changes the display mode. Also, the parameters to ClassEDisplay::Open are internal EDGELIB objects, you can't typecast window handles or other Win32 objects to the function unfortunately.

The best way to currently handle this is to make your main class friend of ClassEdge. Then pass the instance and windowstyle objects of the ClassEdge to ClassEDisplay::Open.
Thanks for the tip, we'll try it out!

Regards,
Laszlo