all repos — mgba @ 44736f89be783d41571bb62347f42eeeb43b74a5

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
12
13struct GBAGUIBackground {
14	struct GUIBackground d;
15	struct GBAGUIRunner* p;
16};
17
18struct GBAGUIRunner {
19	struct GBAContext context;
20	struct GUIParams params;
21
22	struct GBAGUIBackground background;
23
24	void (*setup)(struct GBAGUIRunner*);
25	void (*teardown)(struct GBAGUIRunner*);
26	void (*gameLoaded)(struct GBAGUIRunner*);
27	void (*gameUnloaded)(struct GBAGUIRunner*);
28	void (*prepareForFrame)(struct GBAGUIRunner*);
29	void (*drawFrame)(struct GBAGUIRunner*, bool faded);
30	uint16_t (*pollGameInput)(struct GBAGUIRunner*);
31};
32
33void GBAGUIInit(struct GBAGUIRunner*, const char* port);
34void GBAGUIDeinit(struct GBAGUIRunner*);
35void GBAGUIRunloop(struct GBAGUIRunner*);
36
37#endif