1
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1]
2
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 15, 2022, 06:12:38 am »
As this appears to be a bug, shall I summarise this in a github issue?
3
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 13, 2022, 07:42:20 am »
So if I comment out the line here
https://github.com/SFML/SFML/blob/82b48a7520a2eb83576ec16d68ff9ea6d3d5d5bd/src/SFML/Window/OSX/cg_sf_conversion.mm#L94
then the modes which come back from getFullscreenModes() look more like what I'd expect for my Macbook Air M2:
Mode #0: 2560x1664 - 32 bpp
Mode #1: 2560x1600 - 32 bpp
Mode #2: 2048x1332 - 32 bpp
Mode #3: 2048x1280 - 32 bpp
Mode #4: 1920x1200 - 32 bpp
So the issue is possibly related to whether pixels or points are returned from CGDisplayModeGetWidth() etc ?
Edit: I've just been looking at this thread https://stackoverflow.com/questions/42024942/cgdisplaymodegetwidth-height-sometimes-returns-pixels-sometimes-points
I wonder whether the comment "The scaling factor for all modes is not the same. Some are 1:1, some are 2:1. A mode of size 1680x1050 points does not imply a pixel size of 3360x2100" is relevant?
https://github.com/SFML/SFML/blob/82b48a7520a2eb83576ec16d68ff9ea6d3d5d5bd/src/SFML/Window/OSX/cg_sf_conversion.mm#L94
then the modes which come back from getFullscreenModes() look more like what I'd expect for my Macbook Air M2:
Mode #0: 2560x1664 - 32 bpp
Mode #1: 2560x1600 - 32 bpp
Mode #2: 2048x1332 - 32 bpp
Mode #3: 2048x1280 - 32 bpp
Mode #4: 1920x1200 - 32 bpp
So the issue is possibly related to whether pixels or points are returned from CGDisplayModeGetWidth() etc ?
Edit: I've just been looking at this thread https://stackoverflow.com/questions/42024942/cgdisplaymodegetwidth-height-sometimes-returns-pixels-sometimes-points
I wonder whether the comment "The scaling factor for all modes is not the same. Some are 1:1, some are 2:1. A mode of size 1680x1050 points does not imply a pixel size of 3360x2100" is relevant?
4
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 12, 2022, 11:49:45 am »
Those specs you quote are for the macbook pro (which is what the OP is using). The specs for my M2 air are here: https://www.apple.com/uk/macbook-air-m2/specs/ and confirms 2560x1664 native resolution.
I don't have DPI scaling enabled as far as I am aware. The only option in settings seems to be some vague "Larger Text", "Default", or "More Space" which scales everything up or down. I tried all of them when I initially saw the problem and got the segfault that the OP initially reported on all of those settings.
I don't have DPI scaling enabled as far as I am aware. The only option in settings seems to be some vague "Larger Text", "Default", or "More Space" which scales everything up or down. I tried all of them when I initially saw the problem and got the segfault that the OP initially reported on all of those settings.
5
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 12, 2022, 09:23:19 am »
Actually, if I draw a circle in any of the fullscreen modes with
sf::CircleShape shape(550.f);
then it pretty much fills the vertical space of the fullscreen-ed screen. So does that mean the resolution being used is around 1100 pixels high? Not sure if this sheds any extra light on anything..?
sf::CircleShape shape(550.f);
then it pretty much fills the vertical space of the fullscreen-ed screen. So does that mean the resolution being used is around 1100 pixels high? Not sure if this sheds any extra light on anything..?
6
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 12, 2022, 09:14:55 am »
OK, I tried it just now. These are the "invalid" modes I allowed getFullscreenModes() to return with my changes:
Mode #0: 5120x3328 - 32 bpp
Mode #1: 5120x3200 - 32 bpp
Mode #2: 4096x2664 - 32 bpp
Mode #3: 4096x2560 - 32 bpp
Mode #4: 3840x2400 - 32 bpp
and if I select any of these with, e.g.
sf::RenderWindow win(modes[0], "Test", sf::Style::Fullscreen);
then it works fine. The "fallback" I mentioned previously must have been because I chose 800x600 in fullscreen initially, rather than one of the fullscreen modes. So ignore that.
Once in any of those modes, if I do a
sf::CircleShape shape(50.f);
then it displays at the same size, regardless of mode selected, which makes me wonder if I'm getting native resolution, no matter which mode I select.
Mode #0: 5120x3328 - 32 bpp
Mode #1: 5120x3200 - 32 bpp
Mode #2: 4096x2664 - 32 bpp
Mode #3: 4096x2560 - 32 bpp
Mode #4: 3840x2400 - 32 bpp
and if I select any of these with, e.g.
sf::RenderWindow win(modes[0], "Test", sf::Style::Fullscreen);
then it works fine. The "fallback" I mentioned previously must have been because I chose 800x600 in fullscreen initially, rather than one of the fullscreen modes. So ignore that.
Once in any of those modes, if I do a
sf::CircleShape shape(50.f);
then it displays at the same size, regardless of mode selected, which makes me wonder if I'm getting native resolution, no matter which mode I select.
7
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 12, 2022, 09:01:59 am »
The native resolution of the macbook air M2 I'm using is 2560 x 1664, so is smaller than all the modes reported (I have no external display connected).
In the test program I just let it fall back to an unknown full-screen mode. It did display the "The requested video mode is not available, switching to a valid mode" messge, but it did go to a valid mode. I can experiment later to see which one it lets me select directly, if that helps?
In the test program I just let it fall back to an unknown full-screen mode. It did display the "The requested video mode is not available, switching to a valid mode" messge, but it did go to a valid mode. I can experiment later to see which one it lets me select directly, if that helps?
8
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 11, 2022, 08:12:53 pm »
...and interestingly, if I remove the "continue" in getFullscreenModes() and let it add the "invalid" modes to the return vector, I can successfully get a fullscreen mode going in a test program on MacOS.
9
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: December 10, 2022, 01:56:42 am »
OK, finally got it working (my debugging, that is, not the code!).
in https://github.com/SFML/SFML/blob/2.6.x/src/SFML/Window/OSX/VideoModeImpl.cpp I put some debug output where I suspected the issue was, between lines 64 and 65 (the "continue"). These are the values I see, so it shows all of the modes are skipped because they are being reported as bigger than the desktop.
mode.size.x = 3840, desktop.size.x = 3420, mode.size.y = 2400, desktop.size.y = 2224
mode.size.x = 4096, desktop.size.x = 3420, mode.size.y = 2560, desktop.size.y = 2224
mode.size.x = 4096, desktop.size.x = 3420, mode.size.y = 2664, desktop.size.y = 2224
mode.size.x = 5120, desktop.size.x = 3420, mode.size.y = 3200, desktop.size.y = 2224
mode.size.x = 5120, desktop.size.x = 3420, mode.size.y = 3328, desktop.size.y = 2224
(Empty std::vector of modes returned)
in https://github.com/SFML/SFML/blob/2.6.x/src/SFML/Window/OSX/VideoModeImpl.cpp I put some debug output where I suspected the issue was, between lines 64 and 65 (the "continue"). These are the values I see, so it shows all of the modes are skipped because they are being reported as bigger than the desktop.
mode.size.x = 3840, desktop.size.x = 3420, mode.size.y = 2400, desktop.size.y = 2224
mode.size.x = 4096, desktop.size.x = 3420, mode.size.y = 2560, desktop.size.y = 2224
mode.size.x = 4096, desktop.size.x = 3420, mode.size.y = 2664, desktop.size.y = 2224
mode.size.x = 5120, desktop.size.x = 3420, mode.size.y = 3200, desktop.size.y = 2224
mode.size.x = 5120, desktop.size.x = 3420, mode.size.y = 3328, desktop.size.y = 2224
(Empty std::vector of modes returned)
10
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: November 18, 2022, 03:06:56 pm »
I'd be happy to help but cannot step into the call.
I've tried building debug versions of the SFML libraries but cannot seem to get an arm64 build to work.
It's all been a bit trial-and-error by downloading the source running CMake - I can build x86_64 OK, but when I specify arm64 with CMAKE_OSX_ARCHITECTURES it won't work.
If anyone's got any links to notes on how to build SFML correctly on MacOS for arm I'd be grateful - it's likely I've missed some obviously-placed documentation
I've tried building debug versions of the SFML libraries but cannot seem to get an arm64 build to work.
It's all been a bit trial-and-error by downloading the source running CMake - I can build x86_64 OK, but when I specify arm64 with CMAKE_OSX_ARCHITECTURES it won't work.
If anyone's got any links to notes on how to build SFML correctly on MacOS for arm I'd be grateful - it's likely I've missed some obviously-placed documentation
11
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: November 18, 2022, 12:49:48 pm »
I am on the latest, Ventura 13.0.1.
12
Window / Re: 0 fullscreen modes available on 14inch macbook pro
« on: November 18, 2022, 11:46:35 am »
I also see exactly the same symptoms on a Macbook Air M2.
Pages: [1]