mirror of
https://github.com/open-goal/jak-project
synced 2026-09-13 05:05:48 -04:00
5b44aece75
* delete unused shaders * hide some options in debug menu * change fullscreen logic a bit * add "all actors" toggle * borderless fix and fix alpha in direct renderer untextured (do we need a separate shader for that?) * fix fuel cell orbit icons in widescreen * fix `curve` types * refs * fix levitator task... * fix some task stuff * update font code a bit (temp) * cmake, third-party and visual studio overhaul * Update .gitmodules * update modules * clone repos * fix encoding in zydis * where did these come from * try again * add submodule * Update 11zip * Update 11zip * Update 11zip * delete * try again * clang * update compiler flags * delete 11zip. go away. * Create memory-dump-p2s.py * properly * fix minimum architecture c++ compiler flags * fix zydis * oops * Update all-types.gc * fix clang-cl tests * make "all actors" work better, entity debug qol * update game-text conversion code to be more modularized * Create vendor.txt * fix typos and minor things * update refs * clang * Attempt to add clang-cl support to vs2019 and CI * vs2022 + clang-cl * srsly? fix clang build * Update launch.vs.json * extend windows CI timer
190 lines
5.6 KiB
C
Vendored
Generated
190 lines
5.6 KiB
C
Vendored
Generated
//========================================================================
|
|
// GLFW 3.4 - www.glfw.org
|
|
//------------------------------------------------------------------------
|
|
// Copyright (c) 2002-2006 Marcus Geelnard
|
|
// Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org>
|
|
//
|
|
// 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.
|
|
//
|
|
//========================================================================
|
|
// Please use C89 style variable declarations in this file because VS 2010
|
|
//========================================================================
|
|
|
|
#include "internal.h"
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
////// GLFW internal API //////
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
static const struct
|
|
{
|
|
int ID;
|
|
GLFWbool (*connect)(int,_GLFWplatform*);
|
|
} supportedPlatforms[] =
|
|
{
|
|
#if defined(_GLFW_WIN32)
|
|
{ GLFW_PLATFORM_WIN32, _glfwConnectWin32 },
|
|
#endif
|
|
#if defined(_GLFW_COCOA)
|
|
{ GLFW_PLATFORM_COCOA, _glfwConnectCocoa },
|
|
#endif
|
|
#if defined(_GLFW_X11)
|
|
{ GLFW_PLATFORM_X11, _glfwConnectX11 },
|
|
#endif
|
|
#if defined(_GLFW_WAYLAND)
|
|
{ GLFW_PLATFORM_WAYLAND, _glfwConnectWayland },
|
|
#endif
|
|
};
|
|
|
|
GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform)
|
|
{
|
|
const size_t count = sizeof(supportedPlatforms) / sizeof(supportedPlatforms[0]);
|
|
size_t i;
|
|
|
|
if (desiredID != GLFW_ANY_PLATFORM &&
|
|
desiredID != GLFW_PLATFORM_WIN32 &&
|
|
desiredID != GLFW_PLATFORM_COCOA &&
|
|
desiredID != GLFW_PLATFORM_WAYLAND &&
|
|
desiredID != GLFW_PLATFORM_X11 &&
|
|
desiredID != GLFW_PLATFORM_NULL)
|
|
{
|
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid platform ID 0x%08X", desiredID);
|
|
return GLFW_FALSE;
|
|
}
|
|
|
|
// Only allow the Null platform if specifically requested
|
|
if (desiredID == GLFW_PLATFORM_NULL)
|
|
return _glfwConnectNull(desiredID, platform);
|
|
else if (count == 0)
|
|
{
|
|
_glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "This binary only supports the Null platform");
|
|
return GLFW_FALSE;
|
|
}
|
|
|
|
if (desiredID == GLFW_ANY_PLATFORM)
|
|
{
|
|
// If there is exactly one platform available for auto-selection, let it emit the
|
|
// error on failure as the platform-specific error description may be more helpful
|
|
if (count == 1)
|
|
return supportedPlatforms[0].connect(supportedPlatforms[0].ID, platform);
|
|
|
|
for (i = 0; i < count; i++)
|
|
{
|
|
if (supportedPlatforms[i].connect(desiredID, platform))
|
|
return GLFW_TRUE;
|
|
}
|
|
|
|
_glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "Failed to detect any supported platform");
|
|
}
|
|
else
|
|
{
|
|
for (i = 0; i < count; i++)
|
|
{
|
|
if (supportedPlatforms[i].ID == desiredID)
|
|
return supportedPlatforms[i].connect(desiredID, platform);
|
|
}
|
|
|
|
_glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "The requested platform is not supported");
|
|
}
|
|
|
|
return GLFW_FALSE;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
////// GLFW public API //////
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
GLFWAPI int glfwGetPlatform(void)
|
|
{
|
|
_GLFW_REQUIRE_INIT_OR_RETURN(0);
|
|
return _glfw.platform.platformID;
|
|
}
|
|
|
|
GLFWAPI int glfwPlatformSupported(int platformID)
|
|
{
|
|
const size_t count = sizeof(supportedPlatforms) / sizeof(supportedPlatforms[0]);
|
|
size_t i;
|
|
|
|
if (platformID != GLFW_PLATFORM_WIN32 &&
|
|
platformID != GLFW_PLATFORM_COCOA &&
|
|
platformID != GLFW_PLATFORM_WAYLAND &&
|
|
platformID != GLFW_PLATFORM_X11 &&
|
|
platformID != GLFW_PLATFORM_NULL)
|
|
{
|
|
_glfwInputError(GLFW_INVALID_ENUM, "Invalid platform ID 0x%08X", platformID);
|
|
return GLFW_FALSE;
|
|
}
|
|
|
|
if (platformID == GLFW_PLATFORM_NULL)
|
|
return GLFW_TRUE;
|
|
|
|
for (i = 0; i < count; i++)
|
|
{
|
|
if (platformID == supportedPlatforms[i].ID)
|
|
return GLFW_TRUE;
|
|
}
|
|
|
|
return GLFW_FALSE;
|
|
}
|
|
|
|
GLFWAPI const char* glfwGetVersionString(void)
|
|
{
|
|
return _GLFW_VERSION_NUMBER
|
|
#if defined(_GLFW_WIN32)
|
|
" Win32 WGL"
|
|
#endif
|
|
#if defined(_GLFW_COCOA)
|
|
" Cocoa NSGL"
|
|
#endif
|
|
#if defined(_GLFW_WAYLAND)
|
|
" Wayland"
|
|
#endif
|
|
#if defined(_GLFW_X11)
|
|
" X11 GLX"
|
|
#endif
|
|
" Null"
|
|
" EGL"
|
|
" OSMesa"
|
|
#if defined(__MINGW64_VERSION_MAJOR)
|
|
" MinGW-w64"
|
|
#elif defined(__MINGW32__)
|
|
" MinGW"
|
|
#elif defined(_MSC_VER)
|
|
" VisualC"
|
|
#endif
|
|
#if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG)
|
|
" hybrid-GPU"
|
|
#endif
|
|
#if defined(_POSIX_MONOTONIC_CLOCK)
|
|
" monotonic"
|
|
#endif
|
|
#if defined(_GLFW_BUILD_DLL)
|
|
#if defined(_WIN32)
|
|
" DLL"
|
|
#elif defined(__APPLE__)
|
|
" dynamic"
|
|
#else
|
|
" shared"
|
|
#endif
|
|
#endif
|
|
;
|
|
}
|
|
|