Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game crashes when you turn on fullscreen mode #80

Closed
andrewtweber opened this issue Jan 16, 2016 · 14 comments
Closed

Game crashes when you turn on fullscreen mode #80

andrewtweber opened this issue Jan 16, 2016 · 14 comments
Labels

Comments

@andrewtweber
Copy link
Member

Confirmed on 64-bit Windows 8 and 10
Not sure about OSX / Linux

@ghost
Copy link

ghost commented Jan 16, 2016

Resizing/forcing full screen/letting the game set full screen/any other abuse of the windows all works without trouble on 64-bit Linux.

On Jan 16, 2016, at 15:01, Andrew Weber notifications@github.com wrote:

Confirmed on 64-bit Windows 8 and 10
Not sure about OSX / Linux


Reply to this email directly or view it on GitHub.

@emlai
Copy link
Contributor

emlai commented Jan 17, 2016

On OS X, entering fullscreen works as expected, but exiting fullscreen doesn't. When the game is launched in fullscreen mode, and then reverted to windowed mode, one of these two things happens (apparently randomly):

  • either the window becomes invisible, with no way to show it again without quitting and relaunching,

  • or the graphics start looking weird, like this:

    screen shot 2016-01-17 at 03 52 24

    The graphics are rendered slightly smaller than usual. Notice especially the width of the settings panel compared to the screenshot below. This shouldn't happen. Also the window title is missing. Normally it would look like this:

    screen shot 2016-01-17 at 03 52 38

I will try to fix these so we can see whether it fixes the Windows problem as well.

@emlai
Copy link
Contributor

emlai commented Jan 18, 2016

This might be a bug in SDL2 because I tested this with SDL 2.0.3 (instead of 2.0.4) and the behavior was different (but still wrong).

@ryfactor
Copy link
Member

It crashes on Windows 7 as well.
I think the error happens once you get to this line: https://github.com/Attnam/ivan/blob/master/FeLib/Source/graphics.cpp#L307

@emlai
Copy link
Contributor

emlai commented Jan 19, 2016

For some reason, the OS X problem goes away after adding SDL_SetWindowSize(Window, Res.X, Res.Y); just before graphics.cpp#L307. Does this fix the Windows problem too?

If not, can you check what the return value of SDL_SetWindowFullscreen is? It should return 0 on success.

@ryfactor
Copy link
Member

So I added SDL_SetWindowSize(Window, Res.X, Res.Y); just before graphics.cpp#L307 and it didn't fix the problem.
The return value of SDL_SetWindowFullscreen is 0 when I outputted it using ABORT()

Any other ideas?

@ryfactor
Copy link
Member

If you open the ivan.cgf file you can change the fullscreen configuration no problem. It crashes only when you try to change the config in-game.
I've isolated the problem to the SDL_RenderClear function so far, though I don't yet know why the crash happens at this point.

@ryfactor
Copy link
Member

Does this line ever execute under Linux or Mac?

@emlai
Copy link
Contributor

emlai commented Apr 16, 2016

It does on big-endian systems, and then it's a compilation error.

An #error "Big-endian support not implemented in SDL2 mode." would probably be more helpful… 😄

@ryfactor
Copy link
Member

I wondered whether that was the case. I was just curious. All the same, it's not relevant to the bug at hand.

So basically all the three major platforms use the same code in BlitDBToScreen, and the results are wildly different between Linux (stable) and Windows (crash).
I'm going to try talk to the guys over at the SDL forums, because this bug is looking increasingly opaque.

@andrewtweber
Copy link
Member Author

#133 reports that this was working in 504 but broke as of 505. Not sure if that was new information or not.

@ryfactor
Copy link
Member

ryfactor commented Jun 8, 2016

I just checked and v0504 has the full screen bug too :(

@emlai
Copy link
Contributor

emlai commented Nov 26, 2016

There are occasional problems in switching to/from fullscreen on Mac and Linux too, so I'll edit the title to reflect that.

@emlai emlai changed the title Game crashes when you turn on fullscreen mode (Windows) Game crashes when you turn on fullscreen mode Nov 26, 2016
@emlai
Copy link
Contributor

emlai commented Nov 27, 2016

The fullscreen toggle bug on Mac is an SDL bug: https://bugzilla.libsdl.org/show_bug.cgi?id=3501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants