mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 13:32:01 +00:00
parent
11c22d6a17
commit
85de0db05d
@ -62,6 +62,7 @@ GLFW bundles a number of dependencies in the `deps/` directory.
|
|||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
- Bugfix: `glfwSetTime` silently accepted invalid values
|
||||||
- [Cocoa] Bugfix: `glfwSetWindowSize` did not change the video mode for full
|
- [Cocoa] Bugfix: `glfwSetWindowSize` did not change the video mode for full
|
||||||
screen windows
|
screen windows
|
||||||
- [X11] Added support for Cygwin-X
|
- [X11] Added support for Cygwin-X
|
||||||
|
@ -3136,7 +3136,7 @@ GLFWAPI double glfwGetTime(void);
|
|||||||
/*! @brief Sets the GLFW timer.
|
/*! @brief Sets the GLFW timer.
|
||||||
*
|
*
|
||||||
* This function sets the value of the GLFW timer. It then continues to count
|
* This function sets the value of the GLFW timer. It then continues to count
|
||||||
* up from that value.
|
* up from that value. The value must be a positive finite number.
|
||||||
*
|
*
|
||||||
* @param[in] time The new value, in seconds.
|
* @param[in] time The new value, in seconds.
|
||||||
*
|
*
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <float.h>
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#endif
|
#endif
|
||||||
@ -591,6 +592,13 @@ GLFWAPI double glfwGetTime(void)
|
|||||||
GLFWAPI void glfwSetTime(double time)
|
GLFWAPI void glfwSetTime(double time)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT();
|
_GLFW_REQUIRE_INIT();
|
||||||
|
|
||||||
|
if (time != time || time - DBL_MAX == time || time < 0.0)
|
||||||
|
{
|
||||||
|
_glfwInputError(GLFW_INVALID_VALUE, "Invalid time");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_glfwPlatformSetTime(time);
|
_glfwPlatformSetTime(time);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user