all repos — mgba @ 7149dd3102a6bbb7f73cae7da0c01dc784b0f601

mGBA Game Boy Advance Emulator

src/platform/sdl/sdl-events.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef SDL_EVENTS_H
 7#define SDL_EVENTS_H
 8
 9#include "util/common.h"
10
11#include "gba/supervisor/thread.h"
12
13#include <SDL.h>
14
15#define SDL_BINDING_KEY 0x53444C4B
16#define SDL_BINDING_BUTTON 0x53444C42
17
18struct GBAVideoSoftwareRenderer;
19struct Configuration;
20
21struct GBASDLEvents {
22	struct GBAInputMap* bindings;
23	SDL_Joystick* joystick;
24#if SDL_VERSION_ATLEAST(2, 0, 0)
25	SDL_Window* window;
26	int fullscreen;
27	int windowUpdated;
28#endif
29};
30
31bool GBASDLInitEvents(struct GBASDLEvents*);
32void GBASDLDeinitEvents(struct GBASDLEvents*);
33
34void GBASDLInitBindings(struct GBAInputMap* inputMap);
35void GBASDLEventsLoadConfig(struct GBASDLEvents*, const struct Configuration*);
36
37void GBASDLHandleEvent(struct GBAThread* context, struct GBASDLEvents* sdlContext, const union SDL_Event* event);
38
39#endif