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 
11 CXX_GUARD_START
12 
13 #ifdef _WIN32
14 #include <windows.h>
15 typedef HWND WHandle;
16 #else
17 typedef void* WHandle;
18 #endif
19 
20 struct 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 
42 struct 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 
51 CXX_GUARD_END
52 
53 #endif
54