mirror of https://github.com/raysan5/raylib
Merge branch 'master' of https://github.com/raysan5/raylib
This commit is contained in:
commit
f0ab4723b9
|
@ -86,4 +86,5 @@ cmake_dependent_option(SUPPORT_FILEFORMAT_MP3 "Support loading MP3 for sound" O
|
|||
cmake_dependent_option(SUPPORT_FILEFORMAT_FLAC "Support loading FLAC for sound" ${OFF} CUSTOMIZE_BUILD OFF)
|
||||
|
||||
# utils.c
|
||||
cmake_dependent_option(SUPPORT_STANDARD_FILEIO "Support standard file io library (stdio.h)" ON CUSTOMIZE_BUILD ON)
|
||||
cmake_dependent_option(SUPPORT_TRACELOG "Show TraceLog() output messages. NOTE: By default LOG_DEBUG traces not shown" ON CUSTOMIZE_BUILD ON)
|
||||
|
|
|
@ -54,6 +54,7 @@ if (${CUSTOMIZE_BUILD})
|
|||
define_if("raylib" SUPPORT_FILEFORMAT_MOD)
|
||||
define_if("raylib" SUPPORT_FILEFORMAT_FLAC)
|
||||
define_if("raylib" SUPPORT_FILEFORMAT_MP3)
|
||||
define_if("raylib" SUPPORT_STANDARD_FILEIO)
|
||||
define_if("raylib" SUPPORT_TRACELOG)
|
||||
define_if("raylib" SUPPORT_COMPRESSION_API)
|
||||
|
||||
|
|
34
src/core.c
34
src/core.c
|
@ -1044,31 +1044,31 @@ void ToggleFullscreen(void)
|
|||
if (!monitor)
|
||||
{
|
||||
TRACELOG(LOG_WARNING, "GLFW: Failed to get monitor");
|
||||
glfwSetWindowSizeCallback(CORE.Window.handle, NULL);
|
||||
glfwSetWindowMonitor(CORE.Window.handle, glfwGetPrimaryMonitor(), 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
glfwSetWindowSizeCallback(CORE.Window.handle, WindowSizeCallback);
|
||||
|
||||
CORE.Window.fullscreen = false; // Toggle fullscreen flag
|
||||
CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE;
|
||||
|
||||
glfwSetWindowMonitor(CORE.Window.handle, NULL, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
return;
|
||||
}
|
||||
|
||||
const GLFWvidmode *mode = glfwGetVideoMode(monitor);
|
||||
glfwSetWindowSizeCallback(CORE.Window.handle, NULL);
|
||||
CORE.Window.fullscreen = true; // Toggle fullscreen flag
|
||||
CORE.Window.flags |= FLAG_FULLSCREEN_MODE;
|
||||
|
||||
glfwSetWindowMonitor(CORE.Window.handle, monitor, 0, 0, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
glfwSetWindowSizeCallback(CORE.Window.handle, WindowSizeCallback);
|
||||
}
|
||||
else
|
||||
{
|
||||
glfwSetWindowSizeCallback(CORE.Window.handle, NULL);
|
||||
CORE.Window.fullscreen = false; // Toggle fullscreen flag
|
||||
CORE.Window.flags &= ~FLAG_FULLSCREEN_MODE;
|
||||
|
||||
glfwSetWindowMonitor(CORE.Window.handle, NULL, CORE.Window.position.x, CORE.Window.position.y, CORE.Window.screen.width, CORE.Window.screen.height, GLFW_DONT_CARE);
|
||||
glfwSetWindowSizeCallback(CORE.Window.handle, WindowSizeCallback);
|
||||
}
|
||||
|
||||
// Try to enable GPU V-Sync, so frames are limited to screen refresh rate (60Hz -> 60 FPS)
|
||||
// NOTE: V-Sync can be enabled by graphic driver configuration
|
||||
if (CORE.Window.flags & FLAG_VSYNC_HINT) glfwSwapInterval(1);
|
||||
|
||||
CORE.Window.fullscreen = !CORE.Window.fullscreen; // Toggle fullscreen flag
|
||||
CORE.Window.flags ^= FLAG_FULLSCREEN_MODE;
|
||||
|
||||
#endif
|
||||
#if defined(PLATFORM_WEB)
|
||||
/*
|
||||
|
@ -4619,16 +4619,18 @@ static void ErrorCallback(int error, const char *description)
|
|||
static void WindowSizeCallback(GLFWwindow *window, int width, int height)
|
||||
{
|
||||
SetupViewport(width, height); // Reset viewport and projection matrix for new size
|
||||
|
||||
CORE.Window.currentFbo.width = width;
|
||||
CORE.Window.currentFbo.height = height;
|
||||
CORE.Window.resizedLastFrame = true;
|
||||
|
||||
if(IsWindowFullscreen())
|
||||
return;
|
||||
|
||||
// Set current screen size
|
||||
CORE.Window.screen.width = width;
|
||||
CORE.Window.screen.height = height;
|
||||
CORE.Window.currentFbo.width = width;
|
||||
CORE.Window.currentFbo.height = height;
|
||||
|
||||
// NOTE: Postprocessing texture is not scaled to new size
|
||||
|
||||
CORE.Window.resizedLastFrame = true;
|
||||
}
|
||||
|
||||
// GLFW3 WindowIconify Callback, runs when window is minimized/restored
|
||||
|
|
Loading…
Reference in New Issue