null_window.c
Go to the documentation of this file.
1 //========================================================================
2 // GLFW 3.3 - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2016 Google Inc.
5 // Copyright (c) 2006-2016 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 
28 #include "internal.h"
29 
30 
31 static int createNativeWindow(_GLFWwindow* window,
32  const _GLFWwndconfig* wndconfig)
33 {
34  window->null.width = wndconfig->width;
35  window->null.height = wndconfig->height;
36 
37  return GLFW_TRUE;
38 }
39 
40 
44 
46  const _GLFWwndconfig* wndconfig,
47  const _GLFWctxconfig* ctxconfig,
48  const _GLFWfbconfig* fbconfig)
49 {
50  if (!createNativeWindow(window, wndconfig))
51  return GLFW_FALSE;
52 
53  if (ctxconfig->client != GLFW_NO_API)
54  {
55  if (ctxconfig->source == GLFW_NATIVE_CONTEXT_API ||
56  ctxconfig->source == GLFW_OSMESA_CONTEXT_API)
57  {
58  if (!_glfwInitOSMesa())
59  return GLFW_FALSE;
60  if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig))
61  return GLFW_FALSE;
62  }
63  else
64  {
65  _glfwInputError(GLFW_API_UNAVAILABLE, "Null: EGL not available");
66  return GLFW_FALSE;
67  }
68  }
69 
70  return GLFW_TRUE;
71 }
72 
74 {
75  if (window->context.destroy)
76  window->context.destroy(window);
77 }
78 
79 void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
80 {
81 }
82 
83 void _glfwPlatformSetWindowIcon(_GLFWwindow* window, int count,
84  const GLFWimage* images)
85 {
86 }
87 
89  _GLFWmonitor* monitor,
90  int xpos, int ypos,
91  int width, int height,
92  int refreshRate)
93 {
94 }
95 
96 void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
97 {
98 }
99 
100 void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
101 {
102 }
103 
104 void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
105 {
106  if (width)
107  *width = window->null.width;
108  if (height)
109  *height = window->null.height;
110 }
111 
112 void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
113 {
114  window->null.width = width;
115  window->null.height = height;
116 }
117 
119  int minwidth, int minheight,
120  int maxwidth, int maxheight)
121 {
122 }
123 
125 {
126 }
127 
128 void _glfwPlatformGetFramebufferSize(_GLFWwindow* window, int* width, int* height)
129 {
130  if (width)
131  *width = window->null.width;
132  if (height)
133  *height = window->null.height;
134 }
135 
137  int* left, int* top,
138  int* right, int* bottom)
139 {
140 }
141 
143  float* xscale, float* yscale)
144 {
145  if (xscale)
146  *xscale = 1.f;
147  if (yscale)
148  *yscale = 1.f;
149 }
150 
152 {
153 }
154 
156 {
157 }
158 
160 {
161 }
162 
164 {
165  return GLFW_FALSE;
166 }
167 
169 {
170  return GLFW_FALSE;
171 }
172 
174 {
175  return GLFW_FALSE;
176 }
177 
179 {
180 }
181 
183 {
184 }
185 
187 {
188 }
189 
191 {
192  return 1.f;
193 }
194 
195 void _glfwPlatformSetWindowOpacity(_GLFWwindow* window, float opacity)
196 {
197 }
198 
200 {
201 }
202 
203 
205 {
206 }
207 
209 {
210 }
211 
213 {
214 }
215 
217 {
218 }
219 
221 {
222  return GLFW_FALSE;
223 }
224 
226 {
227  return GLFW_FALSE;
228 }
229 
231 {
232  return GLFW_FALSE;
233 }
234 
236 {
237 }
238 
240 {
241 }
242 
243 void _glfwPlatformWaitEventsTimeout(double timeout)
244 {
245 }
246 
248 {
249 }
250 
251 void _glfwPlatformGetCursorPos(_GLFWwindow* window, double* xpos, double* ypos)
252 {
253 }
254 
255 void _glfwPlatformSetCursorPos(_GLFWwindow* window, double x, double y)
256 {
257 }
258 
260 {
261 }
262 
264  const GLFWimage* image,
265  int xhot, int yhot)
266 {
267  return GLFW_TRUE;
268 }
269 
271 {
272  return GLFW_TRUE;
273 }
274 
276 {
277 }
278 
280 {
281 }
282 
283 void _glfwPlatformSetClipboardString(const char* string)
284 {
285 }
286 
288 {
289  return NULL;
290 }
291 
292 const char* _glfwPlatformGetScancodeName(int scancode)
293 {
294  return "";
295 }
296 
298 {
299  return -1;
300 }
301 
303 {
304 }
305 
307  VkPhysicalDevice device,
308  uint32_t queuefamily)
309 {
310  return GLFW_FALSE;
311 }
312 
314  _GLFWwindow* window,
315  const VkAllocationCallbacks* allocator,
316  VkSurfaceKHR* surface)
317 {
318  // This seems like the most appropriate error to return here
320 }
321 
_glfwCreateContextOSMesa
GLFWbool _glfwCreateContextOSMesa(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: osmesa_context.c:196
_glfwPlatformRestoreWindow
void _glfwPlatformRestoreWindow(_GLFWwindow *window)
Definition: null_window.c:155
_glfwPlatformShowWindow
void _glfwPlatformShowWindow(_GLFWwindow *window)
Definition: null_window.c:199
VkSurfaceKHR
uint64_t VkSurfaceKHR
Definition: internal.h:121
NULL
#define NULL
_glfwPlatformSetWindowSize
void _glfwPlatformSetWindowSize(_GLFWwindow *window, int width, int height)
Definition: null_window.c:112
_glfwPlatformGetFramebufferSize
void _glfwPlatformGetFramebufferSize(_GLFWwindow *window, int *width, int *height)
Definition: null_window.c:128
_GLFWwndconfig::width
int width
Definition: internal.h:257
_GLFWcursor
Definition: internal.h:447
_glfwPlatformPollEvents
void _glfwPlatformPollEvents(void)
Definition: null_window.c:235
_glfwPlatformUnhideWindow
void _glfwPlatformUnhideWindow(_GLFWwindow *window)
Definition: null_window.c:208
_glfwPlatformGetPhysicalDevicePresentationSupport
int _glfwPlatformGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)
Definition: null_window.c:306
_glfwPlatformGetWindowPos
void _glfwPlatformGetWindowPos(_GLFWwindow *window, int *xpos, int *ypos)
Definition: null_window.c:96
VkInstance
void * VkInstance
Definition: internal.h:119
_glfwPlatformSetWindowSizeLimits
void _glfwPlatformSetWindowSizeLimits(_GLFWwindow *window, int minwidth, int minheight, int maxwidth, int maxheight)
Definition: null_window.c:118
conf.extensions
list extensions
Definition: conf.py:60
_glfwPlatformSetWindowFloating
void _glfwPlatformSetWindowFloating(_GLFWwindow *window, GLFWbool enabled)
Definition: null_window.c:186
_glfwPlatformSetCursor
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
Definition: null_window.c:279
_glfwPlatformMaximizeWindow
void _glfwPlatformMaximizeWindow(_GLFWwindow *window)
Definition: null_window.c:159
_glfwPlatformCreateWindowSurface
VkResult _glfwPlatformCreateWindowSurface(VkInstance instance, _GLFWwindow *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
Definition: null_window.c:313
_glfwPlatformWindowHovered
int _glfwPlatformWindowHovered(_GLFWwindow *window)
Definition: null_window.c:168
_glfwPlatformSetWindowPos
void _glfwPlatformSetWindowPos(_GLFWwindow *window, int xpos, int ypos)
Definition: null_window.c:100
_glfwPlatformSetCursorMode
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
Definition: null_window.c:259
_glfwInputError
void _glfwInputError(int code, const char *format,...)
Definition: init.c:153
_glfwPlatformGetKeyScancode
int _glfwPlatformGetKeyScancode(int key)
Definition: null_window.c:297
_glfwPlatformWaitEvents
void _glfwPlatformWaitEvents(void)
Definition: null_window.c:239
_glfwPlatformCreateCursor
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
Definition: null_window.c:263
_GLFWctxconfig::client
int client
Definition: internal.h:288
_GLFWcontext::destroy
_GLFWdestroycontextfun destroy
Definition: internal.h:354
_glfwPlatformCreateStandardCursor
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
Definition: null_window.c:270
createNativeWindow
static int createNativeWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig)
Definition: null_window.c:31
_glfwPlatformIconifyWindow
void _glfwPlatformIconifyWindow(_GLFWwindow *window)
Definition: null_window.c:151
GLFW_API_UNAVAILABLE
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
Definition: glfw3.h:698
_glfwPlatformWaitEventsTimeout
void _glfwPlatformWaitEventsTimeout(double timeout)
Definition: null_window.c:243
_GLFWwindow
Definition: internal.h:366
_GLFWctxconfig
Definition: internal.h:286
_glfwPlatformFocusWindow
void _glfwPlatformFocusWindow(_GLFWwindow *window)
Definition: null_window.c:216
GLFW_FALSE
#define GLFW_FALSE
Zero.
Definition: glfw3.h:287
_glfwPlatformSetClipboardString
void _glfwPlatformSetClipboardString(const char *string)
Definition: null_window.c:283
_glfwPlatformGetClipboardString
const char * _glfwPlatformGetClipboardString(void)
Definition: null_window.c:287
GLFW_TRUE
#define GLFW_TRUE
One.
Definition: glfw3.h:279
_glfwPlatformSetWindowMonitor
void _glfwPlatformSetWindowMonitor(_GLFWwindow *window, _GLFWmonitor *monitor, int xpos, int ypos, int width, int height, int refreshRate)
Definition: null_window.c:88
_GLFWwindow::context
_GLFWcontext context
Definition: internal.h:395
_GLFWwndconfig::height
int height
Definition: internal.h:258
_glfwPlatformWindowVisible
int _glfwPlatformWindowVisible(_GLFWwindow *window)
Definition: null_window.c:230
_glfwPlatformSetWindowTitle
void _glfwPlatformSetWindowTitle(_GLFWwindow *window, const char *title)
Definition: null_window.c:79
_glfwPlatformWindowMaximized
int _glfwPlatformWindowMaximized(_GLFWwindow *window)
Definition: null_window.c:163
_glfwPlatformHideWindow
void _glfwPlatformHideWindow(_GLFWwindow *window)
Definition: null_window.c:212
VkAllocationCallbacks
struct VkAllocationCallbacks VkAllocationCallbacks
Definition: internal.h:163
_glfwPlatformSetWindowOpacity
void _glfwPlatformSetWindowOpacity(_GLFWwindow *window, float opacity)
Definition: null_window.c:195
GLFW_NO_API
#define GLFW_NO_API
Definition: glfw3.h:989
_GLFWctxconfig::source
int source
Definition: internal.h:289
_glfwPlatformSetWindowResizable
void _glfwPlatformSetWindowResizable(_GLFWwindow *window, GLFWbool enabled)
Definition: null_window.c:178
_glfwPlatformGetCursorPos
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
Definition: null_window.c:251
_glfwPlatformGetWindowOpacity
float _glfwPlatformGetWindowOpacity(_GLFWwindow *window)
Definition: null_window.c:190
_glfwPlatformRequestWindowAttention
void _glfwPlatformRequestWindowAttention(_GLFWwindow *window)
Definition: null_window.c:204
_GLFWwndconfig
Definition: internal.h:255
_glfwPlatformSetWindowAspectRatio
void _glfwPlatformSetWindowAspectRatio(_GLFWwindow *window, int n, int d)
Definition: null_window.c:124
_glfwPlatformGetWindowSize
void _glfwPlatformGetWindowSize(_GLFWwindow *window, int *width, int *height)
Definition: null_window.c:104
internal.h
_glfwPlatformPostEmptyEvent
void _glfwPlatformPostEmptyEvent(void)
Definition: null_window.c:247
VkPhysicalDevice
void * VkPhysicalDevice
Definition: internal.h:120
_glfwPlatformGetWindowContentScale
void _glfwPlatformGetWindowContentScale(_GLFWwindow *window, float *xscale, float *yscale)
Definition: null_window.c:142
_GLFWfbconfig
Definition: internal.h:312
GLFW_NATIVE_CONTEXT_API
#define GLFW_NATIVE_CONTEXT_API
Definition: glfw3.h:1014
_glfwPlatformGetWindowFrameSize
void _glfwPlatformGetWindowFrameSize(_GLFWwindow *window, int *left, int *top, int *right, int *bottom)
Definition: null_window.c:136
GLFWimage
Image data.
Definition: glfw3.h:1588
_glfwPlatformGetRequiredInstanceExtensions
void _glfwPlatformGetRequiredInstanceExtensions(char **extensions)
Definition: null_window.c:302
_glfwPlatformGetScancodeName
const char * _glfwPlatformGetScancodeName(int scancode)
Definition: null_window.c:292
_glfwPlatformSetWindowDecorated
void _glfwPlatformSetWindowDecorated(_GLFWwindow *window, GLFWbool enabled)
Definition: null_window.c:182
_glfwInitOSMesa
GLFWbool _glfwInitOSMesa(void)
Definition: osmesa_context.c:111
GLFW_OSMESA_CONTEXT_API
#define GLFW_OSMESA_CONTEXT_API
Definition: glfw3.h:1016
_glfwPlatformCreateWindow
int _glfwPlatformCreateWindow(_GLFWwindow *window, const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: null_window.c:45
_glfwPlatformFramebufferTransparent
int _glfwPlatformFramebufferTransparent(_GLFWwindow *window)
Definition: null_window.c:173
_GLFWmonitor
Definition: internal.h:423
VK_ERROR_INITIALIZATION_FAILED
@ VK_ERROR_INITIALIZATION_FAILED
Definition: internal.h:145
VkResult
VkResult
Definition: internal.h:135
_glfwPlatformDestroyWindow
void _glfwPlatformDestroyWindow(_GLFWwindow *window)
Definition: null_window.c:73
_glfwPlatformSetCursorPos
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double x, double y)
Definition: null_window.c:255
GLFWbool
int GLFWbool
Definition: internal.h:62
_glfwPlatformWindowIconified
int _glfwPlatformWindowIconified(_GLFWwindow *window)
Definition: null_window.c:225
_glfwPlatformSetWindowIcon
void _glfwPlatformSetWindowIcon(_GLFWwindow *window, int count, const GLFWimage *images)
Definition: null_window.c:83
_glfwPlatformWindowFocused
int _glfwPlatformWindowFocused(_GLFWwindow *window)
Definition: null_window.c:220
_glfwPlatformDestroyCursor
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
Definition: null_window.c:275


mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08