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

OS X : Tearing in fullscreen #704

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

Comments

Projects
None yet
3 participants
@BlisterB
Member

BlisterB commented Dec 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@fdelapena

fdelapena Dec 30, 2015

Contributor

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

Contributor

fdelapena commented Dec 30, 2015

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

@BlisterB

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 30, 2015

Member

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

Member

BlisterB commented Dec 30, 2015

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

@fdelapena

This comment has been minimized.

Show comment
Hide comment
@fdelapena

fdelapena Dec 30, 2015

Contributor

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?

Contributor

fdelapena commented Dec 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 30, 2015

Member

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

Member

BlisterB commented Dec 30, 2015

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

@fdelapena

This comment has been minimized.

Show comment
Hide comment
@fdelapena

fdelapena Dec 30, 2015

Contributor

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");
Contributor

fdelapena commented Dec 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 30, 2015

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
Member

BlisterB commented Dec 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 30, 2015

Member

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

Member

BlisterB commented Dec 30, 2015

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

@fdelapena

This comment has been minimized.

Show comment
Hide comment
@fdelapena

fdelapena Dec 30, 2015

Contributor

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.

Contributor

fdelapena commented Dec 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 30, 2015

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 ?

Member

BlisterB commented Dec 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Dec 30, 2015

Member

Yeah that should be possible.

Member

Ghabry commented Dec 30, 2015

Yeah that should be possible.

@BlisterB

This comment has been minimized.

Show comment
Hide comment
@BlisterB

BlisterB Dec 31, 2015

Member

:)

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

Member

BlisterB commented Dec 31, 2015

:)

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

@fdelapena

This comment has been minimized.

Show comment
Hide comment
@fdelapena

fdelapena Dec 31, 2015

Contributor

@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
Contributor

fdelapena commented Dec 31, 2015

@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