1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-22 18:28:52 -05:00

Remove trailing whitespace

This commit is contained in:
Emmanuel Gil Peyrot 2017-11-17 03:34:18 +00:00 committed by Camilla Löwy
parent ce4672d74b
commit c3cba58a71
26 changed files with 152 additions and 152 deletions

2
.gitattributes vendored
View File

@ -1 +1 @@
*.m linguist-language=Objective-C *.m linguist-language=Objective-C

View File

@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "amd64-mingw32msvc-g++")
SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres") SET(CMAKE_RC_COMPILER "amd64-mingw32msvc-windres")
SET(CMAKE_RANLIB "amd64-mingw32msvc-ranlib") 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 "/usr/amd64-mingw32msvc")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i586-mingw32msvc-g++")
SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres") SET(CMAKE_RC_COMPILER "i586-mingw32msvc-windres")
SET(CMAKE_RANLIB "i586-mingw32msvc-ranlib") 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 "/usr/i586-mingw32msvc")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i686-pc-mingw32-g++")
SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres") SET(CMAKE_RC_COMPILER "i686-pc-mingw32-windres")
SET(CMAKE_RANLIB "i686-pc-mingw32-ranlib") 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 "/opt/mingw/usr/i686-pc-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 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 "/usr/i686-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 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 "/usr/x86_64-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

View File

@ -1,4 +1,4 @@
Copyright (c) 2002-2006 Marcus Geelnard Copyright (c) 2002-2006 Marcus Geelnard
Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org> Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied

View File

@ -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. GLFW natively supports Windows, macOS and Linux and other Unix-like systems.
Experimental implementations for the Wayland protocol and the Mir display server 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 GLFW is licensed under the [zlib/libpng
license](http://www.glfw.org/license.html). license](http://www.glfw.org/license.html).

View File

@ -27,7 +27,7 @@ foreach(arg ${glfw_DOCS_SOURCES})
endforeach() endforeach()
configure_file(Doxyfile.in Doxyfile @ONLY) configure_file(Doxyfile.in Doxyfile @ONLY)
add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}" add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}"
WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs" WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs"
COMMENT "Generating HTML documentation" VERBATIM) COMMENT "Generating HTML documentation" VERBATIM)

View File

@ -11,7 +11,7 @@
</tab> </tab>
<tab type="classes" visible="no" title=""> <tab type="classes" visible="no" title="">
<tab type="classlist" visible="yes" title="" intro=""/> <tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/> <tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/> <tab type="classmembers" visible="yes" title="" intro=""/>
</tab> </tab>
@ -19,7 +19,7 @@
<tab type="filelist" visible="yes" title="" intro=""/> <tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/> <tab type="globals" visible="yes" title="" intro=""/>
</tab> </tab>
<tab type="examples" visible="yes" title="" intro=""/> <tab type="examples" visible="yes" title="" intro=""/>
</navindex> </navindex>
<!-- Layout definition for a class page --> <!-- Layout definition for a class page -->

View File

@ -78,7 +78,7 @@ fallback path is used.
GLFW uses the XInput2 extension to provide raw, non-accelerated mouse motion 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 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 GLFW uses both the XRender extension and the compositing manager to support
transparent window framebuffers. If the running X server does not support this transparent window framebuffers. If the running X server does not support this

View File

@ -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. 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 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 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 The following example will use glad but all extension loader libraries work
similarly. similarly.

View File

@ -1,7 +1,7 @@
/*! /*!
@page input_guide Input guide @page input_guide Input guide
@tableofcontents @tableofcontents
This guide introduces the input related functions of GLFW. For details on 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 The human-readable, UTF-8 encoded name of a joystick is returned by @ref
glfwGetJoystickName. See the reference documentation for the lifetime of the glfwGetJoystickName. See the reference documentation for the lifetime of the
returned string. returned string.
@code @code
const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4); const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4);

View File

@ -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 Configuration macros the same style as tokens in the public interface, except
with a leading underscore. with a leading underscore.
Examples: `_GLFW_USE_HYBRID_HPG` Examples: `_GLFW_USE_HYBRID_HPG`
*/ */

View File

