2016-10-13 17:24:51 +02:00
|
|
|
//========================================================================
|
2019-04-16 14:43:29 +02:00
|
|
|
// GLFW 3.4 - www.glfw.org
|
2016-10-13 17:24:51 +02:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
// Copyright (c) 2016 Google Inc.
|
2019-04-15 20:50:00 +02:00
|
|
|
// Copyright (c) 2016-2019 Camilla Löwy <elmindreda@glfw.org>
|
2016-10-13 17:24:51 +02:00
|
|
|
//
|
|
|
|
// This software is provided 'as-is', without any express or implied
|
|
|
|
// warranty. In no event will the authors be held liable for any damages
|
|
|
|
// arising from the use of this software.
|
|
|
|
//
|
|
|
|
// Permission is granted to anyone to use this software for any purpose,
|
|
|
|
// including commercial applications, and to alter it and redistribute it
|
|
|
|
// freely, subject to the following restrictions:
|
|
|
|
//
|
|
|
|
// 1. The origin of this software must not be misrepresented; you must not
|
|
|
|
// claim that you wrote the original software. If you use this software
|
|
|
|
// in a product, an acknowledgment in the product documentation would
|
|
|
|
// be appreciated but is not required.
|
|
|
|
//
|
|
|
|
// 2. Altered source versions must be plainly marked as such, and must not
|
|
|
|
// be misrepresented as being the original software.
|
|
|
|
//
|
|
|
|
// 3. This notice may not be removed or altered from any source
|
|
|
|
// distribution.
|
|
|
|
//
|
|
|
|
//========================================================================
|
2016-08-31 00:53:19 +02:00
|
|
|
|
|
|
|
#include "internal.h"
|
|
|
|
|
2020-05-21 17:16:26 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
static void applySizeLimits(_GLFWwindow* window, int* width, int* height)
|
|
|
|
{
|
|
|
|
if (window->numer != GLFW_DONT_CARE && window->denom != GLFW_DONT_CARE)
|
|
|
|
{
|
|
|
|
const float ratio = (float) window->numer / (float) window->denom;
|
|
|
|
*height = (int) (*width / ratio);
|
|
|
|
}
|
|
|
|
|
2022-03-14 16:01:34 +01:00
|
|
|
if (window->minwidth != GLFW_DONT_CARE)
|
|
|
|
*width = _glfw_max(*width, window->minwidth);
|
|
|
|
else if (window->maxwidth != GLFW_DONT_CARE)
|
|
|
|
*width = _glfw_min(*width, window->maxwidth);
|
2020-05-21 17:16:26 +02:00
|
|
|
|
2022-03-14 16:01:34 +01:00
|
|
|
if (window->minheight != GLFW_DONT_CARE)
|
|
|
|
*height = _glfw_min(*height, window->minheight);
|
|
|
|
else if (window->maxheight != GLFW_DONT_CARE)
|
|
|
|
*height = _glfw_max(*height, window->maxheight);
|
2020-05-21 17:16:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void fitToMonitor(_GLFWwindow* window)
|
|
|
|
{
|
|
|
|
GLFWvidmode mode;
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwGetVideoModeNull(window->monitor, &mode);
|
|
|
|
_glfwGetMonitorPosNull(window->monitor,
|
|
|
|
&window->null.xpos,
|
|
|
|
&window->null.ypos);
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.width = mode.width;
|
|
|
|
window->null.height = mode.height;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void acquireMonitor(_GLFWwindow* window)
|
|
|
|
{
|
|
|
|
_glfwInputMonitorWindow(window->monitor, window);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void releaseMonitor(_GLFWwindow* window)
|
|
|
|
{
|
|
|
|
if (window->monitor->window != window)
|
|
|
|
return;
|
|
|
|
|
|
|
|
_glfwInputMonitorWindow(window->monitor, NULL);
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2016-10-13 17:24:51 +02:00
|
|
|
static int createNativeWindow(_GLFWwindow* window,
|
2020-05-21 17:16:26 +02:00
|
|
|
const _GLFWwndconfig* wndconfig,
|
|
|
|
const _GLFWfbconfig* fbconfig)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->monitor)
|
|
|
|
fitToMonitor(window);
|
|
|
|
else
|
|
|
|
{
|
2021-10-26 14:25:03 +02:00
|
|
|
if (wndconfig->xpos == GLFW_ANY_POSITION && wndconfig->ypos == GLFW_ANY_POSITION)
|
|
|
|
{
|
|
|
|
window->null.xpos = 17;
|
|
|
|
window->null.ypos = 17;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
window->null.xpos = wndconfig->xpos;
|
|
|
|
window->null.ypos = wndconfig->ypos;
|
|
|
|
}
|
|
|
|
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.width = wndconfig->width;
|
|
|
|
window->null.height = wndconfig->height;
|
|
|
|
}
|
|
|
|
|
|
|
|
window->null.visible = wndconfig->visible;
|
|
|
|
window->null.decorated = wndconfig->decorated;
|
|
|
|
window->null.maximized = wndconfig->maximized;
|
|
|
|
window->null.floating = wndconfig->floating;
|
|
|
|
window->null.transparent = fbconfig->transparent;
|
|
|
|
window->null.opacity = 1.f;
|
2016-08-31 00:53:19 +02:00
|
|
|
|
|
|
|
return GLFW_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
////// GLFW platform API //////
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwCreateWindowNull(_GLFWwindow* window,
|
|
|
|
const _GLFWwndconfig* wndconfig,
|
|
|
|
const _GLFWctxconfig* ctxconfig,
|
|
|
|
const _GLFWfbconfig* fbconfig)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (!createNativeWindow(window, wndconfig, fbconfig))
|
2016-08-31 00:53:19 +02:00
|
|
|
return GLFW_FALSE;
|
|
|
|
|
2016-10-13 17:24:51 +02:00
|
|
|
if (ctxconfig->client != GLFW_NO_API)
|
|
|
|
{
|
2017-02-28 19:23:25 +01:00
|
|
|
if (ctxconfig->source == GLFW_NATIVE_CONTEXT_API ||
|
|
|
|
ctxconfig->source == GLFW_OSMESA_CONTEXT_API)
|
2016-11-08 23:43:45 +01:00
|
|
|
{
|
|
|
|
if (!_glfwInitOSMesa())
|
|
|
|
return GLFW_FALSE;
|
|
|
|
if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig))
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
2021-07-14 20:06:22 +02:00
|
|
|
else if (ctxconfig->source == GLFW_EGL_CONTEXT_API)
|
2016-11-08 23:43:45 +01:00
|
|
|
{
|
2021-07-14 20:06:22 +02:00
|
|
|
if (!_glfwInitEGL())
|
|
|
|
return GLFW_FALSE;
|
|
|
|
if (!_glfwCreateContextEGL(window, ctxconfig, fbconfig))
|
|
|
|
return GLFW_FALSE;
|
2016-11-08 23:43:45 +01:00
|
|
|
}
|
2022-04-06 21:13:48 +02:00
|
|
|
|
|
|
|
if (!_glfwRefreshContextAttribs(window, ctxconfig))
|
|
|
|
return GLFW_FALSE;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2022-04-06 21:13:48 +02:00
|
|
|
if (wndconfig->mousePassthrough)
|
|
|
|
_glfwSetWindowMousePassthroughNull(window, GLFW_TRUE);
|
|
|
|
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->monitor)
|
|
|
|
{
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwShowWindowNull(window);
|
|
|
|
_glfwFocusWindowNull(window);
|
2020-05-21 17:16:26 +02:00
|
|
|
acquireMonitor(window);
|
2022-04-06 21:13:48 +02:00
|
|
|
|
|
|
|
if (wndconfig->centerCursor)
|
|
|
|
_glfwCenterCursorInContentArea(window);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (wndconfig->visible)
|
|
|
|
{
|
|
|
|
_glfwShowWindowNull(window);
|
|
|
|
if (wndconfig->focused)
|
|
|
|
_glfwFocusWindowNull(window);
|
|
|
|
}
|
2020-05-21 17:16:26 +02:00
|
|
|
}
|
|
|
|
|
2016-08-31 00:53:19 +02:00
|
|
|
return GLFW_TRUE;
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwDestroyWindowNull(_GLFWwindow* window)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->monitor)
|
|
|
|
releaseMonitor(window);
|
|
|
|
|
|
|
|
if (_glfw.null.focusedWindow == window)
|
|
|
|
_glfw.null.focusedWindow = NULL;
|
|
|
|
|
2016-08-31 00:53:19 +02:00
|
|
|
if (window->context.destroy)
|
|
|
|
window->context.destroy(window);
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowMonitorNull(_GLFWwindow* window,
|
|
|
|
_GLFWmonitor* monitor,
|
|
|
|
int xpos, int ypos,
|
|
|
|
int width, int height,
|
|
|
|
int refreshRate)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->monitor == monitor)
|
|
|
|
{
|
|
|
|
if (!monitor)
|
|
|
|
{
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwSetWindowPosNull(window, xpos, ypos);
|
|
|
|
_glfwSetWindowSizeNull(window, width, height);
|
2020-05-21 17:16:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (window->monitor)
|
|
|
|
releaseMonitor(window);
|
|
|
|
|
|
|
|
_glfwInputWindowMonitor(window, monitor);
|
|
|
|
|
|
|
|
if (window->monitor)
|
|
|
|
{
|
|
|
|
window->null.visible = GLFW_TRUE;
|
|
|
|
acquireMonitor(window);
|
|
|
|
fitToMonitor(window);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwSetWindowPosNull(window, xpos, ypos);
|
|
|
|
_glfwSetWindowSizeNull(window, width, height);
|
2020-05-21 17:16:26 +02:00
|
|
|
}
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetWindowPosNull(_GLFWwindow* window, int* xpos, int* ypos)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (xpos)
|
|
|
|
*xpos = window->null.xpos;
|
|
|
|
if (ypos)
|
|
|
|
*ypos = window->null.ypos;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->monitor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (window->null.xpos != xpos || window->null.ypos != ypos)
|
|
|
|
{
|
|
|
|
window->null.xpos = xpos;
|
|
|
|
window->null.ypos = ypos;
|
|
|
|
_glfwInputWindowPos(window, xpos, ypos);
|
|
|
|
}
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetWindowSizeNull(_GLFWwindow* window, int* width, int* height)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2016-10-13 17:24:51 +02:00
|
|
|
if (width)
|
2017-02-28 20:27:10 +01:00
|
|
|
*width = window->null.width;
|
2016-10-13 17:24:51 +02:00
|
|
|
if (height)
|
2017-02-28 20:27:10 +01:00
|
|
|
*height = window->null.height;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowSizeNull(_GLFWwindow* window, int width, int height)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->monitor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (window->null.width != width || window->null.height != height)
|
|
|
|
{
|
|
|
|
window->null.width = width;
|
|
|
|
window->null.height = height;
|
|
|
|
_glfwInputWindowSize(window, width, height);
|
|
|
|
_glfwInputFramebufferSize(window, width, height);
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowSizeLimitsNull(_GLFWwindow* window,
|
|
|
|
int minwidth, int minheight,
|
|
|
|
int maxwidth, int maxheight)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
int width = window->null.width;
|
|
|
|
int height = window->null.height;
|
|
|
|
applySizeLimits(window, &width, &height);
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwSetWindowSizeNull(window, width, height);
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowAspectRatioNull(_GLFWwindow* window, int n, int d)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
int width = window->null.width;
|
|
|
|
int height = window->null.height;
|
|
|
|
applySizeLimits(window, &width, &height);
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwSetWindowSizeNull(window, width, height);
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetFramebufferSizeNull(_GLFWwindow* window, int* width, int* height)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2016-10-13 17:24:51 +02:00
|
|
|
if (width)
|
2017-02-28 20:27:10 +01:00
|
|
|
*width = window->null.width;
|
2016-10-13 17:24:51 +02:00
|
|
|
if (height)
|
2017-02-28 20:27:10 +01:00
|
|
|
*height = window->null.height;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetWindowFrameSizeNull(_GLFWwindow* window,
|
|
|
|
int* left, int* top,
|
|
|
|
int* right, int* bottom)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->null.decorated && !window->monitor)
|
|
|
|
{
|
2020-08-19 19:30:00 +02:00
|
|
|
if (left)
|
|
|
|
*left = 1;
|
|
|
|
if (top)
|
|
|
|
*top = 10;
|
|
|
|
if (right)
|
|
|
|
*right = 1;
|
|
|
|
if (bottom)
|
|
|
|
*bottom = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (left)
|
|
|
|
*left = 0;
|
|
|
|
if (top)
|
|
|
|
*top = 0;
|
|
|
|
if (right)
|
|
|
|
*right = 0;
|
|
|
|
if (bottom)
|
|
|
|
*bottom = 0;
|
2020-05-21 17:16:26 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetWindowContentScaleNull(_GLFWwindow* window, float* xscale, float* yscale)
|
2017-08-29 19:19:00 +02:00
|
|
|
{
|
|
|
|
if (xscale)
|
|
|
|
*xscale = 1.f;
|
|
|
|
if (yscale)
|
|
|
|
*yscale = 1.f;
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwIconifyWindowNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (_glfw.null.focusedWindow == window)
|
|
|
|
{
|
|
|
|
_glfw.null.focusedWindow = NULL;
|
|
|
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window->null.iconified)
|
|
|
|
{
|
|
|
|
window->null.iconified = GLFW_TRUE;
|
|
|
|
_glfwInputWindowIconify(window, GLFW_TRUE);
|
|
|
|
|
|
|
|
if (window->monitor)
|
|
|
|
releaseMonitor(window);
|
|
|
|
}
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwRestoreWindowNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (window->null.iconified)
|
|
|
|
{
|
|
|
|
window->null.iconified = GLFW_FALSE;
|
|
|
|
_glfwInputWindowIconify(window, GLFW_FALSE);
|
|
|
|
|
|
|
|
if (window->monitor)
|
|
|
|
acquireMonitor(window);
|
|
|
|
}
|
|
|
|
else if (window->null.maximized)
|
|
|
|
{
|
|
|
|
window->null.maximized = GLFW_FALSE;
|
|
|
|
_glfwInputWindowMaximize(window, GLFW_FALSE);
|
|
|
|
}
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwMaximizeWindowNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (!window->null.maximized)
|
|
|
|
{
|
|
|
|
window->null.maximized = GLFW_TRUE;
|
|
|
|
_glfwInputWindowMaximize(window, GLFW_TRUE);
|
|
|
|
}
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwWindowMaximizedNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return window->null.maximized;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwWindowHoveredNull(_GLFWwindow* window)
|
2018-01-04 13:50:58 +01:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return _glfw.null.xcursor >= window->null.xpos &&
|
|
|
|
_glfw.null.ycursor >= window->null.ypos &&
|
|
|
|
_glfw.null.xcursor <= window->null.xpos + window->null.width - 1 &&
|
|
|
|
_glfw.null.ycursor <= window->null.ypos + window->null.height - 1;
|
2018-01-04 13:50:58 +01:00
|
|
|
}
|
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwFramebufferTransparentNull(_GLFWwindow* window)
|
2017-09-18 18:10:57 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return window->null.transparent;
|
2017-09-18 18:10:57 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowResizableNull(_GLFWwindow* window, GLFWbool enabled)
|
2016-12-06 16:11:38 +01:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.resizable = enabled;
|
2016-12-06 16:11:38 +01:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowDecoratedNull(_GLFWwindow* window, GLFWbool enabled)
|
2016-12-06 16:11:38 +01:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.decorated = enabled;
|
2016-12-06 16:11:38 +01:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowFloatingNull(_GLFWwindow* window, GLFWbool enabled)
|
2016-12-06 16:11:38 +01:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.floating = enabled;
|
2016-12-06 16:11:38 +01:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowMousePassthroughNull(_GLFWwindow* window, GLFWbool enabled)
|
2019-09-30 14:44:43 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
float _glfwGetWindowOpacityNull(_GLFWwindow* window)
|
2017-09-25 23:14:45 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return window->null.opacity;
|
2017-09-25 23:14:45 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetWindowOpacityNull(_GLFWwindow* window, float opacity)
|
2017-09-25 23:14:45 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.opacity = opacity;
|
2017-09-25 23:14:45 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetRawMouseMotionNull(_GLFWwindow *window, GLFWbool enabled)
|
2018-12-14 03:08:25 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
GLFWbool _glfwRawMouseMotionSupportedNull(void)
|
2018-12-14 03:08:25 +01:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return GLFW_TRUE;
|
2018-12-14 03:08:25 +01:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwShowWindowNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
window->null.visible = GLFW_TRUE;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwRequestWindowAttentionNull(_GLFWwindow* window)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void _glfwHideWindowNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (_glfw.null.focusedWindow == window)
|
|
|
|
{
|
|
|
|
_glfw.null.focusedWindow = NULL;
|
|
|
|
_glfwInputWindowFocus(window, GLFW_FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
window->null.visible = GLFW_FALSE;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwFocusWindowNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2021-07-13 21:50:09 +02:00
|
|
|
_GLFWwindow* previous;
|
|
|
|
|
2020-05-21 17:16:26 +02:00
|
|
|
if (_glfw.null.focusedWindow == window)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!window->null.visible)
|
|
|
|
return;
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
previous = _glfw.null.focusedWindow;
|
2020-05-21 17:16:26 +02:00
|
|
|
_glfw.null.focusedWindow = window;
|
|
|
|
|
|
|
|
if (previous)
|
|
|
|
{
|
|
|
|
_glfwInputWindowFocus(previous, GLFW_FALSE);
|
|
|
|
if (previous->monitor && previous->autoIconify)
|
2021-07-13 21:50:09 +02:00
|
|
|
_glfwIconifyWindowNull(previous);
|
2020-05-21 17:16:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
_glfwInputWindowFocus(window, GLFW_TRUE);
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwWindowFocusedNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return _glfw.null.focusedWindow == window;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwWindowIconifiedNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return window->null.iconified;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwWindowVisibleNull(_GLFWwindow* window)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return window->null.visible;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwPollEventsNull(void)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwWaitEventsNull(void)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwWaitEventsTimeoutNull(double timeout)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwPostEmptyEventNull(void)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetCursorPosNull(_GLFWwindow* window, double* xpos, double* ypos)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
if (xpos)
|
|
|
|
*xpos = _glfw.null.xcursor - window->null.xpos;
|
|
|
|
if (ypos)
|
|
|
|
*ypos = _glfw.null.ycursor - window->null.ypos;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetCursorPosNull(_GLFWwindow* window, double x, double y)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
_glfw.null.xcursor = window->null.xpos + (int) x;
|
|
|
|
_glfw.null.ycursor = window->null.ypos + (int) y;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetCursorModeNull(_GLFWwindow* window, int mode)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwCreateCursorNull(_GLFWcursor* cursor,
|
|
|
|
const GLFWimage* image,
|
|
|
|
int xhot, int yhot)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2016-11-09 00:23:19 +01:00
|
|
|
return GLFW_TRUE;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwCreateStandardCursorNull(_GLFWcursor* cursor, int shape)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2016-11-09 00:23:19 +01:00
|
|
|
return GLFW_TRUE;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwDestroyCursorNull(_GLFWcursor* cursor)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetCursorNull(_GLFWwindow* window, _GLFWcursor* cursor)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwSetClipboardStringNull(const char* string)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
char* copy = _glfw_strdup(string);
|
2021-08-03 20:53:48 +02:00
|
|
|
_glfw_free(_glfw.null.clipboardString);
|
2020-05-21 17:16:26 +02:00
|
|
|
_glfw.null.clipboardString = copy;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
const char* _glfwGetClipboardStringNull(void)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2020-05-21 17:16:26 +02:00
|
|
|
return _glfw.null.clipboardString;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
EGLenum _glfwGetEGLPlatformNull(EGLint** attribs)
|
2021-07-14 20:06:22 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
EGLNativeDisplayType _glfwGetEGLNativeDisplayNull(void)
|
2021-07-14 20:06:22 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
EGLNativeWindowType _glfwGetEGLNativeWindowNull(_GLFWwindow* window)
|
2021-07-14 20:06:22 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
const char* _glfwGetScancodeNameNull(int scancode)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2022-05-22 16:50:15 +02:00
|
|
|
if (scancode < GLFW_NULL_SC_FIRST || scancode > GLFW_NULL_SC_LAST)
|
2021-07-19 19:05:32 +02:00
|
|
|
{
|
|
|
|
_glfwInputError(GLFW_INVALID_VALUE, "Invalid scancode %i", scancode);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-05-21 17:16:26 +02:00
|
|
|
switch (scancode)
|
|
|
|
{
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_APOSTROPHE:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "'";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_COMMA:
|
2020-05-21 17:16:26 +02:00
|
|
|
return ",";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_MINUS:
|
|
|
|
case GLFW_NULL_SC_KP_SUBTRACT:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "-";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_PERIOD:
|
|
|
|
case GLFW_NULL_SC_KP_DECIMAL:
|
2020-05-21 17:16:26 +02:00
|
|
|
return ".";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_SLASH:
|
|
|
|
case GLFW_NULL_SC_KP_DIVIDE:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "/";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_SEMICOLON:
|
2020-05-21 17:16:26 +02:00
|
|
|
return ";";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_EQUAL:
|
|
|
|
case GLFW_NULL_SC_KP_EQUAL:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "=";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_LEFT_BRACKET:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "[";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_RIGHT_BRACKET:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "]";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_KP_MULTIPLY:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "*";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_KP_ADD:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "+";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_BACKSLASH:
|
|
|
|
case GLFW_NULL_SC_WORLD_1:
|
|
|
|
case GLFW_NULL_SC_WORLD_2:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "\\";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_0:
|
|
|
|
case GLFW_NULL_SC_KP_0:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "0";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_1:
|
|
|
|
case GLFW_NULL_SC_KP_1:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "1";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_2:
|
|
|
|
case GLFW_NULL_SC_KP_2:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "2";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_3:
|
|
|
|
case GLFW_NULL_SC_KP_3:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "3";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_4:
|
|
|
|
case GLFW_NULL_SC_KP_4:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "4";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_5:
|
|
|
|
case GLFW_NULL_SC_KP_5:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "5";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_6:
|
|
|
|
case GLFW_NULL_SC_KP_6:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "6";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_7:
|
|
|
|
case GLFW_NULL_SC_KP_7:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "7";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_8:
|
|
|
|
case GLFW_NULL_SC_KP_8:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "8";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_9:
|
|
|
|
case GLFW_NULL_SC_KP_9:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "9";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_A:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "a";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_B:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "b";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_C:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "c";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_D:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "d";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_E:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "e";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_F:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "f";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_G:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "g";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_H:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "h";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_I:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "i";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_J:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "j";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_K:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "k";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_L:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "l";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_M:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "m";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_N:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "n";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_O:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "o";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_P:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "p";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_Q:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "q";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_R:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "r";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_S:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "s";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_T:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "t";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_U:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "u";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_V:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "v";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_W:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "w";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_X:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "x";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_Y:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "y";
|
2022-05-22 16:50:15 +02:00
|
|
|
case GLFW_NULL_SC_Z:
|
2020-05-21 17:16:26 +02:00
|
|
|
return "z";
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
2016-08-31 00:53:19 +02:00
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
int _glfwGetKeyScancodeNull(int key)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
2022-05-22 16:50:15 +02:00
|
|
|
return _glfw.null.scancodes[key];
|
2016-10-13 17:24:51 +02:00
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
void _glfwGetRequiredInstanceExtensionsNull(char** extensions)
|
2016-10-13 17:24:51 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-05-22 14:40:00 +02:00
|
|
|
GLFWbool _glfwGetPhysicalDevicePresentationSupportNull(VkInstance instance,
|
|
|
|
VkPhysicalDevice device,
|
|
|
|
uint32_t queuefamily)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
|
|
|
return GLFW_FALSE;
|
|
|
|
}
|
|
|
|
|
2021-07-13 21:50:09 +02:00
|
|
|
VkResult _glfwCreateWindowSurfaceNull(VkInstance instance,
|
|
|
|
_GLFWwindow* window,
|
|
|
|
const VkAllocationCallbacks* allocator,
|
|
|
|
VkSurfaceKHR* surface)
|
2016-08-31 00:53:19 +02:00
|
|
|
{
|
2016-10-13 17:24:51 +02:00
|
|
|
// This seems like the most appropriate error to return here
|
2020-05-21 17:16:26 +02:00
|
|
|
return VK_ERROR_EXTENSION_NOT_PRESENT;
|
2016-08-31 00:53:19 +02:00
|
|
|
}
|
|
|
|
|