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};
39
40struct VideoShader {
41 const char* name;
42 const char* author;
43 const char* description;
44 void* preprocessShader;
45 void* passes;
46 size_t nPasses;
47};
48
49CXX_GUARD_END
50
51#endif