SDL_Surface flags in SDL 2 migration


#1

I’m trying to port some old 1.2-based codebase to SDL2 and I have a bunch of occurrences of:

surface->flags & SDL_SRCALPHA

and

surface->format->colorkey

In both cases these are SDL_Surface. The first example fails because SDL_SRCALPHA is no longer defined and the second example fails because SDL_Surface->format has no colorkey nor colorKey.

I couldn’t find any examples of this in the migration guide, so any help would be greatly appreciated!


#2

Bump. Anyone who can help?


#3
  1. that is now https://wiki.libsdl.org/SDL_SetSurfaceBlendMode but much changed so you’ll have to read up on blend modes
  2. this is now https://wiki.libsdl.org/SDL_SetColorKey