1/*
2 * LegacyClonk
3 *
4 * Copyright (c) 2017-2020, The LegacyClonk Team and contributors
5 *
6 * Distributed under the terms of the ISC license; see accompanying file
7 * "COPYING" for details.
8 *
9 * "Clonk" is a registered trademark of Matthes Bender, used with permission.
10 * See accompanying file "TRADEMARK" for details.
11 *
12 * To redistribute this file separately, substitute the full license texts
13 * for the above references.
14 */
15
16#include "Standard.h"
17#include "StdSdlSubSystem.h"
18
19#include <SDL.h>
20
21#include <stdexcept>
22#include <string>
23
24using namespace std::string_literals;
25
26StdSdlSubSystem::StdSdlSubSystem(const Uint32 flags) : flags{flags}
27{
28 if (SDL_InitSubSystem(flags) != 0)
29 {
30 throw std::runtime_error{"SDL_InitSubSystem failed: "s + SDL_GetError()};
31 }
32}
33