master
ブランチ master
ShaderPlayground / deps / glfw / src / null_window.c
7.8 KB、332行 生 Blame 履歴
1//========================================================================
2// GLFW 3.3 - www.glfw.org
3//------------------------------------------------------------------------
4// Copyright (c) 2016 Google Inc.
5// Copyright (c) 2016-2019 Camilla Löwy <elmindreda@glfw.org>
6//
7// This software is provided 'as-is', without any express or implied
8// warranty. In no event will the authors be held liable for any damages
9// arising from the use of this software.
10//
11// Permission is granted to anyone to use this software for any purpose,
12// including commercial applications, and to alter it and redistribute it
13// freely, subject to the following restrictions:
14//
15// 1. The origin of this software must not be misrepresented; you must not
16// claim that you wrote the original software. If you use this software
17// in a product, an acknowledgment in the product documentation would
18// be appreciated but is not required.
19//
20// 2. Altered source versions must be plainly marked as such, and must not
21// be misrepresented as being the original software.
22//
23// 3. This notice may not be removed or altered from any source
24// distribution.
25//
26//========================================================================
27// It is fine to use C99 in this file because it will not be built with VS
28//========================================================================
29
30#include "internal.h"
31
32
33static int createNativeWindow(_GLFWwindow* window,
34 const _GLFWwndconfig* wndconfig)
35{
36 window->null.width = wndconfig->width;
37 window->null.height = wndconfig->height;
38
39 return GLFW_TRUE;
40}
41
42
43//////////////////////////////////////////////////////////////////////////
44////// GLFW platform API //////
45//////////////////////////////////////////////////////////////////////////
46
47int _glfwPlatformCreateWindow(_GLFWwindow* window,
48 const _GLFWwndconfig* wndconfig,
49 const _GLFWctxconfig* ctxconfig,
50 const _GLFWfbconfig* fbconfig)
51{
52 if (!createNativeWindow(window, wndconfig))
53 return GLFW_FALSE;
54
55 if (ctxconfig->client != GLFW_NO_API)
56 {
57 if (ctxconfig->source == GLFW_NATIVE_CONTEXT_API ||
58 ctxconfig->source == GLFW_OSMESA_CONTEXT_API)
59 {
60 if (!_glfwInitOSMesa())
61 return GLFW_FALSE;
62 if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig))
63 return GLFW_FALSE;
64 }
65 else
66 {
67 _glfwInputError(GLFW_API_UNAVAILABLE, "Null: EGL not available");
68 return GLFW_FALSE;
69 }
70 }
71
72 return GLFW_TRUE;
73}
74
75void _glfwPlatformDestroyWindow(_GLFWwindow* window)
76{
77 if (window->context.destroy)
78 window->context.destroy(window);
79}
80
81void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
82{
83}
84
85void _glfwPlatformSetWindowIcon(_GLFWwindow* window, int count,
86 const GLFWimage* images)
87{
88}
89
90void _glfwPlatformSetWindowMonitor(_GLFWwindow* window,
91 _GLFWmonitor* monitor,
92 int xpos, int ypos,
93 int width, int height,
94 int refreshRate)
95{
96}
97
98void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
99{
100}
101
102void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
103{
104}
105
106void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
107{
108 if (width)
109 *width = window->null.width;
110 if (height)
111 *height = window->null.height;
112}
113
114void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
115{
116 window->null.width = width;
117 window->null.height = height;
118}
119
120void _glfwPlatformSetWindowSizeLimits(_GLFWwindow* window,
121 int minwidth, int minheight,
122 int maxwidth, int maxheight)
123{
124}
125
126void _glfwPlatformSetWindowAspectRatio(_GLFWwindow* window, int n, int d)
127{
128}
129
130void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)
131{
132 if (width)
133 *width = window->null.width;
134 if (height)
135 *height = window->null.height;
136}
137
138void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
139 int* left, int* top,
140 int* right, int* bottom)
141{
142}
143
144void _glfwPlatformGetWindowContentScale(_GLFWwindow* window,
145 float* xscale, float* yscale)
146{
147 if (xscale)
148 *xscale = 1.f;
149 if (yscale)
150 *yscale = 1.f;
151}
152
153void _glfwPlatformIconifyWindow(_GLFWwindow* window)
154{
155}
156
157void _glfwPlatformRestoreWindow(_GLFWwindow* window)
158{
159}
160
161void _glfwPlatformMaximizeWindow(_GLFWwindow* window)
162{
163}
164
165int _glfwPlatformWindowMaximized(_GLFWwindow* window)
166{
167 return GLFW_FALSE;
168}
169
170int _glfwPlatformWindowHovered(_GLFWwindow* window)
171{
172 return GLFW_FALSE;
173}
174
175int _glfwPlatformFramebufferTransparent(_GLFWwindow* window)
176{
177 return GLFW_FALSE;
178}
179
180void _glfwPlatformSetWindowResizable(_GLFWwindow* window, GLFWbool enabled)
181{
182}
183
184void _glfwPlatformSetWindowDecorated(_GLFWwindow* window, GLFWbool enabled)
185{
186}
187
188void _glfwPlatformSetWindowFloating(_GLFWwindow* window, GLFWbool enabled)
189{
190}
191
192float _glfwPlatformGetWindowOpacity(_GLFWwindow* window)
193{
194 return 1.f;
195}
196
197void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity)
198{
199}
200
201void _glfwPlatformSetRawMouseMotion(_GLFWwindow *window, GLFWbool enabled)
202{
203}
204
205GLFWbool _glfwPlatformRawMouseMotionSupported(void)
206{
207 return GLFW_FALSE;
208}
209
210void _glfwPlatformShowWindow(_GLFWwindow* window)
211{
212}
213
214
215void _glfwPlatformRequestWindowAttention(_GLFWwindow* window)
216{
217}
218
219void _glfwPlatformUnhideWindow(_GLFWwindow* window)
220{
221}
222
223void _glfwPlatformHideWindow(_GLFWwindow* window)
224{
225}
226
227void _glfwPlatformFocusWindow(_GLFWwindow* window)
228{
229}
230
231int _glfwPlatformWindowFocused(_GLFWwindow* window)
232{
233 return GLFW_FALSE;
234}
235
236int _glfwPlatformWindowIconified(_GLFWwindow* window)
237{
238 return GLFW_FALSE;
239}
240
241int _glfwPlatformWindowVisible(_GLFWwindow* window)
242{
243 return GLFW_FALSE;
244}
245
246void _glfwPlatformPollEvents(void)
247{
248}
249
250void _glfwPlatformWaitEvents(void)
251{
252}
253
254void _glfwPlatformWaitEventsTimeout(double timeout)
255{
256}
257
258void _glfwPlatformPostEmptyEvent(void)
259{
260}
261
262void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos)
263{
264}
265
266void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
267{
268}
269
270void _glfwPlatformSetCursorMode(_GLFWwindow* window, int mode)
271{
272}
273
274int _glfwPlatformCreateCursor(_GLFWcursor* cursor,
275 const GLFWimage* image,
276 int xhot, int yhot)
277{
278 return GLFW_TRUE;
279}
280
281int _glfwPlatformCreateStandardCursor(_GLFWcursor* cursor, int shape)
282{
283 return GLFW_TRUE;
284}
285
286void _glfwPlatformDestroyCursor(_GLFWcursor* cursor)
287{
288}
289
290void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
291{
292}
293
294void _glfwPlatformSetClipboardString(const char* string)
295{
296}
297
298const char* _glfwPlatformGetClipboardString(void)
299{
300 return NULL;
301}
302
303const char* _glfwPlatformGetScancodeName(int scancode)
304{
305 return "";
306}
307
308int _glfwPlatformGetKeyScancode(int key)
309{
310 return -1;
311}
312
313void _glfwPlatformGetRequiredInstanceExtensions(char** extensions)
314{
315}
316
317int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance,
318 VkPhysicalDevice device,
319 uint32_t queuefamily)
320{
321 return GLFW_FALSE;
322}
323
324VkResult _glfwPlatformCreateWindowSurface(VkInstance instance,
325 _GLFWwindow* window,
326 const VkAllocationCallbacks* allocator,
327 VkSurfaceKHR* surface)
328{
329 // This seems like the most appropriate error to return here
330 return VK_ERROR_INITIALIZATION_FAILED;
331}
332