mirror of
https://github.com/glfw/glfw.git
synced 2025-10-22 08:02:27 +00:00
Fix
This commit is contained in:
parent
3bec79d0a8
commit
ac84815697
1
.gitignore
vendored
1
.gitignore
vendored
@ -102,3 +102,4 @@ tests/triangle-vulkan
|
||||
tests/window
|
||||
tests/windows
|
||||
|
||||
*.o
|
||||
|
@ -359,7 +359,7 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
|
||||
window->context.source = ctxconfig->source;
|
||||
window->context.client = GLFW_OPENGL_API;
|
||||
|
||||
previous = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
previous = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
glfwMakeContextCurrent((GLFWwindow*) window);
|
||||
if (_glfwPlatformGetTls(&_glfw.contextSlot) != window)
|
||||
return GLFW_FALSE;
|
||||
@ -620,7 +620,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
_GLFWwindow* previous;
|
||||
|
||||
previous = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
previous = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
|
||||
if (window && window->context.client == GLFW_NO_API)
|
||||
{
|
||||
@ -642,7 +642,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
|
||||
GLFWAPI GLFWwindow* glfwGetCurrentContext(void)
|
||||
{
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
return _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
return (GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
}
|
||||
|
||||
GLFWAPI void glfwSwapBuffers(GLFWwindow* handle)
|
||||
@ -668,7 +668,7 @@ GLFWAPI void glfwSwapInterval(int interval)
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
|
||||
window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
if (!window)
|
||||
{
|
||||
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,
|
||||
@ -686,7 +686,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
|
||||
|
||||
window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
if (!window)
|
||||
{
|
||||
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,
|
||||
@ -752,7 +752,7 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(NULL);
|
||||
|
||||
window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
if (!window)
|
||||
{
|
||||
_glfwInputError(GLFW_NO_CURRENT_CONTEXT,
|
||||
@ -762,4 +762,3 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname)
|
||||
|
||||
return window->context.getProcAddress(procname);
|
||||
}
|
||||
|
||||
|
@ -123,10 +123,10 @@ static GLFWbool chooseEGLConfig(const _GLFWctxconfig* ctxconfig,
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
nativeConfigs = _glfw_calloc(nativeCount, sizeof(EGLConfig));
|
||||
nativeConfigs = (EGLConfig *)_glfw_calloc(nativeCount, sizeof(EGLConfig));
|
||||
eglGetConfigs(_glfw.egl.display, nativeConfigs, nativeCount, &nativeCount);
|
||||
|
||||
usableConfigs = _glfw_calloc(nativeCount, sizeof(_GLFWfbconfig));
|
||||
usableConfigs = (_GLFWfbconfig *)_glfw_calloc(nativeCount, sizeof(_GLFWfbconfig));
|
||||
usableCount = 0;
|
||||
|
||||
for (i = 0; i < nativeCount; i++)
|
||||
@ -312,7 +312,7 @@ static int extensionSupportedEGL(const char* extension)
|
||||
|
||||
static GLFWglproc getProcAddressEGL(const char* procname)
|
||||
{
|
||||
_GLFWwindow* window = _glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
_GLFWwindow* window = (_GLFWwindow *)_glfwPlatformGetTls(&_glfw.contextSlot);
|
||||
assert(window != NULL);
|
||||
|
||||
if (window->context.egl.client)
|
||||
@ -967,4 +967,3 @@ GLFWAPI int glfwGetEGLConfig(GLFWwindow* handle, EGLConfig* config)
|
||||
*config = window->context.egl.config;
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* handle, float gamma)
|
||||
if (!original)
|
||||
return;
|
||||
|
||||
values = _glfw_calloc(original->size, sizeof(unsigned short));
|
||||
values = (unsigned short*)_glfw_calloc(original->size, sizeof(unsigned short));
|
||||
|
||||
for (i = 0; i < original->size; i++)
|
||||
{
|
||||
@ -552,4 +552,3 @@ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* handle, const GLFWgammaramp* ramp)
|
||||
|
||||
_glfw.platform.setGammaRamp(monitor, ramp);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ void _glfwGetMonitorWorkareaNull(_GLFWmonitor* monitor,
|
||||
|
||||
GLFWvidmode* _glfwGetVideoModesNull(_GLFWmonitor* monitor, int* found)
|
||||
{
|
||||
GLFWvidmode* mode = _glfw_calloc(1, sizeof(GLFWvidmode));
|
||||
GLFWvidmode* mode = (GLFWvidmode*)_glfw_calloc(1, sizeof(GLFWvidmode));
|
||||
*mode = getVideoMode();
|
||||
*found = 1;
|
||||
return mode;
|
||||
@ -157,4 +157,3 @@ void _glfwSetGammaRampNull(_GLFWmonitor* monitor, const GLFWgammaramp* ramp)
|
||||
memcpy(monitor->null.ramp.green, ramp->green, sizeof(short) * ramp->size);
|
||||
memcpy(monitor->null.ramp.blue, ramp->blue, sizeof(short) * ramp->size);
|
||||
}
|
||||
|
||||
|
@ -706,8 +706,8 @@ void _glfwGetRequiredInstanceExtensionsNull(char** extensions)
|
||||
if (!_glfw.vk.KHR_surface || !_glfw.vk.EXT_headless_surface)
|
||||
return;
|
||||
|
||||
extensions[0] = "VK_KHR_surface";
|
||||
extensions[1] = "VK_EXT_headless_surface";
|
||||
extensions[0] = (char*)"VK_KHR_surface";
|
||||
extensions[1] = (char*)"VK_EXT_headless_surface";
|
||||
}
|
||||
|
||||
GLFWbool _glfwGetPhysicalDevicePresentationSupportNull(VkInstance instance,
|
||||
@ -746,4 +746,3 @@ VkResult _glfwCreateWindowSurfaceNull(VkInstance instance,
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user