Closed avdept closed 5 years ago
@avdept What hardware/OS are you using? Are you using a non-default scaling/resolution? I don't have this issue on my Macbook Pro with Mojave (on the current dev build anyway). On launch, it should be defaulting to full-screen. Does Alt-Enter set it to a window that works for you?
Retina mbp 15* 2017, default resolution, Mojave with latest updates built from sources without any changes - git clone -> ./configure -> make -> make install -> SKDATA=data 7kaa
. Here's screenshot of window mode, however for full screen getting the same
The only difference, I had to put libintl.h
(found it in my UE4 sources) inside include
, otherwise it would compain about missing header file(I have all prerequisites installed)
I had that same issue with libintl.h
... just a symlink issue with the package for some reason.
I've read elsewhere that there are some issues with how macOS does its scaling internally but hopefully @the3dfxdude has an idea. You may have to tinker with the SDL window's flags to get HiDPI support working correctly.
Please send me a copy of the file SDL_GetPrefPath()/sdl.txt. This will tell us your display DPI. Although I'm pretty sure since you have Retina, it is high DPI.
Then try setting the SDL Hint to turn off whatever MacOS does for high DPI: https://wiki.libsdl.org/SDL_HINT_VIDEO_HIGHDPI_DISABLED
Here's sdl.txt
=== Seven Kingdoms 2.15.0 ===
Platform: Mac OS X
Little endian
Current SDL video driver: (null)
SDL version: 2.0.8
Compiled SDL version: 2.0.8
-- Video drivers --
0: cocoa
1: dummy
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer metal (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (2) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
Here's what I added, but recompiling didn't help
A little different from my sdl.txt:
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: (null)
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
What about adding SDL_WINDOW_ALLOW_HIGHDPI
to SDL_CreateWindowAndRenderer in OVGA?
Neither of your sdl.txt reports have current display or current window information. Sraboy, can you look at why? Knowing what is returned for the current display and current window will be a helpful clue to know what is happening.
Also see the note on the SDL Hint: On Apple's OS X you must set the NSHighResolutionCapable Info.plist property to YES, otherwise you will not receive a High DPI OpenGL display.
The exact combination to use of the hint, window flag and app setting needs to be revealed since it is not clear straight from the documentation.
I'll see if I can figure out the sdl.txt thing.
I want to note, though, that my display works correctly whether or not I run the executable itself or the app
package, and the package's plist
doesn't have NSHighResolutionCapable
.
@sraboy Tried to use flag like
if (SDL_CreateWindowAndRenderer(window_width,
window_height,
SDL_WINDOW_ALLOW_HIGHDPI,
&window,
&renderer) < 0)
{
ERR("Could not create window and renderer: %s\n", SDL_GetError());
return 0;
}
but still the same result here.
So I'm not sure how/why that sdl.txt
earlier was created but sys.dir_config
wasn't even set so the file wasn't being created like it should be. I just hacked in a hardcoded path to get this:
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1440x900 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Input grabbed: yes
-- Current renderer: opengl --
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7f9539824ad0
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
@avdept, try setting path
(here) to some known-good path and see if you get the window & renderer info.
Sraboy, you don't have a high dpi display. My guess is the OS does not do scaling on your monitor by default.
Note, plist with NSHighResolutionCapable should be tried with the window flag. Otherwise the OS does not honor it based on my reading, just like on windows.
Any chance to get 2.15.1 7kaa binary file? Does not seem like I can build it. Some error with gettext package. 2.15.0 is slighty different in VGA code
avdept, use --configure --disable-nls.
Finally fixed. So my solution was pretty simple
if (SDL_CreateWindowAndRenderer(window_width,
window_height,
SDL_WINDOW_ALLOW_HIGHDPI,
&window,
&renderer) < 0)
{
ERR("Could not create window and renderer: %s\n", SDL_GetError());
return 0;
}
Had to pass SDL_WINDOW_ALLOW_HIGHDPI
into CreateWindow
function. Now seems to be working just fine. DO we want to have this in code base, or keep it as local fix only? Unfortunatelly I can't check it against other configurations
On mobile now but I can test this in my three environments in the next few days.
Found issue, when using flag above - mouse cursor can't reach left part of screen, hence map scrolling to left wont work, and you wont be able to open Peace threaty(and other messages) offers. Looks like some mouse bounds issue
@the3dfxdude Regarding
use --configure --disable-nls.
Using this flag app wont compile due to errors like
OGAMEMP.cpp:5494:14: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'const char *'
str.catf(ngettext("while now there is %d human player.",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found issue, when using flag above - mouse cursor can't reach left part of screen, hence map scrolling to left wont work, and you wont be able to open Peace threaty(and other messages) offers. Looks like some mouse bounds issue
Can you run the game and exit, and then get a proper sdl.txt with the current display and window information?
use --configure --disable-nls.
Using this flag app wont compile due to errors like
Can you share the compile command for OGAMEMP.cpp?
@the3dfxdude sdl.txt dump
=== Seven Kingdoms 2.15.0 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.8
Compiled SDL version: 2.0.8
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1680x1050 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Input grabbed: yes
-- Current renderer: opengl --
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1680x1050x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fef26e19600
DPI: diag=129.000000 horiz=129.000000 vert=129.000000
Bounds: x=0 y=0 w=1680 h=1050
Usable bounds: x=0 y=0 w=1680 h=1050
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer metal (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (2) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
avdept, You are on 2.15.0. Please update to the latest version, because there were fixes dealing with the window resizing and mouse bounding.
@the3dfxdude Getting same on 2.15.1
@avdept You could also check out your gettext
install to make sure it's linked. I forget exactly what I had to go through but it took me an hour of messing around with the symlinks to get everything working properly (without --disable-nls
which I've never tried):
$ brew link gettext --dry-run
Warning: Already linked: /usr/local/Cellar/gettext/0.19.8.1
To relink: brew unlink gettext && brew link --force gettext
@the3dfxdude I can confirm the same mouse issue on 2.15.2. The cursor is unable to move all the way to the left with SDL_WINDOW_ALLOW_HIGHDPI
on. However, the trackpad scrolling works fine (windowed). Here's the sdl.txt
when I added the SDL_WINDOW_ALLOW_HIGHDPI
option and left it in fullscreen:
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1440x900 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Input grabbed: yes
-- Current renderer: opengl --
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fc9ad502930
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
Please download and test with the latest master. I added more renderer information to sdl.txt.
-- Current window -- Active on display: 0 Geometry: 1280x1024 @ (0, 0) Pixel format: SDL_PIXELFORMAT_RGB888 Full screen: yes Input grabbed: yes
-- Current renderer: opengl -- Viewport: x=0,y=20,w=800,h=600 Scale: xscale=1.600000,yscale=1.600000 Logical size: w=800, h=600 Capabilities: hardware accelerated V-sync: off Rendering to texture supported: yes
Please try the hot-keys of CTRL-G (mouse grab) and CTRL-M (mouse driver style) in multiple combinations along with window and non-window mode. Please show me the renderer information (and if windowed or not) when the problem occurs, and when the problem is gone.
Also set the Vga window_height and window_width to 800x600 for window mode.
The idea behind this is to determine if this is caused by the OS feeding incorrect information to the game when it is tracking the mouse movement. Also please check NSHighResolutionCapable and the SDL hint setting in greater detail to find out what they do.
Added SDL_WINDOW_ALLOW_HIGHDPI
. All these are based on launching the 'raw' binary, not the APP package, so no plist
tinkering.
BLUF: Only windowed mode with CTRL-G (bottom) works with edge scrolling. Fullscreen with CTRL-G works with touchpad scrolling. Some details below.
Problem: No change.
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1440x900 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Full screen: yes
Input grabbed: yes
-- Current renderer: opengl --
Viewport: x=80,y=0,w=800,h=600
Scale: xscale=1.500000,yscale=1.500000
Logical size: w=800, h=600
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fc31ac486c0
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
Problem: Mouse just disappears off-screen, no edge scrolling. Touchpad scrolling works.
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1440x900 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Full screen: yes
Input grabbed: no
-- Current renderer: opengl --
Viewport: x=80,y=0,w=800,h=600
Scale: xscale=3.000000,yscale=3.000000
Logical size: w=800, h=600
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fe83674ad60
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
Problem: No longer have a weird indented edge but still no scrolling. Touchpad scrolling okay.
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 800x600 @ (320, 150)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Full screen: no
Input grabbed: no
-- Current renderer: opengl --
Viewport: x=0,y=0,w=800,h=600
Scale: xscale=2.000000,yscale=2.000000
Logical size: w=800, h=600
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fb559f19110
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
Problem: Resolved. As expected, no touchpad scrolling.
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 800x600 @ (320, 150)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Full screen: no
Input grabbed: yes
-- Current renderer: opengl --
Viewport: x=0,y=0,w=800,h=600
Scale: xscale=2.000000,yscale=2.000000
Logical size: w=800, h=600
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fa35fd2d000
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
All the behavior was the same with NSHighResolutionCapable
until I then set "Open in Low Resolution" in the package's info (right-click on the APP>Get Info>check the box).
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1440x900 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Full screen: yes
Input grabbed: yes
-- Current renderer: opengl --
Viewport: x=80,y=0,w=800,h=600
Scale: xscale=1.500000,yscale=1.500000
Logical size: w=800, h=600
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x600000638790
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
With grab off, edge scrolling is really hard to do anyway. So the detect is disabled with grab off in the code. It's best to turn on grab when you want it.
The most telling test is the windowed 800x600 with grab on working as you expect. This means mouse cursor is not in sync with the OS's cursor, a window event issue, or the OS is lying about something. Have you tried going between window and back to fullscreen and does it resolve the issue?
Just to be sure, is the same issue existing when you revert the touch pad scrolling?
Back to the 'raw binary'... removing the mouse wheel and touchpad stuff didn't seem to have an effect but I did finally get it working in fullscreen. I have yet to duplicate it in any kind of deterministic way but some combination of CTRL-M, CTRL-G and switching between window/fullscreen eventually removes that invisible wall on the left and allows me to edge-scroll normally.
Here's the sdl.txt from that:
=== Seven Kingdoms 2.15.2 ===
Platform: Mac OS X
Little endian
Current SDL video driver: cocoa
SDL version: 2.0.9
Compiled SDL version: 2.0.9
-- Video drivers --
0: cocoa
1: dummy
-- Current window --
Active on display: 0
Geometry: 1440x900 @ (0, 0)
Pixel format: SDL_PIXELFORMAT_ARGB8888
Full screen: yes
Input grabbed: yes
-- Current renderer: opengl --
Viewport: x=80,y=0,w=800,h=600
Scale: xscale=3.000000,yscale=3.000000
Logical size: w=800, h=600
Capabilities: hardware accelerated
V-sync: off
Rendering to texture supported: yes
Maximum texture size: 16384x16384
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
SDL_PIXELFORMAT_UYVY
-- Streaming texture --
Size: 800x600
Pixel format: SDL_PIXELFORMAT_ARGB8888
-- Display 0 --
Mode: 1440x900x32bpp 60Hz format=SDL_PIXELFORMAT_ARGB8888 driver=0x7fb4d4426ed0
DPI: diag=110.500000 horiz=110.500000 vert=110.500000
Bounds: x=0 y=0 w=1440 h=900
Usable bounds: x=0 y=0 w=1440 h=900
-- Renderer opengl (0) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
-- Renderer opengles2 (1) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
-- Renderer metal (2) --
Capabilities: hardware accelerated
V-sync capable: on
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_YV12
SDL_PIXELFORMAT_IYUV
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_NV21
-- Renderer software (3) --
Capabilities: software fallback
V-sync capable: off
Rendering to texture supported: yes
Pixel formats:
SDL_PIXELFORMAT_ARGB8888
SDL_PIXELFORMAT_ABGR8888
SDL_PIXELFORMAT_RGBA8888
SDL_PIXELFORMAT_BGRA8888
SDL_PIXELFORMAT_RGB888
SDL_PIXELFORMAT_BGR888
SDL_PIXELFORMAT_RGB565
SDL_PIXELFORMAT_RGB555
You can see the renderer is changing its scaling factor upon some triggering event. On window events, can you query the scaling values through a series of tests?
You're gonna have to point me in the right direction on that one... not even sure what APIs to grep for. Where are we catching window events?
Vga::handle_messages() ... SDL_PollEvent
In full screen, remaining in full screen:
First I hit CTRL-G. Then I move the mouse to the left, within the area normally blocked by that invisible barrier and hit CTRL-G again. It'll scroll for just a split second but once mouse movement is registered, my cursor gets "kicked out" and moved right, back past the invisible barrier. Mouse is/stays MOUSE_INPUT_ABS
.
However, if I do CTRL-G, CTRL-M, CTRL-G, then everything is fixed. Mouse is MOUSE_INPUT_REL_WARP
. Hitting CTRL-M again brings the invisible barrier back up. Hitting CTRL-G (twice) again brings the barrier back up. I have to go through the G-M-G process again. However, Cmd-Tabbing away (just like Alt-Tab on Win/Linux) at any point does not break the fix.
During these tests, the scale factor never changed, remaining at 3.0 the whole time.
Note: I've edited the above a few times as I've verified a few things.
Also, when I Cmd-Tab back to my terminal, I catch the leave/focus-lost events. Here's what it looks like while it's fixed/working correctly:
---------------- SDL_WINDOWEVENT ----------------
----- event: leave -----
Geometry: 1440x900 @ (0, 0)
Full screen: yes
Input grabbed: no
Mouse mode: MOUSE_INPUT_REL_WARP
-- Current renderer: opengl --
Viewport: x=80,y=0,w=800,h=600
Scale: xscale=3.000000,yscale=3.000000
Logical size: w=800, h=600
---------------- SDL_WINDOWEVENT ----------------
----- event: focusLost -----
Geometry: 1440x900 @ (0, 0)
Full screen: yes
Input grabbed: no
Mouse mode: MOUSE_INPUT_REL_WARP
-- Current renderer: opengl --
Viewport: x=80,y=0,w=800,h=600
Scale: xscale=3.000000,yscale=3.000000
Logical size: w=800, h=600
So MOUSE_INPUT_REL_WARP works, because we are using the mouse driver for the relative movement data. The mouse position is emulated inside the game, so it appears to break the barrier but it's just completely avoiding the problem.
In ABS mode, something is defining a grab barrier incorrectly, and I don't know for sure where it is coming from. You can turn off grab and it also works as you can see.
So the game's aspect ratio is 4:3 @ 800x600. Your screen's native resolution is 16:10. I noticed the viewport is being reported as starting at "x=80". If I multiply 80*3 = 240 and then subtract 240 from 1440, I am left with 1200x900, which is a 4:3 aspect ratio. Is the movement barrier approximately 240 or 80 pixels wide? Is the game screen centered with equal black bars (120 pixels) on each side in fullscreen mode?
So I think you'll want to be looking in handle_messages and tracking SDL_MOUSEMOTION in absolute mode. See the switch case implemented. You'll see the Vga class tracking the real mouse position and assisting the Mouse class in its virtual position. It handles the mouse grabbing by setting a boundary and keeping within the boundary. This boundary is important for edge scrolling and mouse drag. Also note that elsewhere SDL grab is still turned on and used, because we don't want to allow the OS to let the mouse fly out of the window or stolen for any reason, so there will always be that grab in effect even if the game's virtual boundary is off.
I suppose you could hack Mouse::process_mouse_motion() to ignore vga.is_input_grabbed() (checking permanently off) and see if the boundary problem is from SDL or the game. Note that Vga::update_boundary() is based on the physical window from SDL, and that will be still checked.
I hope that explains it a bit. Otherwise we might just need to go into a deeper dive.
Still tinkering but to answer your questions:
Is the movement barrier approximately 240 or 80 pixels wide? Is the game screen centered with equal black bars (120 pixels) on each side in fullscreen mode?
Yes and yes. Barrier is at: log_x: 80, real_x: 240
. With barrier removed, far left (at black bar) is: log_x: -80, real_x: 0
.
I suppose you could hack Mouse::process_mouse_motion() to ignore vga.is_input_grabbed() (checking permanently off) and see if the boundary problem is from SDL or the game.
No change in behavior.
Note that Vga::update_boundary() is based on the physical window from SDL, and that will be still checked.
Every call to this always results in both x
bounds being 0.0
.
Side note: I found this issue mentioned in a comment on an old issue when MOUSE_RELATIVE
was used.
I noticed something on the main menu screen. I hit CTRL-G to release grab and move the mouse beyond where the barrier was, then move back in, when the edge of the background is redrawn, it's redrawn at the wrong location:
I'm now limiting testing to the main menu screen since the issue is present there and we can completely ignore 90% of the code. The Mouse
boundaries are still 0 at this point (i.e., only Mouse::reset_boundary
is called) so they can be ignored.
The real culprit is the viewport's X value being set to 80 and I'm not sure how/why/where that's happening. The only place that's relevant right now is in Vga::update_boundary()
. This line uses the viewport to set bound_x1 = ((float)(mouse.bound_x1 + rect.x) * xscale);
. Simply removing + rect.x
here completely fixes the issue.
(Side note: The only float
here is the scale value so the cast is unnecessary.)
EDIT
Manually setting the viewport's x to 0 in Vga::set_full_screen_mode
results in the entire display being stretched (no more black bars). The boundary is obviously gone too but then windowed mode is just black.
So I'm not exactly sure what you mean by setting the viewport, since that is setting a drawable portion of the renderer. But I would understand if you mean the renderer's logical size.
I've worked up a flexible, optional config file support for experimental settings not normally needed for the game. I would like you to try the setting "vga_keep_aspect_ratio=false". Build the latest code, create a config.txt in your game config directory, and see if you still have mouse issues, with no other changes required in the game. Basically this sets the renderer to the full window size, which should make full screen mouse just "work", since it stretches to the full screen window.
I was already headed towards making this setting before this issue was filed, because people have complained that the SDL2.0 version of the game has "black bands".
With SDL_WINDOW_ALLOW_HIGHDPI
and vga_keep_aspect_ratio=false
in the config, the barrier issue is resolved but it introduces two issues:
vga_keep_aspect_ratio=true
is the only thing that looks natural here)So I'm not exactly sure what you mean by setting the viewport, since that is setting a drawable portion of the renderer. But I would understand if you mean the renderer's logical size.
Yes, that... I think. Been awhile since I've looked at all this.
I'm not sure if you are describing both points concerning window mode. The logical size needs to be changed to match the new window size, since the coordinate system is based on the window. Anyhow, you can do this in the RESIZE event. Let me know what you see.
case SDL_WINDOWEVENT_RESIZED:
int w, h;
SDL_GetWindowSize(window, &w, &h);
if( config_adv.vga_keep_aspect_ratio || !is_full_screen())
SDL_RenderSetLogicalSize(renderer, VGA_WIDTH, VGA_HEIGHT);
else
SDL_RenderSetLogicalSize(renderer, w, h);
That bit of code properly resets the view size in windowed mode.
The sticky cursor issue only happens in full-screen.
OK can you log what SDL_WindowEventID occur when
I just re-read your comment about config.txt
. You said 'without other changes'. I did still add SDL_WINDOW_ALLOW_HIGHDPI
. Was that your intention? Without that, everything works fine, though that was the case for me anyway... @avdept needed that flag.
Here's the events. There are none after getting to the menus (not even a closed event?):
----- event (1): SDL_WINDOWEVENT_SHOWN -----
----- event (3): SDL_WINDOWEVENT_EXPOSED -----
----- event (12): SDL_WINDOWEVENT_FOCUS_GAINED -----
----- event (10): SDL_WINDOWEVENT_ENTER -----
----- event (4): SDL_WINDOWEVENT_MOVED -----
----- event (6): SDL_WINDOWEVENT_SIZE_CHANGED -----
----- event (5): SDL_WINDOWEVENT_RESIZED -----
----- event (8): SDL_WINDOWEVENT_MAXIMIZED -----
----- Game::single_player_menu() -----
----- CTRL-G -----
----- CTRL-M -----
----- CTRL-G -----
OK. Well with this situation, SDL_WINDOW_ALLOW_HIGHDPI should be the fix on MacOS, but it seems to also cause a regression on MacOS. It will at least make it into the game as a runtime option, since we can do that now. I can't test what is going on myself at this time. I will start working on some changes for add some options to the game for some of the issues that are open.
@sraboy: The messaging information pretty much shows that we can't see what is being triggered externally to correct the boundary, so it's all internal to SDL. If you could look at the 7K routines in set grab and set relative/abs mouse control and try each SDL_* function. I tried looking at the MacOS code in SDL and I didn't see anything obvious. If you could try each SDL function after the window is created, and check the boundary, you might be able to solve it. An interesting candidate is SDL_HINT_MOUSE_RELATIVE_MODE_WARP=1, even though we aren't using it, it is set before creating the window, and again when you toggle CTRL-M. I hope get some useful information.
@sraboy: Actually one test I would like you to perform is to comment out any SDL_RenderSetLogicalSize and run. Of course you can use HIGHDPI to test.
I've added new options. @avdept Please build the latest code and add vga_allow_highdpi=true to your config.txt. Let me know if this solves your issue.
@sraboy, any information on if we can have a working high dpi config without mouse issues. I would like to see if we can make vga_allow_highdpi=true default for the next release.
@the3dfxdude will try and report! Thanks!
Sorry, haven't had a chance to dig into the SDL functions yet. The issues I mentioned earlier are resolved with config.txt like this:
vga_keep_aspect_ratio=false
vga_allow_highdpi=true
No more sticky mouse and no more barrier. However, windowed mode no longer works... the window appears to disappear entirely. If I can select it (via the Dock), I can Alt+Enter to bring it back to fullscreen.
I can confirm window mode doesn't work.
On Tue, May 28, 2019 at 12:03 PM Steve Lavoie notifications@github.com wrote:
Sorry, haven't had a chance to dig into the SDL functions yet. The issues I mentioned earlier are resolved with config.txt like this:
vga_keep_aspect_ratio=false vga_allow_highdpi=true
No more sticky mouse and no more barrier. However, windowed mode no longer works... the window appears to disappear entirely. If I can select it (via the Dock), I can Alt+Enter to bring it back to fullscreen.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/the3dfxdude/7kaa/issues/131?email_source=notifications&email_token=AG7OEI7VFPECKPL7L7DWETTPXVQVPA5CNFSM4G6Z7SNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWMZBFQ#issuecomment-496603286, or mute the thread https://github.com/notifications/unsubscribe-auth/AG7OEI23SIWDWYLOMG4IQ3TPXVQVPANCNFSM4G6Z7SNA .
-- Timothy Rink: 6462CD04 https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0C7780B26462CD04 @ https://keyserver.ubuntu.com/ for PGP key.
When I run game
SKDATA=data ./src/7kaa
it will run with sort of enabled scaling, so I can see only 1/4 of screen. Any args how to disable scaling on hiDPI displays?