mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 10:05:10 +00:00
Replace GLFWuint64 with uint64_t
C99 stdint.h is provided by VS 2010 and later. GLFW has not provided testing or binaries for VS 2008 for several releases. For earlier versions of VS there are third-party alternatives: https://msinttypes.googlecode.com/svn/trunk/stdint.h http://www.azillionmonkeys.com/qed/pstdint.h This change does not affect the ABI.
This commit is contained in:
parent
5eb2e83c82
commit
5661d03be8
@ -88,7 +88,6 @@ does not find Doxygen, the documentation will not be generated.
|
|||||||
- Added `glfwWaitEventsTimeout` for waiting for events for a set amount of time
|
- Added `glfwWaitEventsTimeout` for waiting for events for a set amount of time
|
||||||
- Added `glfwSetWindowIcon` for setting the icon of a window
|
- Added `glfwSetWindowIcon` for setting the icon of a window
|
||||||
- Added `glfwGetTimerValue` and `glfwGetTimerFrequency` for raw timer access
|
- Added `glfwGetTimerValue` and `glfwGetTimerFrequency` for raw timer access
|
||||||
- Added `GLFWuint64` for platform-independent 64-bit unsigned values
|
|
||||||
- Added `GLFW_NO_API` for creating window without contexts
|
- Added `GLFW_NO_API` for creating window without contexts
|
||||||
- Added `GLFW_CONTEXT_NO_ERROR` context hint for `GL_KHR_no_error` support
|
- Added `GLFW_CONTEXT_NO_ERROR` context hint for `GL_KHR_no_error` support
|
||||||
- Added `GLFW_INCLUDE_VULKAN` for including the Vulkan header
|
- Added `GLFW_INCLUDE_VULKAN` for including the Vulkan header
|
||||||
|
@ -571,7 +571,7 @@ You can also access the raw timer value, measured in 1 / frequency
|
|||||||
seconds, with @ref glfwGetTimerValue.
|
seconds, with @ref glfwGetTimerValue.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
GLFWuint64 value = glfwGetTimerValue();
|
uint64_t value = glfwGetTimerValue();
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
The frequency of the raw timer varies depending on what time sources are
|
The frequency of the raw timer varies depending on what time sources are
|
||||||
@ -579,7 +579,7 @@ available on the machine. You can query its frequency, in Hz, with @ref
|
|||||||
glfwGetTimerFrequency.
|
glfwGetTimerFrequency.
|
||||||
|
|
||||||
@code
|
@code
|
||||||
GLFWuint64 freqency = glfwGetTimerFrequency();
|
uint64_t freqency = glfwGetTimerFrequency();
|
||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ extern "C" {
|
|||||||
* Include it unconditionally to avoid surprising side-effects.
|
* Include it unconditionally to avoid surprising side-effects.
|
||||||
*/
|
*/
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
/* Include the chosen client API headers.
|
/* Include the chosen client API headers.
|
||||||
*/
|
*/
|
||||||
@ -728,19 +729,6 @@ extern "C" {
|
|||||||
* GLFW API types
|
* GLFW API types
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/*! @brief 64-bit unsigned integer.
|
|
||||||
*
|
|
||||||
* 64-bit unsigned integer.
|
|
||||||
*
|
|
||||||
* @since Added in version 3.2.
|
|
||||||
*/
|
|
||||||
#if defined(_MSC_VER) && (_MSC_VER < 1600)
|
|
||||||
typedef unsigned __int64 GLFWuint64;
|
|
||||||
#else
|
|
||||||
#include <stdint.h>
|
|
||||||
typedef uint64_t GLFWuint64;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*! @brief Client API function pointer type.
|
/*! @brief Client API function pointer type.
|
||||||
*
|
*
|
||||||
* Generic function pointer used for returning client API function pointers
|
* Generic function pointer used for returning client API function pointers
|
||||||
@ -3735,7 +3723,7 @@ GLFWAPI void glfwSetTime(double time);
|
|||||||
*
|
*
|
||||||
* @ingroup input
|
* @ingroup input
|
||||||
*/
|
*/
|
||||||
GLFWAPI GLFWuint64 glfwGetTimerValue(void);
|
GLFWAPI uint64_t glfwGetTimerValue(void);
|
||||||
|
|
||||||
/*! @brief Returns the frequency, in Hz, of the raw timer.
|
/*! @brief Returns the frequency, in Hz, of the raw timer.
|
||||||
*
|
*
|
||||||
@ -3755,7 +3743,7 @@ GLFWAPI GLFWuint64 glfwGetTimerValue(void);
|
|||||||
*
|
*
|
||||||
* @ingroup input
|
* @ingroup input
|
||||||
*/
|
*/
|
||||||
GLFWAPI GLFWuint64 glfwGetTimerFrequency(void);
|
GLFWAPI uint64_t glfwGetTimerFrequency(void);
|
||||||
|
|
||||||
/*! @brief Makes the context of the specified window current for the calling
|
/*! @brief Makes the context of the specified window current for the calling
|
||||||
* thread.
|
* thread.
|
||||||
|
@ -118,7 +118,7 @@ typedef struct _GLFWcursorNS
|
|||||||
//
|
//
|
||||||
typedef struct _GLFWtimeNS
|
typedef struct _GLFWtimeNS
|
||||||
{
|
{
|
||||||
GLFWuint64 frequency;
|
uint64_t frequency;
|
||||||
|
|
||||||
} _GLFWtimeNS;
|
} _GLFWtimeNS;
|
||||||
|
|
||||||
|
@ -48,12 +48,12 @@ void _glfwInitTimerNS(void)
|
|||||||
////// GLFW platform API //////
|
////// GLFW platform API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GLFWuint64 _glfwPlatformGetTimerValue(void)
|
uint64_t _glfwPlatformGetTimerValue(void)
|
||||||
{
|
{
|
||||||
return mach_absolute_time();
|
return mach_absolute_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWuint64 _glfwPlatformGetTimerFrequency(void)
|
uint64_t _glfwPlatformGetTimerFrequency(void)
|
||||||
{
|
{
|
||||||
return _glfw.ns_time.frequency;
|
return _glfw.ns_time.frequency;
|
||||||
}
|
}
|
||||||
|
@ -660,16 +660,16 @@ GLFWAPI void glfwSetTime(double time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_glfw.timerOffset = _glfwPlatformGetTimerValue() -
|
_glfw.timerOffset = _glfwPlatformGetTimerValue() -
|
||||||
(GLFWuint64) (time * _glfwPlatformGetTimerFrequency());
|
(uint64_t) (time * _glfwPlatformGetTimerFrequency());
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI GLFWuint64 glfwGetTimerValue(void)
|
GLFWAPI uint64_t glfwGetTimerValue(void)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(0);
|
_GLFW_REQUIRE_INIT_OR_RETURN(0);
|
||||||
return _glfwPlatformGetTimerValue();
|
return _glfwPlatformGetTimerValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWAPI GLFWuint64 glfwGetTimerFrequency(void)
|
GLFWAPI uint64_t glfwGetTimerFrequency(void)
|
||||||
{
|
{
|
||||||
_GLFW_REQUIRE_INIT_OR_RETURN(0);
|
_GLFW_REQUIRE_INIT_OR_RETURN(0);
|
||||||
return _glfwPlatformGetTimerFrequency();
|
return _glfwPlatformGetTimerFrequency();
|
||||||
|
@ -91,7 +91,7 @@ typedef const GLubyte* (APIENTRY * PFNGLGETSTRINGIPROC)(GLenum,GLuint);
|
|||||||
|
|
||||||
typedef void* VkInstance;
|
typedef void* VkInstance;
|
||||||
typedef void* VkPhysicalDevice;
|
typedef void* VkPhysicalDevice;
|
||||||
typedef GLFWuint64 VkSurfaceKHR;
|
typedef uint64_t VkSurfaceKHR;
|
||||||
typedef unsigned int VkFlags;
|
typedef unsigned int VkFlags;
|
||||||
typedef unsigned int VkBool32;
|
typedef unsigned int VkBool32;
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ struct _GLFWlibrary
|
|||||||
_GLFWmonitor** monitors;
|
_GLFWmonitor** monitors;
|
||||||
int monitorCount;
|
int monitorCount;
|
||||||
|
|
||||||
GLFWuint64 timerOffset;
|
uint64_t timerOffset;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLFWbool available;
|
GLFWbool available;
|
||||||
@ -600,12 +600,12 @@ const char* _glfwPlatformGetJoystickName(int joy);
|
|||||||
/*! @copydoc glfwGetTimerValue
|
/*! @copydoc glfwGetTimerValue
|
||||||
* @ingroup platform
|
* @ingroup platform
|
||||||
*/
|
*/
|
||||||
GLFWuint64 _glfwPlatformGetTimerValue(void);
|
uint64_t _glfwPlatformGetTimerValue(void);
|
||||||
|
|
||||||
/*! @copydoc glfwGetTimerFrequency
|
/*! @copydoc glfwGetTimerFrequency
|
||||||
* @ingroup platform
|
* @ingroup platform
|
||||||
*/
|
*/
|
||||||
GLFWuint64 _glfwPlatformGetTimerFrequency(void);
|
uint64_t _glfwPlatformGetTimerFrequency(void);
|
||||||
|
|
||||||
/*! @ingroup platform
|
/*! @ingroup platform
|
||||||
*/
|
*/
|
||||||
|
@ -60,7 +60,7 @@ void _glfwInitTimerPOSIX(void)
|
|||||||
////// GLFW platform API //////
|
////// GLFW platform API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GLFWuint64 _glfwPlatformGetTimerValue(void)
|
uint64_t _glfwPlatformGetTimerValue(void)
|
||||||
{
|
{
|
||||||
#if defined(CLOCK_MONOTONIC)
|
#if defined(CLOCK_MONOTONIC)
|
||||||
if (_glfw.posix_time.monotonic)
|
if (_glfw.posix_time.monotonic)
|
||||||
@ -78,7 +78,7 @@ GLFWuint64 _glfwPlatformGetTimerValue(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWuint64 _glfwPlatformGetTimerFrequency(void)
|
uint64_t _glfwPlatformGetTimerFrequency(void)
|
||||||
{
|
{
|
||||||
return _glfw.posix_time.frequency;
|
return _glfw.posix_time.frequency;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
typedef struct _GLFWtimePOSIX
|
typedef struct _GLFWtimePOSIX
|
||||||
{
|
{
|
||||||
GLFWbool monotonic;
|
GLFWbool monotonic;
|
||||||
GLFWuint64 frequency;
|
uint64_t frequency;
|
||||||
|
|
||||||
} _GLFWtimePOSIX;
|
} _GLFWtimePOSIX;
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ typedef struct _GLFWcursorWin32
|
|||||||
typedef struct _GLFWtimeWin32
|
typedef struct _GLFWtimeWin32
|
||||||
{
|
{
|
||||||
GLFWbool hasPC;
|
GLFWbool hasPC;
|
||||||
GLFWuint64 frequency;
|
uint64_t frequency;
|
||||||
|
|
||||||
} _GLFWtimeWin32;
|
} _GLFWtimeWin32;
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
//
|
//
|
||||||
void _glfwInitTimerWin32(void)
|
void _glfwInitTimerWin32(void)
|
||||||
{
|
{
|
||||||
GLFWuint64 frequency;
|
uint64_t frequency;
|
||||||
|
|
||||||
if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency))
|
if (QueryPerformanceFrequency((LARGE_INTEGER*) &frequency))
|
||||||
{
|
{
|
||||||
@ -55,19 +55,19 @@ void _glfwInitTimerWin32(void)
|
|||||||
////// GLFW platform API //////
|
////// GLFW platform API //////
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
GLFWuint64 _glfwPlatformGetTimerValue(void)
|
uint64_t _glfwPlatformGetTimerValue(void)
|
||||||
{
|
{
|
||||||
if (_glfw.win32_time.hasPC)
|
if (_glfw.win32_time.hasPC)
|
||||||
{
|
{
|
||||||
GLFWuint64 value;
|
uint64_t value;
|
||||||
QueryPerformanceCounter((LARGE_INTEGER*) &value);
|
QueryPerformanceCounter((LARGE_INTEGER*) &value);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (GLFWuint64) _glfw_timeGetTime();
|
return (uint64_t) _glfw_timeGetTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWuint64 _glfwPlatformGetTimerFrequency(void)
|
uint64_t _glfwPlatformGetTimerFrequency(void)
|
||||||
{
|
{
|
||||||
return _glfw.win32_time.frequency;
|
return _glfw.win32_time.frequency;
|
||||||
}
|
}
|
||||||
|
@ -1763,7 +1763,7 @@ void _glfwPlatformGetWindowFrameSize(_GLFWwindow* window,
|
|||||||
if (!_glfwPlatformWindowVisible(window) &&
|
if (!_glfwPlatformWindowVisible(window) &&
|
||||||
_glfw.x11.NET_REQUEST_FRAME_EXTENTS)
|
_glfw.x11.NET_REQUEST_FRAME_EXTENTS)
|
||||||
{
|
{
|
||||||
GLFWuint64 base;
|
uint64_t base;
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
|
||||||
// Ensure _NET_FRAME_EXTENTS is set, allowing glfwGetWindowFrameSize to
|
// Ensure _NET_FRAME_EXTENTS is set, allowing glfwGetWindowFrameSize to
|
||||||
|
Loading…
Reference in New Issue
Block a user