Not logged inOpenClonk Forum
Up Topic Development / Developer's Corner / [Patch] windowed mode on win32
- - By Isilkor Date 2009-10-23 02:58 Edited 2009-11-01 12:19
Attached patch enables windowed mode on win32. Since this is a non-trivial change, I'd like a review by another dev.

[Note] Pushed as a48f0f723e08
Reply
Parent - - By Carli [de] Date 2009-10-23 06:57
seems to me like it does not work for GL, but i cannot test it under linux..... does it work?
Parent - By Isilkor Date 2009-10-23 07:29
It does; GL didn't actually need any changes (except having the window send size changes to the renderer), since it already implemented OnResolutionChanged.
Reply
Parent - - By Günther [de] Date 2009-10-23 12:12
There's a FIXME in the patch ;-)

Apparently the window isn't resizable by the player. That's unnecessary. We might want to optimize C4GraphicsResource::LoadCursorGfx so that it doesn't load the cursors every time, but otherwise there's no reason to forbid that feature.
Reply
Parent - - By Isilkor Date 2009-10-23 12:21

> There's a FIXME in the patch ;-)


Yes, but it's "just" a performance issue.

> Apparently the window isn't resizable by the player. That's unnecessary.


It should be resizable; the window has WS_THICKFRAME and in my tests, resizing works and resizes the render area.
Reply
Parent - By Günther [de] Date 2009-10-23 12:51

> It should be resizable; the window has WS_THICKFRAME and in my tests, resizing works and resizes the render area.


Okay, I just was confused from the SIZE_RESTORED and SWP_NOMOVE tokens.
Reply
Parent - - By Newton [de] Date 2009-10-23 14:30
Is this a bug in tortoiseMerge or am I doing it wrong?: After I press OK, nothing happens.

I hereby license the following file(s) under the CC-by license
Parent - By Isilkor Date 2009-10-23 14:41
I don't know how to do this with Tortoise, but you should be able to apply the patch by using $ hg import openclonk-daf1795462c3.patch.
Reply
Parent - By Newton [de] Date 2009-11-01 13:28 Edited 2009-11-01 13:36
Now I tested the patch:

2>..\src\C4FullScreen.cpp(131) : error C2065: 'FALSE': nichtdeklarierter Bezeichner
2>..\src\C4FullScreen.cpp(139) : error C2065: 'TRUE': nichtdeklarierter Bezeichner

replaced TRUE and FALSE with true, false, then compiling worked. But for me (Windows Vista Business SP2, VC++, OpenGL), it looks completely broken (even a bit more broken than in linux). Attached are some screenshots...

(First screenshot: resolution was... 800x600)

Edit:
It looks like I tested it "just in time". One hour after you finally pushed it. Hmpf.
Parent - - By Lasdem [at] Date 2009-11-05 11:12 Edited 2009-11-05 12:52
I tested window mode on my System now and i don't get any frame border.
I think its some compatibility issue with windows seven.

System:
Windows Seven Professional 32-bit
Visual Studio 2008 Express SP1

PS: how do i attach images?
Parent - - By Isilkor Date 2009-11-05 12:50

> I tested window mode on my System now and i don't get any frame border.
> I think its some compatibility issue with windows seven.


No, that's a hack to avoid rendering bugs with OpenGL when changing from fullscreen to windowed mode or vice versa. If you need a window border on Win32, you currently have to use DirectX. This may change in the future.

> PS: how do i attach images?


You can attach pictures after you've posted, you should have an "attach" button below your post then.
Reply
Parent - - By Sven2 [de] Date 2009-11-05 13:47
By the way: How does Torque do it? I remember you could switch windowed/fullscreen just fine in Torque.
Parent - By Isilkor Date 2009-11-05 14:30
I don't have a clue. Maybe they recreate the GL context.
Reply
Up Topic Development / Developer's Corner / [Patch] windowed mode on win32

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill