[Ohrrpgce] SVN: james/7725 gfx_recenter_window_hint() was not being called when the window was scal

James Paige Bob at HamsterRepublic.com
Mon Feb 29 07:20:39 PST 2016


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.

---
James

On Sun, Feb 28, 2016 at 6:27 AM, Ralph Versteegen <teeemcee at gmail.com>
wrote:

> The trick of quitting and reiniting the video subsystem was already
> using on OSX.
>
> Anyway, that was the easy bug. More complex was the bug that puts the
> window completely off the top-left of the screen if the resolution is
> low (happened on both X11/Linux and Windows) and in general doesn't
> center it if it's not 320x200. I fixed that by painfully trying every
> combination of resolution and scale changes when entering and quitting
> a game or exiting or leaving the graphics editors in Custom against
> many combinations of possible calls into the backend. The fundamental
> reason for these problems is that all the resolution and scaling stuff
> is an absolute mess; it's given to the gfx backend through multiple
> calls. We need to add a new gfx API call to set the window resolution
> and size. The backend learns about page size changes through
> gfx_showpage, scale changes through gfx_setoption, requests for
> recentering through gfx_recenter_window_hint which affects the next
> call to gfx_sdl_set_screen_mode, and several other gfx_* calls have
> the side effect of calling gfx_sdl_set_screen_mode, like
> set_safe_zone_margin. The latter was the main reason for the bug.
>
> On 28 February 2016 at 23:22, Ralph Versteegen <teeemcee at gmail.com> wrote:
> > I thought you meant in gfx_directx (gfx_recenter_window_hint isn't
> > implemented in it), but I see it doesn't work with gfx_sdl on Windows
> > either. Some fiddling around reveals that under Windows,
> > SDL_SetVideoMode only repositions the window when something, eg.
> > window size, is changed from the previous settings.
> >
> > On 27 February 2016 at 09:20, James Paige <Bob at hamsterrepublic.com>
> wrote:
> >> Actually, I take that back... this only seems to fix the bug on Linux,
> not
> >> on Windows
> >>
> >>
> >> On Fri, Feb 26, 2016 at 12:18 PM, <subversion at hamsterrepublic.com>
> wrote:
> >>>
> >>> james
> >>> 2016-02-26 12:18:31 -0800 (Fri, 26 Feb 2016)
> >>> 263
> >>> gfx_recenter_window_hint() was not being called when the window was
> >>> scaled, only when the game had a resolution other than 320x200
> >>> Fixed the bug where for most games, the window was being centered at
> 50%
> >>> and then resized to 80% without moving the top left corner
> >>> ---
> >>> U   wip/yetmore2.bas
> >>> _______________________________________________
> >>> Ohrrpgce mailing list
> >>> ohrrpgce at lists.motherhamster.org
> >>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> >>
> >>
> >>
> >> _______________________________________________
> >> Ohrrpgce mailing list
> >> ohrrpgce at lists.motherhamster.org
> >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> >>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20160229/73581670/attachment.htm>


More information about the Ohrrpgce mailing list