@@ -130,27 +130,29 @@ void ClosePlatform(void); // Close platform
130130static void ErrorCallback (int error , const char * description ); // GLFW3 Error Callback, runs on GLFW3 error
131131
132132// Window callbacks events
133- static void WindowSizeCallback (GLFWwindow * window , int width , int height ); // GLFW3 WindowSize Callback, runs when window is resized
134- static void WindowPosCallback (GLFWwindow * window , int x , int y ); // GLFW3 WindowPos Callback, runs when window is moved
135- static void WindowIconifyCallback (GLFWwindow * window , int iconified ); // GLFW3 WindowIconify Callback, runs when window is minimized/restored
136- static void WindowMaximizeCallback (GLFWwindow * window , int maximized ); // GLFW3 Window Maximize Callback, runs when window is maximized
137- static void WindowFocusCallback (GLFWwindow * window , int focused ); // GLFW3 WindowFocus Callback, runs when window get/lose focus
138- static void WindowDropCallback (GLFWwindow * window , int count , const char * * paths ); // GLFW3 Window Drop Callback, runs when drop files into window
139- static void WindowContentScaleCallback (GLFWwindow * window , float scalex , float scaley ); // GLFW3 Window Content Scale Callback, runs when window changes scale
133+ static void WindowSizeCallback (GLFWwindow * window , int width , int height ); // GLFW3 WindowSize Callback, runs when window is resized
134+ static void WindowPosCallback (GLFWwindow * window , int x , int y ); // GLFW3 WindowPos Callback, runs when window is moved
135+ static void WindowIconifyCallback (GLFWwindow * window , int iconified ); // GLFW3 WindowIconify Callback, runs when window is minimized/restored
136+ static void WindowMaximizeCallback (GLFWwindow * window , int maximized ); // GLFW3 Window Maximize Callback, runs when window is maximized
137+ static void WindowFocusCallback (GLFWwindow * window , int focused ); // GLFW3 WindowFocus Callback, runs when window get/lose focus
138+ static void WindowDropCallback (GLFWwindow * window , int count , const char * * paths ); // GLFW3 Window Drop Callback, runs when drop files into window
139+ static void WindowContentScaleCallback (GLFWwindow * window , float scalex , float scaley ); // GLFW3 Window Content Scale Callback, runs when window changes scale
140140
141141// Input callbacks events
142- static void KeyCallback (GLFWwindow * window , int key , int scancode , int action , int mods ); // GLFW3 Keyboard Callback, runs on key pressed
143- static void CharCallback (GLFWwindow * window , unsigned int codepoint ); // GLFW3 Char Callback, runs on key pressed (get codepoint value)
144- static void MouseButtonCallback (GLFWwindow * window , int button , int action , int mods ); // GLFW3 Mouse Button Callback, runs on mouse button pressed
145- static void MouseCursorPosCallback (GLFWwindow * window , double x , double y ); // GLFW3 Cursor Position Callback, runs on mouse move
146- static void MouseScrollCallback (GLFWwindow * window , double xoffset , double yoffset ); // GLFW3 Scrolling Callback, runs on mouse wheel
147- static void CursorEnterCallback (GLFWwindow * window , int enter ); // GLFW3 Cursor Enter Callback, cursor enters client area
148- static void JoystickCallback (int jid , int event ); // GLFW3 Joystick Connected/Disconnected Callback
149-
150- // Wrappers used by glfwInitAllocator
151- static void * AllocateWrapper (size_t size , void * user ); // GLFW3 GLFWallocatefun, wrapps around RL_CALLOC macro
152- static void * ReallocateWrapper (void * block , size_t size , void * user ); // GLFW3 GLFWreallocatefun, wrapps around RL_REALLOC macro
153- static void DeallocateWrapper (void * block , void * user ); // GLFW3 GLFWdeallocatefun, wraps around RL_FREE macro
142+ static void KeyCallback (GLFWwindow * window , int key , int scancode , int action , int mods ); // GLFW3 Keyboard Callback, runs on key pressed
143+ static void CharCallback (GLFWwindow * window , unsigned int codepoint ); // GLFW3 Char Callback, runs on key pressed (get codepoint value)
144+ static void MouseButtonCallback (GLFWwindow * window , int button , int action , int mods ); // GLFW3 Mouse Button Callback, runs on mouse button pressed
145+ static void MouseCursorPosCallback (GLFWwindow * window , double x , double y ); // GLFW3 Cursor Position Callback, runs on mouse move
146+ static void MouseScrollCallback (GLFWwindow * window , double xoffset , double yoffset ); // GLFW3 Scrolling Callback, runs on mouse wheel
147+ static void CursorEnterCallback (GLFWwindow * window , int enter ); // GLFW3 Cursor Enter Callback, cursor enters client area
148+ static void JoystickCallback (int jid , int event ); // GLFW3 Joystick Connected/Disconnected Callback
149+
150+ // Memory allocator wrappers [used by glfwInitAllocator()]
151+ static void * AllocateWrapper (size_t size , void * user ); // GLFW3 GLFWallocatefun, wrapps around RL_CALLOC macro
152+ static void * ReallocateWrapper (void * block , size_t size , void * user ); // GLFW3 GLFWreallocatefun, wrapps around RL_REALLOC macro
153+ static void DeallocateWrapper (void * block , void * user ); // GLFW3 GLFWdeallocatefun, wraps around RL_FREE macro
154+
155+ static void SetDimensionsFromMonitor (GLFWmonitor * monitor ); // Set screen dimensions from monitor/display dimensions
154156
155157//----------------------------------------------------------------------------------
156158// Module Functions Declaration
@@ -435,7 +437,7 @@ void SetWindowState(unsigned int flags)
435437 // State change: FLAG_INTERLACED_HINT
436438 if (((CORE .Window .flags & FLAG_INTERLACED_HINT ) != (flags & FLAG_INTERLACED_HINT )) && ((flags & FLAG_INTERLACED_HINT ) > 0 ))
437439 {
438- TRACELOG (LOG_WARNING , "RPI : Interlaced mode can only be configured before window initialization" );
440+ TRACELOG (LOG_WARNING , "WINDOW : Interlaced mode can only be configured before window initialization" );
439441 }
440442}
441443
@@ -993,7 +995,7 @@ Vector2 GetWindowPosition(void)
993995// Get window scale DPI factor for current monitor
994996Vector2 GetWindowScaleDPI (void )
995997{
996- Vector2 scale = {0 };
998+ Vector2 scale = { 0 };
997999 glfwGetWindowContentScale (platform .handle , & scale .x , & scale .y );
9981000 return scale ;
9991001}
@@ -1321,20 +1323,6 @@ void PollInputEvents(void)
13211323//----------------------------------------------------------------------------------
13221324// Module Internal Functions Definition
13231325//----------------------------------------------------------------------------------
1324-
1325- static void SetDimensionsFromMonitor (GLFWmonitor * monitor )
1326- {
1327- const GLFWvidmode * mode = glfwGetVideoMode (monitor );
1328-
1329- // Default display resolution to that of the current mode
1330- CORE .Window .display .width = mode -> width ;
1331- CORE .Window .display .height = mode -> height ;
1332-
1333- // Set screen width/height to the display width/height if they are 0
1334- if (CORE .Window .screen .width == 0 ) CORE .Window .screen .width = CORE .Window .display .width ;
1335- if (CORE .Window .screen .height == 0 ) CORE .Window .screen .height = CORE .Window .display .height ;
1336- }
1337-
13381326// Function wrappers around RL_*alloc macros, used by glfwInitAllocator() inside of InitPlatform()
13391327// We need to provide these because GLFWallocator expects function pointers with specific signatures
13401328// Similar wrappers exist in utils.c but we cannot reuse them here due to declaration mismatch
@@ -1929,8 +1917,6 @@ static void KeyCallback(GLFWwindow *window, int key, int scancode, int action, i
19291917// GLFW3 Char Callback, get unicode codepoint value
19301918static void CharCallback (GLFWwindow * window , unsigned int codepoint )
19311919{
1932- //TRACELOG(LOG_DEBUG, "Char Callback: Codepoint: %i", codepoint);
1933-
19341920 // NOTE: Registers any key down considering OS keyboard layout but
19351921 // does not detect action events, those should be managed by user...
19361922 // Ref: https://github.com/glfw/glfw/issues/668#issuecomment-166794907
@@ -2041,6 +2027,20 @@ static void JoystickCallback(int jid, int event)
20412027 }
20422028}
20432029
2030+ // Set screen dimensions from monitor/display dimensions
2031+ static void SetDimensionsFromMonitor (GLFWmonitor * monitor )
2032+ {
2033+ const GLFWvidmode * mode = glfwGetVideoMode (monitor );
2034+
2035+ // Default display resolution to that of the current mode
2036+ CORE .Window .display .width = mode -> width ;
2037+ CORE .Window .display .height = mode -> height ;
2038+
2039+ // Set screen width/height to the display width/height if they are 0
2040+ if (CORE .Window .screen .width == 0 ) CORE .Window .screen .width = CORE .Window .display .width ;
2041+ if (CORE .Window .screen .height == 0 ) CORE .Window .screen .height = CORE .Window .display .height ;
2042+ }
2043+
20442044#ifdef _WIN32
20452045# define WIN32_CLIPBOARD_IMPLEMENTATION
20462046# include "../external/win32_clipboard.h"
0 commit comments