<div dir="ltr"><div>I noticed that gfx_directx's window.cpp has a function named Window::centerWindow() but when I tried to use it to implement gfx_recenter_window_hint it did not seem to actually do anything.<br><br>---<br></div>James<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 28, 2016 at 6:27 AM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The trick of quitting and reiniting the video subsystem was already<br>
using on OSX.<br>
<br>
Anyway, that was the easy bug. More complex was the bug that puts the<br>
window completely off the top-left of the screen if the resolution is<br>
low (happened on both X11/Linux and Windows) and in general doesn't<br>
center it if it's not 320x200. I fixed that by painfully trying every<br>
combination of resolution and scale changes when entering and quitting<br>
a game or exiting or leaving the graphics editors in Custom against<br>
many combinations of possible calls into the backend. The fundamental<br>
reason for these problems is that all the resolution and scaling stuff<br>
is an absolute mess; it's given to the gfx backend through multiple<br>
calls. We need to add a new gfx API call to set the window resolution<br>
and size. The backend learns about page size changes through<br>
gfx_showpage, scale changes through gfx_setoption, requests for<br>
recentering through gfx_recenter_window_hint which affects the next<br>
call to gfx_sdl_set_screen_mode, and several other gfx_* calls have<br>
the side effect of calling gfx_sdl_set_screen_mode, like<br>
set_safe_zone_margin. The latter was the main reason for the bug.<br>
<div class="HOEnZb"><div class="h5"><br>
On 28 February 2016 at 23:22, Ralph Versteegen <<a href="mailto:teeemcee@gmail.com">teeemcee@gmail.com</a>> wrote:<br>
> I thought you meant in gfx_directx (gfx_recenter_window_hint isn't<br>
> implemented in it), but I see it doesn't work with gfx_sdl on Windows<br>
> either. Some fiddling around reveals that under Windows,<br>
> SDL_SetVideoMode only repositions the window when something, eg.<br>
> window size, is changed from the previous settings.<br>
><br>
> On 27 February 2016 at 09:20, James Paige <<a href="mailto:Bob@hamsterrepublic.com">Bob@hamsterrepublic.com</a>> wrote:<br>
>> Actually, I take that back... this only seems to fix the bug on Linux, not<br>
>> on Windows<br>
>><br>
>><br>
>> On Fri, Feb 26, 2016 at 12:18 PM, <<a href="mailto:subversion@hamsterrepublic.com">subversion@hamsterrepublic.com</a>> wrote:<br>
>>><br>
>>> james<br>
>>> 2016-02-26 12:18:31 -0800 (Fri, 26 Feb 2016)<br>
>>> 263<br>
>>> gfx_recenter_window_hint() was not being called when the window was<br>
>>> scaled, only when the game had a resolution other than 320x200<br>
>>> Fixed the bug where for most games, the window was being centered at 50%<br>
>>> and then resized to 80% without moving the top left corner<br>
>>> ---<br>
>>> U wip/yetmore2.bas<br>
>>> _______________________________________________<br>
>>> Ohrrpgce mailing list<br>
>>> <a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.org</a><br>
>>> <a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Ohrrpgce mailing list<br>
>> <a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.org</a><br>
>> <a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
>><br>
_______________________________________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org">ohrrpgce@lists.motherhamster.org</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org</a><br>
</div></div></blockquote></div><br></div>