SDL2 Text rendering is less smooth #5

Closed
dorkster opened this Issue Jan 23, 2014 · 6 comments

Comments

Projects
None yet
3 participants
@dorkster
Owner

dorkster commented Jan 23, 2014

Comparison image (SDL 1.2 is on the left, SDL 2 is on the right):
sdl1_vs_sdl2

@makrohn

This comment has been minimized.

Show comment
Hide comment
@makrohn

makrohn Jan 23, 2014

Contributor

Is it an incompatibility of SDL_ttf and SDL 2.0? I know we're using SDL_ttf 2.0, but the page says it's for SDL 1.2. Maybe we just need a different font renderer. If it exists.

http://www.libsdl.org/projects/SDL_ttf/

Contributor

makrohn commented Jan 23, 2014

Is it an incompatibility of SDL_ttf and SDL 2.0? I know we're using SDL_ttf 2.0, but the page says it's for SDL 1.2. Maybe we just need a different font renderer. If it exists.

http://www.libsdl.org/projects/SDL_ttf/

@igorko

This comment has been minimized.

Show comment
Hide comment
@igorko

igorko Jan 23, 2014

Collaborator

On Windows when I have tried ttf binaries for SDL1.2 in SDL2 game, it crashed at runtime. So I guess if it works, it's correct ttf library.

Collaborator

igorko commented Jan 23, 2014

On Windows when I have tried ttf binaries for SDL1.2 in SDL2 game, it crashed at runtime. So I guess if it works, it's correct ttf library.

dorkster added a commit that referenced this issue Jun 18, 2014

@dorkster

This comment has been minimized.

Show comment
Hide comment
@dorkster

dorkster Oct 9, 2014

Owner

I finally realized what's happening here. WidgetLabel composes rendered text with a transparent surface. In the software renderer, this is done with SDL_gfxBlitRGBA(). If we use the normal SDL_BlitSurface() function for this, it looks identical to the hardware renderer.

Maybe there's a way we can use the SDL_gfxBlitRGBA() with the hardware renderer so that we get the same style of blending.

Owner

dorkster commented Oct 9, 2014

I finally realized what's happening here. WidgetLabel composes rendered text with a transparent surface. In the software renderer, this is done with SDL_gfxBlitRGBA(). If we use the normal SDL_BlitSurface() function for this, it looks identical to the hardware renderer.

Maybe there's a way we can use the SDL_gfxBlitRGBA() with the hardware renderer so that we get the same style of blending.

@dorkster

This comment has been minimized.

Show comment
Hide comment
@dorkster

dorkster Oct 9, 2014

Owner

Interesting! It looks like SDL_gfx provides its own alpha table to make blended results appear brighter.

Disabling usage of this table makes rendering of text look like the hardware renderer.

Owner

dorkster commented Oct 9, 2014

Interesting! It looks like SDL_gfx provides its own alpha table to make blended results appear brighter.

Disabling usage of this table makes rendering of text look like the hardware renderer.

@igorko

This comment has been minimized.

Show comment
Hide comment
@igorko

igorko May 12, 2015

Collaborator

I guess this is obsolete issue, @dorkster ?

Collaborator

igorko commented May 12, 2015

I guess this is obsolete issue, @dorkster ?

@dorkster

This comment has been minimized.

Show comment
Hide comment
@dorkster

dorkster May 12, 2015

Owner

Correct. There's no difference visually between the two renderers now. We might even want to consider using the sdl_hardware renderer by default across the board. (it's the default on Android).

Owner

dorkster commented May 12, 2015

Correct. There's no difference visually between the two renderers now. We might even want to consider using the sdl_hardware renderer by default across the board. (it's the default on Android).

@dorkster dorkster closed this May 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment