[SDL] Add global helper to setup the library.

Call to SDLHelper::Prepare() is needed before first SDL_InitSubSystem().
- Sets hints (SDL configuration vars).
- Configures logging.
This commit is contained in:
Joel Linn
2020-04-23 12:14:53 +02:00
committed by Rick Gibbed
parent 5463798631
commit 6267c73c4c
10 changed files with 149 additions and 42 deletions

View File

@@ -0,0 +1,38 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2020 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_HELPER_SDL_SDL_HELPER_H_
#define XENIA_HELPER_SDL_SDL_HELPER_H_
#include "SDL.h"
namespace xe {
namespace helper {
namespace sdl {
// This helper class exists to independently use SDL from different parts of
// xenia.
class SDLHelper {
public:
// To configure the SDL library for use in xenia call this function before
// SDL_InitSubSystem() is called.
static bool Prepare();
static bool IsPrepared() { return is_prepared_; }
private:
static bool SetHints();
static bool RedirectLog();
private:
static bool is_prepared_;
};
} // namespace sdl
} // namespace helper
} // namespace xe
#endif // XENIA_HELPER_SDL_SDL_HELPER_H_