all repos — mgba @ d17c57f6743a3941485a933719a101aad4f62573

mGBA Game Boy Advance Emulator

src/gba/gui/gui-runner.h (view raw)

 1/* Copyright (c) 2013-2015 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 GUI_RUNNER_H
 7#define GUI_RUNNER_H
 8
 9#include "gba/context/context.h"
10#include "util/gui.h"
11
12enum GBAGUIInput {
13	GBA_GUI_INPUT_INCREASE_BRIGHTNESS = GUI_INPUT_USER_START,
14	GBA_GUI_INPUT_DECREASE_BRIGHTNESS
15};
16
17struct GBAGUIBackground {
18	struct GUIBackground d;
19	struct GBAGUIRunner* p;
20};
21
22struct GBAGUIRunnerLux {
23	struct GBALuminanceSource d;
24	int luxLevel;
25};
26
27struct GBAGUIRunner {
28	struct GBAContext context;
29	struct GUIParams params;
30
31	struct GBAGUIBackground background;
32	struct GBAGUIRunnerLux luminanceSource;
33
34	void (*setup)(struct GBAGUIRunner*);
35	void (*teardown)(struct GBAGUIRunner*);
36	void (*gameLoaded)(struct GBAGUIRunner*);
37	void (*gameUnloaded)(struct GBAGUIRunner*);
38	void (*prepareForFrame)(struct GBAGUIRunner*);
39	void (*drawFrame)(struct GBAGUIRunner*, bool faded);
40	uint16_t (*pollGameInput)(struct GBAGUIRunner*);
41};
42
43void GBAGUIInit(struct GBAGUIRunner*, const char* port);
44void GBAGUIDeinit(struct GBAGUIRunner*);
45void GBAGUIRunloop(struct GBAGUIRunner*);
46
47#endif