libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
194 stars 40 forks source link

Compilation failed on SDL2 < 2.0.10 #324

Closed farox1 closed 10 months ago

farox1 commented 10 months ago

Hello I want to test this library and try to build on a Linux Box (Mint 19.3) that have SDL2 at version 2.0.8, but it fails with

sdl12-compat-main/src/SDL12_compat.c:2048:8: error: unknown type name ‘SDL_PixelFormatEnum’ static SDL_PixelFormatEnum Searching the web i found that SDL_PixelFormatEnum has been introduced in SDL 2.0.10.

Following this repo https://github.com/Genymobile/scrcpy/pull/2781 have added the same here and compilation gone ok, but don't know if its ok.

I'll report here the few lines of code:

if !SDL_VERSION_ATLEAST(2, 0, 10)

// SDL_PixelFormatEnum has been introduced in SDL 2.0.10. Use int for older SDL // versions. typedef int SDL_PixelFormatEnum;

endif

icculus commented 10 months ago

I put in something similar to your recommendation, thanks!