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*, unsigned width, unsigned height, WHandle handle);
20 void (*deinit)(struct VideoBackend*);
21 void (*swap)(struct VideoBackend*);
22 void (*clear)(struct VideoBackend*);
23 void (*resized)(struct VideoBackend*, unsigned w, unsigned h);
24 void (*postFrame)(struct VideoBackend*, const void* frame);
25 void (*drawFrame)(struct VideoBackend*);
26 void (*setMessage)(struct VideoBackend*, const char* message);
27 void (*clearMessage)(struct VideoBackend*);
28
29 void* user;
30 unsigned width;
31 unsigned height;
32
33 bool filter;
34 bool lockAspectRatio;
35};
36
37struct VideoShader {
38 const char* name;
39 const char* author;
40 const char* description;
41 void* preprocessShader;
42 void* passes;
43 size_t nPasses;
44};
45
46#endif