all repos — mgba @ 47bf26ff73d9bdf8a044773b20fc816f6e823e7e

mGBA Game Boy Advance Emulator

src/platform/video-backend.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_BACKEND_H
 7#define VIDEO_BACKEND_H
 8
 9#include <mgba-util/common.h>
10
11CXX_GUARD_START
12
13#ifdef _WIN32
14#include <windows.h>
15typedef HWND WHandle;
16#else
17typedef void* WHandle;
18#endif
19
20struct VideoBackend {
21	void (*init)(struct VideoBackend*, WHandle handle);
22	void (*deinit)(struct VideoBackend*);
23	void (*setDimensions)(struct VideoBackend*, unsigned width, unsigned height);
24	void (*swap)(struct VideoBackend*);
25	void (*clear)(struct VideoBackend*);
26	void (*resized)(struct VideoBackend*, unsigned w, unsigned h);
27	void (*postFrame)(struct VideoBackend*, const void* frame);
28	void (*drawFrame)(struct VideoBackend*);
29	void (*setMessage)(struct VideoBackend*, const char* message);
30	void (*clearMessage)(struct VideoBackend*);
31
32	void* user;
33	unsigned width;
34	unsigned height;
35
36	bool filter;
37	bool lockAspectRatio;
38	bool lockIntegerScaling;
39	bool interframeBlending;
40};
41
42struct VideoShader {
43	const char* name;
44	const char* author;
45	const char* description;
46	void* preprocessShader;
47	void* passes;
48	size_t nPasses;
49};
50
51CXX_GUARD_END
52
53#endif