diff options
| author | hristo <[email protected]> | 2020-12-13 21:29:47 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-13 20:29:47 +0100 |
| commit | 6e79476650321cd08c6814a304887d378b54799f (patch) | |
| tree | f4a6661b55a02cbf45db88713bf22b879198894b /src/core.c | |
| parent | 11ebb54674bd78bc02ce3cf4e0e2eab96fe22f88 (diff) | |
| download | raylib-6e79476650321cd08c6814a304887d378b54799f.tar.gz raylib-6e79476650321cd08c6814a304887d378b54799f.zip | |
Fixed the build for web using CMake. (#1452)
* Fixed the build for web using CMake.
I found that the build for me was failing and I added some if defined checks in the core.c file where the glfwSetWindowAttrib was used. (error: implicit declaration of function 'glfwSetWindowAttrib' is invalid in C99 [-Werror,-Wimplicit-function-declaration])
I also changed some values in the toolchain file so that it correctly uses the .bat files when on windows.
* Cleaned up the additional variables (they are not important)
* Added more improvements to cmakelists
Added the option to use the system provided Emscripten toolchain to be more uniform with other libraries.
Fixed and issue which prevented example being built from cmake and also building with html extensions properly.
* Fixed ENUM to STRING because of a missed warning
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1133,15 +1133,19 @@ void SetWindowState(unsigned int flags) // State change: FLAG_WINDOW_RESIZABLE if (((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) != (flags & FLAG_WINDOW_RESIZABLE)) && ((flags & FLAG_WINDOW_RESIZABLE) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_RESIZABLE, GLFW_TRUE); CORE.Window.flags |= FLAG_WINDOW_RESIZABLE; +#endif } // State change: FLAG_WINDOW_UNDECORATED if (((CORE.Window.flags & FLAG_WINDOW_UNDECORATED) != (flags & FLAG_WINDOW_UNDECORATED)) && (flags & FLAG_WINDOW_UNDECORATED)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_DECORATED, GLFW_FALSE); CORE.Window.flags |= FLAG_WINDOW_UNDECORATED; +#endif } // State change: FLAG_WINDOW_HIDDEN @@ -1168,15 +1172,19 @@ void SetWindowState(unsigned int flags) // State change: FLAG_WINDOW_UNFOCUSED if (((CORE.Window.flags & FLAG_WINDOW_UNFOCUSED) != (flags & FLAG_WINDOW_UNFOCUSED)) && ((flags & FLAG_WINDOW_UNFOCUSED) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_FOCUS_ON_SHOW, GLFW_FALSE); CORE.Window.flags |= FLAG_WINDOW_UNFOCUSED; +#endif } // State change: FLAG_WINDOW_TOPMOST if (((CORE.Window.flags & FLAG_WINDOW_TOPMOST) != (flags & FLAG_WINDOW_TOPMOST)) && ((flags & FLAG_WINDOW_TOPMOST) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_FLOATING, GLFW_TRUE); CORE.Window.flags |= FLAG_WINDOW_TOPMOST; +#endif } // State change: FLAG_WINDOW_ALWAYS_RUN @@ -1234,15 +1242,19 @@ void ClearWindowState(unsigned int flags) // State change: FLAG_WINDOW_RESIZABLE if (((CORE.Window.flags & FLAG_WINDOW_RESIZABLE) > 0) && ((flags & FLAG_WINDOW_RESIZABLE) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_RESIZABLE, GLFW_FALSE); CORE.Window.flags &= ~FLAG_WINDOW_RESIZABLE; +#endif } // State change: FLAG_WINDOW_UNDECORATED if (((CORE.Window.flags & FLAG_WINDOW_UNDECORATED) > 0) && ((flags & FLAG_WINDOW_UNDECORATED) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_DECORATED, GLFW_TRUE); CORE.Window.flags &= ~FLAG_WINDOW_UNDECORATED; +#endif } // State change: FLAG_WINDOW_HIDDEN @@ -1267,15 +1279,19 @@ void ClearWindowState(unsigned int flags) // State change: FLAG_WINDOW_UNFOCUSED if (((CORE.Window.flags & FLAG_WINDOW_UNFOCUSED) > 0) && ((flags & FLAG_WINDOW_UNFOCUSED) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_FOCUS_ON_SHOW, GLFW_TRUE); CORE.Window.flags &= ~FLAG_WINDOW_UNFOCUSED; +#endif } // State change: FLAG_WINDOW_TOPMOST if (((CORE.Window.flags & FLAG_WINDOW_TOPMOST) > 0) && ((flags & FLAG_WINDOW_TOPMOST) > 0)) { +#if defined(PLATFORM_DESKTOP) glfwSetWindowAttrib(CORE.Window.handle, GLFW_FLOATING, GLFW_FALSE); CORE.Window.flags &= ~FLAG_WINDOW_TOPMOST; +#endif } // State change: FLAG_WINDOW_ALWAYS_RUN |
