MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / Initialize

Method Initialize

Source/UserInput/input.cpp:234–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void Input::Initialize() {
235 InitKeyTranslator();
236 if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) < 0) {
237 FatalError("Error", "Could not initialize SDL_INIT_GAMECONTROLLER");
238 }
239 if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) < 0) {
240 FatalError("Error", "Could not initialize SDL_INIT_JOYSTICK");
241 }
242 // if (SDL_InitSubSystem(SDL_INIT_HAPTIC) < 0) {
243 // FatalError("Error", "Could not initialize SDL_INIT_HAPTIC");
244 // }
245 AddGameControllerDB();
246 SDL_JoystickEventState(SDL_ENABLE);
247 for (int i = 0; i < SDL_NumJoysticks(); i++) {
248 OpenJoystick(i);
249 }
250 PrintControllers(open_joysticks_);
251 ProcessBindings();
252 SetUpForXPlayers(0);
253}
254
255void Input::Dispose() {
256 for (auto& open_joystick : open_joysticks_) {

Callers

nothing calls this directly

Calls 4

InitKeyTranslatorFunction · 0.85
AddGameControllerDBFunction · 0.85
PrintControllersFunction · 0.85
FatalErrorFunction · 0.50

Tested by

no test coverage detected