ptitSeb/stuntcarremake

Text display corrupt with SDL=2

tikkel opened this issue · 2 comments

When i compile with SDL=2 then the text display is corrupt.
With SDL=1 it is all fine.
(under Ubuntu 22.10)
grafik

I have found a solution! Only one additional gl-Commandline is needed ...

in file dx_linux.cpp insert after line 849

glPixelStorei(GL_UNPACK_ROW_LENGTH, surf->pitch / surf->format->BytesPerPixel);

before
glTexSubImage2D(GL_TEXTURE_2D, 0, jm_fontsize, im_fontsize, surf->w, (surf->h>=m_fontsize)?m_fontsize-1:surf->h, GL_RGBA, GL_UNSIGNED_BYTE, surf->pixels);

The solution was found here:
https://discourse.libsdl.org/t/sdl-ttf-2-0-18-surface-to-opengl-texture-not-consistent-with-ttf-2-0-15/34529/2

@tikkel This issue is now fixed, feel free to close this.