Skip to content

Commit

Permalink
Make get_flags compile with SDL2.
Browse files Browse the repository at this point in the history
Not entirely sure which hardware flags need to be used, so only handle
the resizeable flag.
  • Loading branch information
mordante committed Mar 2, 2014
1 parent e3a2dcd commit 41b316d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/video.cpp
Expand Up @@ -61,13 +61,22 @@ resize_lock::~resize_lock()

static unsigned int get_flags(unsigned int flags)
{
/* The wanted flags for the render need to be evaluated for SDL2. */
#if !SDL_VERSION_ATLEAST(2, 0, 0)
// SDL under Windows doesn't seem to like hardware surfaces
// for some reason.
#if !(defined(_WIN32) || defined(__APPLE__) || defined(__AMIGAOS4__))
flags |= SDL_HWSURFACE;
#endif
#endif


if((flags&SDL_FULLSCREEN) == 0)
#if SDL_VERSION_ATLEAST(2, 0, 0)
flags |= SDL_WINDOW_RESIZABLE;
#else
flags |= SDL_RESIZABLE;
#endif

return flags;
}
Expand Down

0 comments on commit 41b316d

Please sign in to comment.