[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:
38
src/xenia/helper/sdl/sdl_helper.h
Normal file
38
src/xenia/helper/sdl/sdl_helper.h
Normal 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_
|
||||
Reference in New Issue
Block a user