SDL_CreateRGBSurface[WithFormat]From functions are available since 2.0.5, not 2.0.6

This commit is contained in:
Charles Dang 2018-03-13 21:29:23 +11:00
parent ca0e809f0c
commit e993d5525b
3 changed files with 6 additions and 6 deletions

View file

@ -713,7 +713,7 @@ void pango_text::rerender(const bool force)
}
}
#if SDL_VERSION_ATLEAST(2, 0, 6)
#if SDL_VERSION_ATLEAST(2, 0, 5)
surface_.assign(SDL_CreateRGBSurfaceWithFormatFrom(
&surface_buffer_[0], width, height, 32, stride, SDL_PIXELFORMAT_ARGB8888));
#else

View file

@ -52,7 +52,7 @@ static SDL_PixelFormat& get_neutral_pixel_format()
if(first_time) {
first_time = false;
#if SDL_VERSION_ATLEAST(2, 0, 6)
#if SDL_VERSION_ATLEAST(2, 0, 5)
surface surf(
SDL_CreateRGBSurfaceWithFormat(0, 1, 1, 32, SDL_PIXELFORMAT_ARGB8888));
#else
@ -88,7 +88,7 @@ surface create_neutral_surface(int w, int h)
SDL_PixelFormat format = get_neutral_pixel_format();
#if SDL_VERSION_ATLEAST(2, 0, 6)
#if SDL_VERSION_ATLEAST(2, 0, 5)
surface result = SDL_CreateRGBSurfaceWithFormat(0, w, h, format.BitsPerPixel, format.format);
#else
surface result = SDL_CreateRGBSurface(0, w, h,
@ -2105,7 +2105,7 @@ surface create_compatible_surface(const surface &surf, int width, int height)
if(height == -1)
height = surf->h;
#if SDL_VERSION_ATLEAST(2, 0, 6)
#if SDL_VERSION_ATLEAST(2, 0, 5)
surface s = SDL_CreateRGBSurfaceWithFormat(0, width, height, surf->format->BitsPerPixel, surf->format->format);
#else
surface s = SDL_CreateRGBSurface(0, width, height, surf->format->BitsPerPixel,

View file

@ -174,7 +174,7 @@ void CVideo::make_fake()
fake_screen_ = true;
refresh_rate_ = 1;
#if SDL_VERSION_ATLEAST(2, 0, 6)
#if SDL_VERSION_ATLEAST(2, 0, 5)
frameBuffer = SDL_CreateRGBSurfaceWithFormat(0, 16, 16, 24, SDL_PIXELFORMAT_BGR888);
#else
frameBuffer = SDL_CreateRGBSurface(0, 16, 16, 24, 0xFF0000, 0xFF00, 0xFF, 0);
@ -185,7 +185,7 @@ void CVideo::make_fake()
void CVideo::make_test_fake(const unsigned width, const unsigned height)
{
#if SDL_VERSION_ATLEAST(2, 0, 6)
#if SDL_VERSION_ATLEAST(2, 0, 5)
frameBuffer = SDL_CreateRGBSurfaceWithFormat(0, width, height, 32, SDL_PIXELFORMAT_BGR888);
#else
frameBuffer = SDL_CreateRGBSurface(0, width, height, 32, 0xFF0000, 0xFF00, 0xFF, 0);