all repos — mgba @ b8593bdb7bd2d2c790be24c7b1e94ee88d4f5390

mGBA Game Boy Advance Emulator

include/mgba/internal/gba/renderers/thread-proxy.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 VIDEO_THREAD_PROXY_H
 7#define VIDEO_THREAD_PROXY_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#include <mgba/internal/gba/video.h>
14#include <mgba/internal/gba/renderers/proxy.h>
15#include <mgba-util/threading.h>
16#include <mgba-util/ring-fifo.h>
17
18enum GBAVideoThreadProxyState {
19	PROXY_THREAD_STOPPED = 0,
20	PROXY_THREAD_IDLE,
21	PROXY_THREAD_BUSY
22};
23
24struct GBAVideoThreadProxyRenderer {
25	struct GBAVideoProxyRenderer d;
26
27	Thread thread;
28	Condition fromThreadCond;
29	Condition toThreadCond;
30	Mutex mutex;
31	enum GBAVideoThreadProxyState threadState;
32
33	struct RingFIFO dirtyQueue;
34};
35
36void GBAVideoThreadProxyRendererCreate(struct GBAVideoThreadProxyRenderer* renderer, struct GBAVideoRenderer* backend);
37
38CXX_GUARD_END
39
40#endif