forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgfx_null_ctx.c
162 lines (139 loc) · 3.52 KB
/
gfx_null_ctx.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2017 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
/* Null context. */
#include "../video_driver.h"
static void gfx_ctx_null_swap_interval(void *data, unsigned interval)
{
(void)data;
(void)interval;
}
static void gfx_ctx_null_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height, bool is_shutdown)
{
(void)data;
(void)quit;
(void)width;
(void)height;
(void)resize;
}
static void gfx_ctx_null_swap_buffers(void *data, void *data2)
{
(void)data;
}
static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *height)
{
(void)data;
*width = 320;
*height = 240;
}
static bool gfx_ctx_null_set_video_mode(void *data,
video_frame_info_t *video_info,
unsigned width, unsigned height,
bool fullscreen)
{
(void)data;
(void)width;
(void)height;
(void)fullscreen;
return true;
}
static void gfx_ctx_null_destroy(void *data)
{
(void)data;
}
static void gfx_ctx_null_input_driver(void *data,
const char *name,
const input_driver_t **input, void **input_data)
{
(void)data;
(void)input;
(void)input_data;
}
static bool gfx_ctx_null_has_focus(void *data)
{
(void)data;
return true;
}
static bool gfx_ctx_null_suppress_screensaver(void *data, bool enable)
{
(void)data;
(void)enable;
return false;
}
static bool gfx_ctx_null_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor)
{
(void)data;
(void)api;
(void)major;
(void)minor;
return true;
}
static void gfx_ctx_null_show_mouse(void *data, bool state)
{
(void)data;
(void)state;
}
static void gfx_ctx_null_bind_hw_render(void *data, bool enable)
{
(void)data;
(void)enable;
}
static void *gfx_ctx_null_init(video_frame_info_t *video_info, void *video_driver)
{
(void)video_driver;
return (void*)"null";
}
static uint32_t gfx_ctx_null_get_flags(void *data)
{
uint32_t flags = 0;
BIT32_SET(flags, GFX_CTX_FLAGS_NONE);
return flags;
}
static void gfx_ctx_null_set_flags(void *data, uint32_t flags)
{
(void)data;
}
const gfx_ctx_driver_t gfx_ctx_null = {
gfx_ctx_null_init,
gfx_ctx_null_destroy,
gfx_ctx_null_bind_api,
gfx_ctx_null_swap_interval,
gfx_ctx_null_set_video_mode,
gfx_ctx_null_get_video_size,
NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */
NULL, /* get_video_output_next */
NULL, /* get_metrics */
NULL,
NULL, /* update_title */
gfx_ctx_null_check_window,
NULL, /* set_resize */
gfx_ctx_null_has_focus,
gfx_ctx_null_suppress_screensaver,
NULL, /* has_windowed */
gfx_ctx_null_swap_buffers,
gfx_ctx_null_input_driver,
NULL,
NULL,
NULL,
gfx_ctx_null_show_mouse,
"null",
gfx_ctx_null_get_flags,
gfx_ctx_null_set_flags,
gfx_ctx_null_bind_hw_render,
NULL,
NULL
};