@ -1,7 +1,7 @@
/*! /*!
@page intro_guide Introduction to the API @page intro_guide Introduction to the API
@tableofcontents @tableofcontents
This guide introduces the basic concepts of GLFW and describes initialization, 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 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 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 library was not initialized or had already been terminated, it return
immediately. immediately.
@section error_handling Error handling @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. initialized. Before initialization the whole library is thread-unsafe.
The reference documentation for every GLFW function states whether it is limited 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 Initialization, termination, event processing and the creation and
destruction of windows, cursors and OpenGL and OpenGL ES contexts are all destruction of windows, cursors and OpenGL and OpenGL ES contexts are all

View File

@ -157,7 +157,7 @@ any UI elements.
The content scale may depend on both the monitor resolution and pixel density 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 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 @subsection monitor_pos Virtual position

View File

@ -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 better threading libraries available and native threading support is available
in both [C++11](http://en.cppreference.com/w/cpp/thread) and 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 [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 If you wish to use the C++11 or C11 facilities but your compiler doesn't yet
support them, see the 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 would need not only to support other formats, but also modern extensions to
OpenGL texturing. This would either add a number of external OpenGL texturing. This would either add a number of external
dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions 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 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 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 there's one less thing for application programmers to remember, i.e. the
requirement to mark all callback functions with `GLFWCALL`. It also simplifies 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 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 @par Old syntax
@code @code

View File

@ -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 access modern OpenGL then this is when to initialize it, as the loader needs
a current context to load from. This example uses a current context to load from. This example uses
[glad](https://github.com/Dav1dde/glad), but the same rule applies to all such [glad](https://github.com/Dav1dde/glad), but the same rule applies to all such
libraries. libraries.
@code @code
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); 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 There are two methods for processing pending events; polling and waiting. This
example will use event polling, which processes only those events that have 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 @code
glfwPollEvents(); glfwPollEvents();

View File

@ -1,7 +1,7 @@
/*! /*!
@page vulkan_guide Vulkan guide @page vulkan_guide Vulkan guide
@tableofcontents @tableofcontents
This guide is intended to fill the gaps between the [Vulkan 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 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 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 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 @section vulkan_present Querying for Vulkan presentation support
@ -197,7 +197,7 @@ if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_fa
} }
@endcode @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 `vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on
an existing Vulkan surface. an existing Vulkan surface.

View File

@ -1,7 +1,7 @@
/*! /*!
@page window_guide Window guide @page window_guide Window guide
@tableofcontents @tableofcontents
This guide introduces the window related functions of GLFW. For details on 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 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. 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 @code
GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL); GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL);

View File

@ -1,3 +1,3 @@
GLFW_ICON ICON "glfw.ico" GLFW_ICON ICON "glfw.ico"

View File

@ -1067,7 +1067,7 @@ extern "C" {
* @sa @ref glfwGetProcAddress * @sa @ref glfwGetProcAddress
* *
* @since Added in version 3.0. * @since Added in version 3.0.
*
* @ingroup context * @ingroup context
*/ */
typedef void (*GLFWglproc)(void); 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 * 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. * 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] hint The [init hint](@ref init_hints) to set.
* @param[in] value The new value of the init hint. * @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 * 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. * 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] hint The [init hint](@ref init_hints) to set.
* @param[in] value The new value of the init hint. * @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), * The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
* [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
* [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and * [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 * Some of these attributes are ignored for full screen windows. The new
* value will take effect if the window is later made windowed. * 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. * it with the corresponding direction.
* *
* @code * @code
* if (hats[2] & GLFW_HAT_RIGHT) * if (hats[2] & GLFW_HAT_RIGHT)
* { * {
* // State of hat 2 could be right-up, right or right-down * // State of hat 2 could be right-up, right or right-down
* } * }
* @endcode * @endcode
* *
* If the specified joystick is not present this function will return `NULL` * If the specified joystick is not present this function will return `NULL`
@ -4859,7 +4859,7 @@ GLFWAPI void glfwSetTime(double time);
* 1&nbsp;/&nbsp;frequency seconds. To get the frequency, call @ref * 1&nbsp;/&nbsp;frequency seconds. To get the frequency, call @ref
* glfwGetTimerFrequency. * 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. * [error](@ref error_handling) occurred.
* *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.

View File

@ -51,7 +51,7 @@
// 1. The origin of this software must not be misrepresented; you must not // 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 // claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would // 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 // 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software. // misrepresented as being the original software.

View File

@ -51,7 +51,7 @@
// 1. The origin of this software must not be misrepresented; you must not // 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 // claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would // 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 // 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software. // misrepresented as being the original software.

View File

@ -1,106 +1,106 @@
//======================================================================== //========================================================================
// Window opacity test program // Window opacity test program
// Copyright (c) Camilla Löwy <elmindreda@glfw.org> // Copyright (c) Camilla Löwy <elmindreda@glfw.org>
// //
// This software is provided 'as-is', without any express or implied // This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages // warranty. In no event will the authors be held liable for any damages
// arising from the use of this software. // arising from the use of this software.
// //
// Permission is granted to anyone to use this software for any purpose, // Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it // including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions: // freely, subject to the following restrictions:
// //
// 1. The origin of this software must not be misrepresented; you must not // 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 // claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would // 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 // 2. Altered source versions must be plainly marked as such, and must not
// be misrepresented as being the original software. // be misrepresented as being the original software.
// //
// 3. This notice may not be removed or altered from any source // 3. This notice may not be removed or altered from any source
// distribution. // distribution.
// //
//======================================================================== //========================================================================
#include <glad/glad.h> #include <glad/glad.h>
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#define NK_IMPLEMENTATION #define NK_IMPLEMENTATION
#define NK_INCLUDE_FIXED_TYPES #define NK_INCLUDE_FIXED_TYPES
#define NK_INCLUDE_FONT_BAKING #define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_DEFAULT_FONT #define NK_INCLUDE_DEFAULT_FONT
#define NK_INCLUDE_DEFAULT_ALLOCATOR #define NK_INCLUDE_DEFAULT_ALLOCATOR
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT #define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_INCLUDE_STANDARD_VARARGS #define NK_INCLUDE_STANDARD_VARARGS
#include <nuklear.h> #include <nuklear.h>
#define NK_GLFW_GL2_IMPLEMENTATION #define NK_GLFW_GL2_IMPLEMENTATION
#include <nuklear_glfw_gl2.h> #include <nuklear_glfw_gl2.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
static void error_callback(int error, const char* description) static void error_callback(int error, const char* description)
{ {
fprintf(stderr, "Error: %s\n", description); fprintf(stderr, "Error: %s\n", description);
} }
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
GLFWmonitor* monitor = NULL; GLFWmonitor* monitor = NULL;
GLFWwindow* window; GLFWwindow* window;
struct nk_context* nk; struct nk_context* nk;
struct nk_font_atlas* atlas; struct nk_font_atlas* atlas;
glfwSetErrorCallback(error_callback); glfwSetErrorCallback(error_callback);
if (!glfwInit()) if (!glfwInit())
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
window = glfwCreateWindow(400, 400, "Opacity", NULL, NULL); window = glfwCreateWindow(400, 400, "Opacity", NULL, NULL);
if (!window) if (!window)
{ {
glfwTerminate(); glfwTerminate();
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
glfwMakeContextCurrent(window); glfwMakeContextCurrent(window);
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress); gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
glfwSwapInterval(1); glfwSwapInterval(1);
nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS); nk = nk_glfw3_init(window, NK_GLFW3_INSTALL_CALLBACKS);
nk_glfw3_font_stash_begin(&atlas); nk_glfw3_font_stash_begin(&atlas);
nk_glfw3_font_stash_end(); nk_glfw3_font_stash_end();
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
int width, height; int width, height;
struct nk_rect area; struct nk_rect area;
glfwGetWindowSize(window, &width, &height); glfwGetWindowSize(window, &width, &height);
area = nk_rect(0.f, 0.f, (float) width, (float) height); area = nk_rect(0.f, 0.f, (float) width, (float) height);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
nk_glfw3_new_frame(); nk_glfw3_new_frame();
if (nk_begin(nk, "", area, 0)) if (nk_begin(nk, "", area, 0))
{ {
float opacity = glfwGetWindowOpacity(window); float opacity = glfwGetWindowOpacity(window);
nk_layout_row_dynamic(nk, 30, 2); nk_layout_row_dynamic(nk, 30, 2);
if (nk_slider_float(nk, 0.f, &opacity, 1.f, 0.001f)) if (nk_slider_float(nk, 0.f, &opacity, 1.f, 0.001f))
glfwSetWindowOpacity(window, opacity); glfwSetWindowOpacity(window, opacity);
nk_labelf(nk, NK_TEXT_LEFT, "%0.3f", opacity); nk_labelf(nk, NK_TEXT_LEFT, "%0.3f", opacity);
} }
nk_end(nk); nk_end(nk);
nk_glfw3_render(NK_ANTI_ALIASING_ON); nk_glfw3_render(NK_ANTI_ALIASING_ON);
glfwSwapBuffers(window); glfwSwapBuffers(window);
glfwWaitEventsTimeout(1.0); glfwWaitEventsTimeout(1.0);
} }
nk_glfw3_shutdown(); nk_glfw3_shutdown();
glfwTerminate(); glfwTerminate();
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }

View File

@ -738,7 +738,7 @@ static void demo_prepare_buffers(struct demo *demo) {
} else if (swapchainExtent.width > surfCapabilities.maxImageExtent.width) { } else if (swapchainExtent.width > surfCapabilities.maxImageExtent.width) {
swapchainExtent.width = surfCapabilities.maxImageExtent.width; swapchainExtent.width = surfCapabilities.maxImageExtent.width;
} }
if (swapchainExtent.height < surfCapabilities.minImageExtent.height) { if (swapchainExtent.height < surfCapabilities.minImageExtent.height) {
swapchainExtent.height = surfCapabilities.minImageExtent.height; swapchainExtent.height = surfCapabilities.minImageExtent.height;
} else if (swapchainExtent.height > surfCapabilities.maxImageExtent.height) { } else if (swapchainExtent.height > surfCapabilities.maxImageExtent.height) {