all repos — mgba @ fae8ef7f422184be05a3567e8caa4a10aec801f4

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