mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-23 06:39:01 +00:00
Initialize the timer after the graphics device on desktop and web platforms. (#516)
This is already the order that is used for Android. It doesn't appear to
make a difference on desktop but on web using the timer before it's been
initialized (by glfwInit, inside InitGraphicsDevice) causes the a long
(and variable but often several seconds) sleep between the first and
second frame.
Fixes: 468309d ("Early-exit InitWindow if InitGraphicsDevice fails")
This commit is contained in:
committed by
Ahmad Fatoum
parent
22c8ea76aa
commit
b4e2f5b45c
@@ -442,14 +442,14 @@ void InitWindow(int width, int height, void *data)
|
|||||||
uwpWindow = (EGLNativeWindowType)data;
|
uwpWindow = (EGLNativeWindowType)data;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Init hi-res timer
|
|
||||||
InitTimer();
|
|
||||||
|
|
||||||
// Init graphics device (display device and OpenGL context)
|
// Init graphics device (display device and OpenGL context)
|
||||||
// NOTE: returns true if window and graphic device has been initialized successfully
|
// NOTE: returns true if window and graphic device has been initialized successfully
|
||||||
windowReady = InitGraphicsDevice(width, height);
|
windowReady = InitGraphicsDevice(width, height);
|
||||||
if (!windowReady) return;
|
if (!windowReady) return;
|
||||||
|
|
||||||
|
// Init hi-res timer
|
||||||
|
InitTimer();
|
||||||
|
|
||||||
#if defined(SUPPORT_DEFAULT_FONT)
|
#if defined(SUPPORT_DEFAULT_FONT)
|
||||||
// Load default font
|
// Load default font
|
||||||
// NOTE: External function (defined in module: text)
|
// NOTE: External function (defined in module: text)
|
||||||
|
|||||||
Reference in New Issue
Block a user