-
My game runs in fullscreen, or three window sizes of the same aspect ratio of the desktop. The windows sizes are calculated based on a % of the desktop size. I have the ability to toggles these in game. I always run the game in ResolutionPolicy::EXACT_FIT My iMac screen size is 5120 × 2880 but is running at a resolution of 2880x1620 If I start the app and go in to full screen with GLViewImpl::createWithFullScreen and then call Director::getInstance()->getGLView()->getFrameSize() on Cocos I get 2880x1620 and in Axmol I get 2880x1620 If I then call glView->setWindowed using my large window size of 2160x1215 and then call If I start the app and go in to windows with GLViewImpl::createWithRect using my large window size of 2160x1215 If I then call glView->setFullscreen() and Director::getInstance()->getGLView()->getFrameSize() on Cocos I get 2880x1620 and in Axmol I get 5120 × 2880 It's clear than Axmol's change methods are creating a x2 view and then adjusting accordingly, which cocos wasn't. If this is correct behaviour now, how do I know this is happened. Where do I get that scale from. I use exactly the same code of Windows but haven't yet checked if the behaviour is the same or different as I don't run windows. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 13 replies
-
I tried to build the Windows version, and ran into a few issues. I've posted them up in the PR at your repo: ChilliHugger/The-Lords-Of-Midnight#229 (comment) |
Beta Was this translation helpful? Give feedback.
-
I suspect it's to do with the retina stuff... and when it's enabled and or the frame size is recalculated. If I debug |
Beta Was this translation helpful? Give feedback.
-
I've tried following the code through, and the only thing I can see is that at some point the internal framebuffer size is increased. If I start the app full screen As soon as I drop from Fullscreen to windowed during runtime, then it changes.
If I start the app windowed As soon as I increase from Window to Fullscreen during runtime, then it changes.
So it seems to me that both setWindowed and setFullscreen do not take in to account the original desktop size compared to actual screen resolution unlike to the way that createWithFullScreen and createWithRect appear to. I thought I might be able to at least fudge the Window to Fullscreen switch by setting the actual Desktop Size in the setFullScreen command. But it made no difference.
|
Beta Was this translation helpful? Give feedback.
-
@rh101 Were you thinking that the refresh rate fix would also fix this? This is my last blocker for migration (osx). I'm about to start checking all the other builds now. I'll try and spend some time later this week debugging both axmol and cocos and see if I can find any obvious differences caused during setFullscreen being called. |
Beta Was this translation helpful? Give feedback.
-
@IcemarkUK When going from full-screen mode to windowed-mode, different code paths are taken depending on certain conditions. This may be the reason why things aren't working correctly: Taking a look at
If it is not already in full screen mode, then all it does is set the frame size. No problem there. If it's already in full screen mode, then the end result is
This completely ignores the window size that you pass in, and instead uses some other calculation to set the frame size. At a guess, this is not the expected functionality. It really should be setting the frame size to what is passed in earlier. There is no method named Just out of curiosity, comment out the calls to |
Beta Was this translation helpful? Give feedback.
please track this PR: #1692