From c3cba58a710fb08f3128785208adaf429d5e2eb9 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Fri, 17 Nov 2017 03:34:18 +0000 Subject: [PATCH] Remove trailing whitespace --- .gitattributes | 2 +- CMake/amd64-mingw32msvc.cmake | 2 +- CMake/i586-mingw32msvc.cmake | 2 +- CMake/i686-pc-mingw32.cmake | 2 +- CMake/i686-w64-mingw32.cmake | 2 +- CMake/x86_64-w64-mingw32.cmake | 2 +- LICENSE.md | 2 +- README.md | 2 +- docs/CMakeLists.txt | 2 +- docs/DoxygenLayout.xml | 4 +- docs/compat.dox | 2 +- docs/context.dox | 2 +- docs/input.dox | 4 +- docs/internal.dox | 2 +- docs/intro.dox | 8 +- docs/monitor.dox | 2 +- docs/moving.dox | 6 +- docs/quick.dox | 4 +- docs/vulkan.dox | 6 +- docs/window.dox | 4 +- examples/glfw.rc | 6 +- include/GLFW/glfw3.h | 18 +-- src/mappings.h | 2 +- src/mappings.h.in | 2 +- tests/opacity.c | 212 ++++++++++++++++----------------- tests/vulkan.c | 2 +- 26 files changed, 152 insertions(+), 152 deletions(-) diff --git a/.gitattributes b/.gitattributes index 96200d24..64a3446f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -*.m linguist-language=Objective-C +*.m linguist-language=Objective-C diff --git a/CMake/amd64-mingw32msvc.cmake b/CMake/amd64-mingw32msvc.cmake index 705e251d..c264ff0d 100644 --- a/CMake/amd64-mingw32msvc.cmake +++ b/CMake/amd64-mingw32msvc.cmake @@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++") SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres") SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib") -# Configure the behaviour of the find commands +# Configure the behaviour of the find commands SET(CMAKE_FIND_ROOT_PATH "/usr/amd64-mingw32msvc") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/CMake/i586-mingw32msvc.cmake b/CMake/i586-mingw32msvc.cmake index 393ddbda..c871e5be 100644 --- a/CMake/i586-mingw32msvc.cmake +++ b/CMake/i586-mingw32msvc.cmake @@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++") SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres") SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib") -# Configure the behaviour of the find commands +# Configure the behaviour of the find commands SET(CMAKE_FIND_ROOT_PATH "/usr/i586-mingw32msvc") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/CMake/i686-pc-mingw32.cmake b/CMake/i686-pc-mingw32.cmake index 9a46aef7..b657d944 100644 --- a/CMake/i686-pc-mingw32.cmake +++ b/CMake/i686-pc-mingw32.cmake @@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++") SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres") SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib") -#Configure the behaviour of the find commands +#Configure the behaviour of the find commands SET(CMAKE_FIND_ROOT_PATH "/opt/mingw/usr/i686-pc-mingw32") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/CMake/i686-w64-mingw32.cmake b/CMake/i686-w64-mingw32.cmake index 9bd60936..bbd9f895 100644 --- a/CMake/i686-w64-mingw32.cmake +++ b/CMake/i686-w64-mingw32.cmake @@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") -# Configure the behaviour of the find commands +# Configure the behaviour of the find commands SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/CMake/x86_64-w64-mingw32.cmake b/CMake/x86_64-w64-mingw32.cmake index 84b2c701..e629e457 100644 --- a/CMake/x86_64-w64-mingw32.cmake +++ b/CMake/x86_64-w64-mingw32.cmake @@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") -# Configure the behaviour of the find commands +# Configure the behaviour of the find commands SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) diff --git a/LICENSE.md b/LICENSE.md index e4c6682e..acdac20b 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,4 +1,4 @@ -Copyright (c) 2002-2006 Marcus Geelnard +Copyright (c) 2002-2006 Marcus Geelnard Copyright (c) 2006-2016 Camilla Löwy This software is provided 'as-is', without any express or implied diff --git a/README.md b/README.md index 638d956f..2ccf1e8f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ creating windows, contexts and surfaces, reading input, handling events, etc. GLFW natively supports Windows, macOS and Linux and other Unix-like systems. Experimental implementations for the Wayland protocol and the Mir display server -are available but not yet officially supported. +are available but not yet officially supported. GLFW is licensed under the [zlib/libpng license](http://www.glfw.org/license.html). diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 20d85ae9..6bb849f1 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -27,7 +27,7 @@ foreach(arg ${glfw_DOCS_SOURCES}) endforeach() configure_file(Doxyfile.in Doxyfile @ONLY) - + add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}" WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs" COMMENT "Generating HTML documentation" VERBATIM) diff --git a/docs/DoxygenLayout.xml b/docs/DoxygenLayout.xml index 7917f91e..a7e17530 100644 --- a/docs/DoxygenLayout.xml +++ b/docs/DoxygenLayout.xml @@ -11,7 +11,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/docs/compat.dox b/docs/compat.dox index 38024466..50b82c5d 100644 --- a/docs/compat.dox +++ b/docs/compat.dox @@ -78,7 +78,7 @@ fallback path is used. GLFW uses the XInput2 extension to provide raw, non-accelerated mouse motion when the cursor is disabled. If the running X server does not support this -extension, regular accelerated mouse motion will be used. +extension, regular accelerated mouse motion will be used. GLFW uses both the XRender extension and the compositing manager to support transparent window framebuffers. If the running X server does not support this diff --git a/docs/context.dox b/docs/context.dox index e94448dc..5e1eb25c 100644 --- a/docs/context.dox +++ b/docs/context.dox @@ -161,7 +161,7 @@ An extension loader library is the easiest and best way to access both OpenGL an OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs. They will take care of all the details of declaring and loading everything you need. One such library is [glad](https://github.com/Dav1dde/glad) and there are -several others. +several others. The following example will use glad but all extension loader libraries work similarly. diff --git a/docs/input.dox b/docs/input.dox index 0c00494f..bb486b2f 100644 --- a/docs/input.dox +++ b/docs/input.dox @@ -1,7 +1,7 @@ /*! @page input_guide Input guide - + @tableofcontents This guide introduces the input related functions of GLFW. For details on @@ -602,7 +602,7 @@ See the reference documentation for @ref glfwGetJoystickButtons for details. The human-readable, UTF-8 encoded name of a joystick is returned by @ref glfwGetJoystickName. See the reference documentation for the lifetime of the -returned string. +returned string. @code const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4); diff --git a/docs/internal.dox b/docs/internal.dox index 72a09540..9118492f 100644 --- a/docs/internal.dox +++ b/docs/internal.dox @@ -111,6 +111,6 @@ which is generated from the `glfw_config.h.in` file by CMake. Configuration macros the same style as tokens in the public interface, except with a leading underscore. -Examples: `_GLFW_USE_HYBRID_HPG` +Examples: `_GLFW_USE_HYBRID_HPG` */ diff --git a/docs/intro.dox b/docs/intro.dox index 46a445aa..c08717ca 100644 --- a/docs/intro.dox +++ b/docs/intro.dox @@ -1,7 +1,7 @@ -/*! +/*! @page intro_guide Introduction to the API - + @tableofcontents This guide introduces the basic concepts of GLFW and describes initialization, @@ -140,7 +140,7 @@ any other resources allocated by GLFW. Once the library is terminated, it is as if it had never been initialized and you will need to initialize it again before being able to use GLFW. If the library was not initialized or had already been terminated, it return -immediately. +immediately. @section error_handling Error handling @@ -307,7 +307,7 @@ calls main), but some may be called from any thread once the library has been initialized. Before initialization the whole library is thread-unsafe. The reference documentation for every GLFW function states whether it is limited -to the main thread. +to the main thread. Initialization, termination, event processing and the creation and destruction of windows, cursors and OpenGL and OpenGL ES contexts are all diff --git a/docs/monitor.dox b/docs/monitor.dox index 620646d5..3aa9a775 100644 --- a/docs/monitor.dox +++ b/docs/monitor.dox @@ -157,7 +157,7 @@ any UI elements. The content scale may depend on both the monitor resolution and pixel density and on user settings. It may be very different from the raw DPI calculated from -the physical size and current resolution. +the physical size and current resolution. @subsection monitor_pos Virtual position diff --git a/docs/moving.dox b/docs/moving.dox index 0f33a7e5..08ef7f24 100644 --- a/docs/moving.dox +++ b/docs/moving.dox @@ -40,7 +40,7 @@ time away from the focus of GLFW (i.e. context, input and window). There are better threading libraries available and native threading support is available in both [C++11](http://en.cppreference.com/w/cpp/thread) and [C11](http://en.cppreference.com/w/c/thread), both of which are gaining -traction. +traction. If you wish to use the C++11 or C11 facilities but your compiler doesn't yet support them, see the @@ -73,7 +73,7 @@ To become of sufficiently high quality to warrant keeping them in GLFW 3, they would need not only to support other formats, but also modern extensions to OpenGL texturing. This would either add a number of external dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions -of these libraries. +of these libraries. As there already are libraries doing this, it is unnecessary both to duplicate the work and to tie the duplicate to GLFW. The resulting library would also be @@ -92,7 +92,7 @@ has been removed. GLFW is written in C, not Pascal. Removing this macro means there's one less thing for application programmers to remember, i.e. the requirement to mark all callback functions with `GLFWCALL`. It also simplifies the creation of DLLs and DLL link libraries, as there's no need to explicitly -disable `@n` entry point suffixes. +disable `@n` entry point suffixes. @par Old syntax @code diff --git a/docs/quick.dox b/docs/quick.dox index ff2c6f06..d8c33822 100644 --- a/docs/quick.dox +++ b/docs/quick.dox @@ -174,7 +174,7 @@ If you are using an [extension loader library](@ref context_glext_auto) to access modern OpenGL then this is when to initialize it, as the loader needs a current context to load from. This example uses [glad](https://github.com/Dav1dde/glad), but the same rule applies to all such -libraries. +libraries. @code gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); @@ -309,7 +309,7 @@ done each frame after buffer swapping. There are two methods for processing pending events; polling and waiting. This example will use event polling, which processes only those events that have -already been received and then returns immediately. +already been received and then returns immediately. @code glfwPollEvents(); diff --git a/docs/vulkan.dox b/docs/vulkan.dox index 7de9cd64..8c198bef 100644 --- a/docs/vulkan.dox +++ b/docs/vulkan.dox @@ -1,7 +1,7 @@ /*! @page vulkan_guide Vulkan guide - + @tableofcontents This guide is intended to fill the gaps between the [Vulkan @@ -180,7 +180,7 @@ ici.ppEnabledExtensionNames = extensions; Additional extensions may be required by future versions of GLFW. You should check whether any extensions you wish to enable are already in the returned array, as it is an error to specify an extension more than once in the -`VkInstanceCreateInfo` struct. +`VkInstanceCreateInfo` struct. @section vulkan_present Querying for Vulkan presentation support @@ -197,7 +197,7 @@ if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_fa } @endcode -The `VK_KHR_surface` extension additionally provides the +The `VK_KHR_surface` extension additionally provides the `vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on an existing Vulkan surface. diff --git a/docs/window.dox b/docs/window.dox index db29d611..94828956 100644 --- a/docs/window.dox +++ b/docs/window.dox @@ -1,7 +1,7 @@ /*! @page window_guide Window guide - + @tableofcontents This guide introduces the window related functions of GLFW. For details on @@ -48,7 +48,7 @@ the event. To create a full screen window, you need to specify which monitor the window should use. In most cases, the user's primary monitor is a good choice. -For more information about retrieving monitors, see @ref monitor_monitors. +For more information about retrieving monitors, see @ref monitor_monitors. @code GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL); diff --git a/examples/glfw.rc b/examples/glfw.rc index ab88e4ea..f2b62f6c 100644 --- a/examples/glfw.rc +++ b/examples/glfw.rc @@ -1,3 +1,3 @@ - -GLFW_ICON ICON "glfw.ico" - + +GLFW_ICON ICON "glfw.ico" + diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 07f8b172..c5263f70 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -1067,7 +1067,7 @@ extern "C" { * @sa @ref glfwGetProcAddress * * @since Added in version 3.0. - + * * @ingroup context */ typedef void (*GLFWglproc)(void); @@ -1654,7 +1654,7 @@ GLFWAPI void glfwTerminate(void); * * Some hints are platform specific. These may be set on any platform but they * will only affect their specific platform. Other platforms will ignore them. - * Setting these hints requires no platform specific headers or functions. + * Setting these hints requires no platform specific headers or functions. * * @param[in] hint The [init hint](@ref init_hints) to set. * @param[in] value The new value of the init hint. @@ -1688,7 +1688,7 @@ GLFWAPI void glfwInitHint(int hint, int value); * * Some hints are platform specific. These may be set on any platform but they * will only affect their specific platform. Other platforms will ignore them. - * Setting these hints requires no platform specific headers or functions. + * Setting these hints requires no platform specific headers or functions. * * @param[in] hint The [init hint](@ref init_hints) to set. * @param[in] value The new value of the init hint. @@ -3226,7 +3226,7 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); * The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib), * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and - * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib). + * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib). * * Some of these attributes are ignored for full screen windows. The new * value will take effect if the window is later made windowed. @@ -4476,10 +4476,10 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count); * it with the corresponding direction. * * @code - * if (hats[2] & GLFW_HAT_RIGHT) - * { - * // State of hat 2 could be right-up, right or right-down - * } + * if (hats[2] & GLFW_HAT_RIGHT) + * { + * // State of hat 2 could be right-up, right or right-down + * } * @endcode * * If the specified joystick is not present this function will return `NULL` @@ -4859,7 +4859,7 @@ GLFWAPI void glfwSetTime(double time); * 1 / frequency seconds. To get the frequency, call @ref * glfwGetTimerFrequency. * - * @return The value of the timer, or zero if an + * @return The value of the timer, or zero if an * [error](@ref error_handling) occurred. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. diff --git a/src/mappings.h b/src/mappings.h index dd747608..9563df83 100644 --- a/src/mappings.h +++ b/src/mappings.h @@ -51,7 +51,7 @@ // 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. +// 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. diff --git a/src/mappings.h.in b/src/mappings.h.in index 207d40b9..eb6c32f7 100644 --- a/src/mappings.h.in +++ b/src/mappings.h.in @@ -51,7 +51,7 @@ // 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. +// 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. diff --git a/tests/opacity.c b/tests/opacity.c index 3176c9ff..4a615ae6 100644 --- a/tests/opacity.c +++ b/tests/opacity.c @@ -1,106 +1,106 @@ -//======================================================================== -// Window opacity test program -// Copyright (c) Camilla Löwy -// -// 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. -// -//======================================================================== - -#include -#include - -#define NK_IMPLEMENTATION -#define NK_INCLUDE_FIXED_TYPES -#define NK_INCLUDE_FONT_BAKING -#define NK_INCLUDE_DEFAULT_FONT -#define NK_INCLUDE_DEFAULT_ALLOCATOR -#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT -#define NK_INCLUDE_STANDARD_VARARGS -#include - -#define NK_GLFW_GL2_IMPLEMENTATION -#include - -#include -#include - -static void error_callback(int error, const char* description) -{ - fprintf(stderr, "Error: %s\n", description); -} - -int main(int argc, char** argv) -{ - GLFWmonitor* monitor = NULL; - GLFWwindow* window; - struct nk_context* nk; - struct nk_font_atlas* atlas; - - glfwSetErrorCallback(error_callback); - - if (!glfwInit()) - exit(EXIT_FAILURE); - - window = glfwCreateWindow(400, 400, "Opacity", NULL, NULL); - if (!window) - { - glfwTerminate(); - exit(EXIT_FAILURE); - } - - glfwMakeContextCurrent(window); - gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); - glfwSwapInterval(1); - - nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); - nk_glfw3_font_stash_begin(&atlas); - nk_glfw3_font_stash_end(); - - while (!glfwWindowShouldClose(window)) - { - int width, height; - struct nk_rect area; - - glfwGetWindowSize(window, &width, &height); - area = nk_rect(0.f, 0.f, (float) width, (float) height); - - glClear(GL_COLOR_BUFFER_BIT); - nk_glfw3_new_frame(); - if (nk_begin(nk, "", area, 0)) - { - float opacity = glfwGetWindowOpacity(window); - nk_layout_row_dynamic(nk, 30, 2); - if (nk_slider_float(nk, 0.f, &opacity, 1.f, 0.001f)) - glfwSetWindowOpacity(window, opacity); - nk_labelf(nk, NK_TEXT_LEFT, "%0.3f", opacity); - } - - nk_end(nk); - nk_glfw3_render(NK_ANTI_ALIASING_ON); - - glfwSwapBuffers(window); - glfwWaitEventsTimeout(1.0); - } - - nk_glfw3_shutdown(); - glfwTerminate(); - exit(EXIT_SUCCESS); -} - +//======================================================================== +// Window opacity test program +// Copyright (c) Camilla Löwy +// +// 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. +// +//======================================================================== + +#include +#include + +#define NK_IMPLEMENTATION +#define NK_INCLUDE_FIXED_TYPES +#define NK_INCLUDE_FONT_BAKING +#define NK_INCLUDE_DEFAULT_FONT +#define NK_INCLUDE_DEFAULT_ALLOCATOR +#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT +#define NK_INCLUDE_STANDARD_VARARGS +#include + +#define NK_GLFW_GL2_IMPLEMENTATION +#include + +#include +#include + +static void error_callback(int error, const char* description) +{ + fprintf(stderr, "Error: %s\n", description); +} + +int main(int argc, char** argv) +{ + GLFWmonitor* monitor = NULL; + GLFWwindow* window; + struct nk_context* nk; + struct nk_font_atlas* atlas; + + glfwSetErrorCallback(error_callback); + + if (!glfwInit()) + exit(EXIT_FAILURE); + + window = glfwCreateWindow(400, 400, "Opacity", NULL, NULL); + if (!window) + { + glfwTerminate(); + exit(EXIT_FAILURE); + } + + glfwMakeContextCurrent(window); + gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); + glfwSwapInterval(1); + + nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); + nk_glfw3_font_stash_begin(&atlas); + nk_glfw3_font_stash_end(); + + while (!glfwWindowShouldClose(window)) + { + int width, height; + struct nk_rect area; + + glfwGetWindowSize(window, &width, &height); + area = nk_rect(0.f, 0.f, (float) width, (float) height); + + glClear(GL_COLOR_BUFFER_BIT); + nk_glfw3_new_frame(); + if (nk_begin(nk, "", area, 0)) + { + float opacity = glfwGetWindowOpacity(window); + nk_layout_row_dynamic(nk, 30, 2); + if (nk_slider_float(nk, 0.f, &opacity, 1.f, 0.001f)) + glfwSetWindowOpacity(window, opacity); + nk_labelf(nk, NK_TEXT_LEFT, "%0.3f", opacity); + } + + nk_end(nk); + nk_glfw3_render(NK_ANTI_ALIASING_ON); + + glfwSwapBuffers(window); + glfwWaitEventsTimeout(1.0); + } + + nk_glfw3_shutdown(); + glfwTerminate(); + exit(EXIT_SUCCESS); +} + diff --git a/tests/vulkan.c b/tests/vulkan.c index d0d4b3e3..13a7ec2b 100644 --- a/tests/vulkan.c +++ b/tests/vulkan.c @@ -738,7 +738,7 @@ static void demo_prepare_buffers(struct demo *demo) { } else if (swapchainExtent.width > surfCapabilities.maxImageExtent.width) { swapchainExtent.width = surfCapabilities.maxImageExtent.width; } - + if (swapchainExtent.height < surfCapabilities.minImageExtent.height) { swapchainExtent.height = surfCapabilities.minImageExtent.height; } else if (swapchainExtent.height > surfCapabilities.maxImageExtent.height) {