OS X : Tearing in fullscreen #704

Closed
BlisterB opened this Issue Dec 30, 2015 · 12 comments

Projects

None yet

3 participants

@BlisterB
Member

When playing on fullscreen, a pronunciated tearing is observable, when walking on a map for exemple.
I cannot provide a screen because print screen seems to be disabled in fullscreen mode.

@fdelapena
Member

This one looks like a SDL issue. Are you using the prebuilt binary or did you build your own?

@BlisterB
Member

I've test the 2 options and tearing is present on both :s.

@fdelapena
Member

Try this vsync flag in src/sdl_ui.cpp line 406:

        sdl_renderer = SDL_CreateRenderer(sdl_window, -1, SDL_RENDERER_PRESENTVSYNC);

This one crashes for me when doing alt+tab in desktop full screen on linux.

By the way, do you have more than 1 monitor in your OS X machine?

@BlisterB
Member

This is way better ! But always no perfect scrolling.
There is no more big tearing, but the scrolling is not ultra "smooth".

@fdelapena
Member

Thanks @BlisterBoy, could you tell the output after adding this debug code to check current video renderer features? Both with and without the previous patch. To paste after line 409.

        SDL_RendererInfo sdl_renderer_info;
        SDL_GetRendererInfo(sdl_renderer, &sdl_renderer_info);

        Output::Debug("SDL renderer name: %s", sdl_renderer_info.name);
        if (sdl_renderer_info.flags & SDL_RENDERER_SOFTWARE) Output::Debug("SDL renderer flag: SDL_RENDERER_SOFTWARE");
        if (sdl_renderer_info.flags & SDL_RENDERER_ACCELERATED) Output::Debug("SDL renderer flag: SDL_RENDERER_ACCELERATED");
        if (sdl_renderer_info.flags & SDL_RENDERER_PRESENTVSYNC) Output::Debug("SDL renderer flag: SDL_RENDERER_PRESENTVSYNC");
        if (sdl_renderer_info.flags & SDL_RENDERER_TARGETTEXTURE) Output::Debug("SDL renderer flag: SDL_RENDERER_TARGETTEXTURE");
@BlisterB
Member

With sdl_renderer = SDL_CreateRenderer(sdl_window, -1, 0); :

Debug: SDL renderer name: opengl
Debug: SDL renderer flag: SDL_RENDERER_ACCELERATED
Debug: SDL renderer flag: SDL_RENDERER_TARGETTEXTURE

With sdl_renderer = SDL_CreateRenderer(sdl_window, -1, SDL_RENDERER_PRESENTVSYNC); :

Debug: SDL renderer name: opengl
Debug: SDL renderer flag: SDL_RENDERER_ACCELERATED
Debug: SDL renderer flag: SDL_RENDERER_PRESENTVSYNC
Debug: SDL renderer flag: SDL_RENDERER_TARGETTEXTURE
@BlisterB
Member

It's hard to describe, there is just some element that slightly shake during the scrolling.

@fdelapena
Member

Thanks, same renderer features here. Vsync waits to prevent tearing, that's why looks slower. Did you try to do alt+tab when it was on full screen?

It's hard to describe, there is just some element that slightly shake during the scrolling.

Because the scaling makes some pixels "larger" than other (not all pixels have the same size when fitting the screen) this may be normal.

@BlisterB
Member

Because the scaling makes some pixels "larger" than other (not all pixels have the same size when fitting the screen) this may be normal.

Oh I think this is the problem ! This is why it looks perfect in window mode !

Hmm the thing is I realize now it's also observable in other ports (I think of the Android port).
There is also the problem of pixel with different size (you see that through PNJ eyes).
Respect aspect ratio could be a great improvment. There is maybe a way, using little black at the top and bottom of the screen ?

@Ghabry
Member
Ghabry commented Dec 30, 2015

Yeah that should be possible.

@BlisterB
Member

:)

@fdelapena do you want me to do a pull request with the vsync flag ?

@fdelapena
Member

@BlisterBoy it would be nice, thanks!. However I recommend to make it just for OS X only. Something like:

#if defined(__APPLE__) && defined(__MACH__)
// OS X specific stuff here
#else
// other platforms
#endif
@Ghabry Ghabry closed this in #707 Jan 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment