@@ -76,14 +76,14 @@ void CloseWindow(void);
76
76
77
77
#if defined(_WIN32 ) || defined(_WIN64 )
78
78
#define WIN32_LEAN_AND_MEAN
79
- #define Rectangle rectangle_win32
79
+ #define Rectangle rectangle_win32
80
80
#define CloseWindow CloseWindow_win32
81
81
#define ShowCursor __imp_ShowCursor
82
- #define _APISETSTRING_
83
-
84
- #undef MAX_PATH
82
+ #define _APISETSTRING_
83
+
84
+ #undef MAX_PATH
85
85
86
- __declspec(dllimport ) int __stdcall MultiByteToWideChar (unsigned int CodePage , unsigned long dwFlags , const char * lpMultiByteStr , int cbMultiByte , wchar_t * lpWideCharStr , int cchWideChar );
86
+ __declspec(dllimport ) int __stdcall MultiByteToWideChar (unsigned int CodePage , unsigned long dwFlags , const char * lpMultiByteStr , int cbMultiByte , wchar_t * lpWideCharStr , int cchWideChar );
87
87
#endif
88
88
89
89
#if defined(__APPLE__ )
@@ -103,8 +103,8 @@ void CloseWindow(void);
103
103
#undef CloseWindow
104
104
#undef Rectangle
105
105
106
- #undef MAX_PATH
107
- #define MAX_PATH 1025
106
+ #undef MAX_PATH
107
+ #define MAX_PATH 1025
108
108
#endif
109
109
110
110
#if defined(__APPLE__ )
@@ -896,23 +896,23 @@ const char *GetKeyName(int key)
896
896
static KeyboardKey ConvertScancodeToKey (u32 keycode );
897
897
898
898
int RGFW_gpConvTable [18 ] = {
899
- [RGFW_gamepadY ] = GAMEPAD_BUTTON_RIGHT_FACE_UP ,
900
- [RGFW_gamepadB ] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT ,
901
- [RGFW_gamepadA ] = GAMEPAD_BUTTON_RIGHT_FACE_DOWN ,
902
- [RGFW_gamepadX ] = GAMEPAD_BUTTON_RIGHT_FACE_LEFT ,
903
- [RGFW_gamepadL1 ] = GAMEPAD_BUTTON_LEFT_TRIGGER_1 ,
904
- [RGFW_gamepadR1 ] = GAMEPAD_BUTTON_RIGHT_TRIGGER_1 ,
905
- [RGFW_gamepadL2 ] = GAMEPAD_BUTTON_LEFT_TRIGGER_2 ,
906
- [RGFW_gamepadR2 ] = GAMEPAD_BUTTON_RIGHT_TRIGGER_2 ,
907
- [RGFW_gamepadSelect ] = GAMEPAD_BUTTON_MIDDLE_LEFT ,
908
- [RGFW_gamepadHome ] = GAMEPAD_BUTTON_MIDDLE ,
909
- [RGFW_gamepadStart ] = GAMEPAD_BUTTON_MIDDLE_RIGHT ,
910
- [RGFW_gamepadUp ] = GAMEPAD_BUTTON_LEFT_FACE_UP ,
911
- [RGFW_gamepadRight ] = GAMEPAD_BUTTON_LEFT_FACE_RIGHT ,
912
- [RGFW_gamepadDown ] = GAMEPAD_BUTTON_LEFT_FACE_DOWN ,
913
- [RGFW_gamepadLeft ] = GAMEPAD_BUTTON_LEFT_FACE_LEFT ,
914
- [RGFW_gamepadL3 ] = GAMEPAD_BUTTON_LEFT_THUMB ,
915
- [RGFW_gamepadR3 ] = GAMEPAD_BUTTON_RIGHT_THUMB ,
899
+ [RGFW_gamepadY ] = GAMEPAD_BUTTON_RIGHT_FACE_UP ,
900
+ [RGFW_gamepadB ] = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT ,
901
+ [RGFW_gamepadA ] = GAMEPAD_BUTTON_RIGHT_FACE_DOWN ,
902
+ [RGFW_gamepadX ] = GAMEPAD_BUTTON_RIGHT_FACE_LEFT ,
903
+ [RGFW_gamepadL1 ] = GAMEPAD_BUTTON_LEFT_TRIGGER_1 ,
904
+ [RGFW_gamepadR1 ] = GAMEPAD_BUTTON_RIGHT_TRIGGER_1 ,
905
+ [RGFW_gamepadL2 ] = GAMEPAD_BUTTON_LEFT_TRIGGER_2 ,
906
+ [RGFW_gamepadR2 ] = GAMEPAD_BUTTON_RIGHT_TRIGGER_2 ,
907
+ [RGFW_gamepadSelect ] = GAMEPAD_BUTTON_MIDDLE_LEFT ,
908
+ [RGFW_gamepadHome ] = GAMEPAD_BUTTON_MIDDLE ,
909
+ [RGFW_gamepadStart ] = GAMEPAD_BUTTON_MIDDLE_RIGHT ,
910
+ [RGFW_gamepadUp ] = GAMEPAD_BUTTON_LEFT_FACE_UP ,
911
+ [RGFW_gamepadRight ] = GAMEPAD_BUTTON_LEFT_FACE_RIGHT ,
912
+ [RGFW_gamepadDown ] = GAMEPAD_BUTTON_LEFT_FACE_DOWN ,
913
+ [RGFW_gamepadLeft ] = GAMEPAD_BUTTON_LEFT_FACE_LEFT ,
914
+ [RGFW_gamepadL3 ] = GAMEPAD_BUTTON_LEFT_THUMB ,
915
+ [RGFW_gamepadR3 ] = GAMEPAD_BUTTON_RIGHT_THUMB ,
916
916
};
917
917
918
918
// Register all input events
@@ -923,7 +923,7 @@ void PollInputEvents(void)
923
923
// because ProcessGestureEvent() is just called on an event, not every frame
924
924
UpdateGestures ();
925
925
#endif
926
-
926
+
927
927
// Reset keys/chars pressed registered
928
928
CORE .Input .Keyboard .keyPressedQueueCount = 0 ;
929
929
CORE .Input .Keyboard .charPressedQueueCount = 0 ;
@@ -994,7 +994,7 @@ void PollInputEvents(void)
994
994
RGFW_event * event = & platform .window -> event ;
995
995
// All input events can be processed after polling
996
996
997
- switch (event -> type )
997
+ switch (event -> type )
998
998
{
999
999
case RGFW_mouseEnter : CORE .Input .Mouse .cursorOnScreen = true; break ;
1000
1000
case RGFW_mouseLeave : CORE .Input .Mouse .cursorOnScreen = false; break ;
@@ -1015,7 +1015,7 @@ void PollInputEvents(void)
1015
1015
1016
1016
CORE .Window .dropFilepaths [CORE .Window .dropFileCount ] = (char * )RL_CALLOC (MAX_FILEPATH_LENGTH , sizeof (char ));
1017
1017
strcpy (CORE .Window .dropFilepaths [CORE .Window .dropFileCount ], event -> droppedFiles [i ]);
1018
-
1018
+
1019
1019
CORE .Window .dropFileCount ++ ;
1020
1020
}
1021
1021
else if (CORE .Window .dropFileCount < 1024 )
@@ -1034,17 +1034,17 @@ void PollInputEvents(void)
1034
1034
{
1035
1035
SetupViewport (platform .window -> r .w , platform .window -> r .h );
1036
1036
1037
- // if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1038
- if (IsWindowState (FLAG_WINDOW_HIGHDPI ))
1039
- {
1040
- CORE .Window .screen .width = (int )(platform .window -> r .w / GetWindowScaleDPI ().x );
1041
- CORE .Window .screen .height = (int )(platform .window -> r .h / GetWindowScaleDPI ().y );
1042
- }
1043
- else
1044
- {
1045
- CORE .Window .screen .width = platform .window -> r .w ;
1046
- CORE .Window .screen .height = platform .window -> r .h ;
1047
- }
1037
+ // if we are doing automatic DPI scaling, then the "screen" size is divided by the window scale
1038
+ if (IsWindowState (FLAG_WINDOW_HIGHDPI ))
1039
+ {
1040
+ CORE .Window .screen .width = (int )(platform .window -> r .w / GetWindowScaleDPI ().x );
1041
+ CORE .Window .screen .height = (int )(platform .window -> r .h / GetWindowScaleDPI ().y );
1042
+ }
1043
+ else
1044
+ {
1045
+ CORE .Window .screen .width = platform .window -> r .w ;
1046
+ CORE .Window .screen .height = platform .window -> r .h ;
1047
+ }
1048
1048
1049
1049
CORE .Window .currentFbo .width = platform .window -> r .w ;
1050
1050
CORE .Window .currentFbo .height = platform .window -> r .h ;
@@ -1179,7 +1179,7 @@ void PollInputEvents(void)
1179
1179
} break ;
1180
1180
case RGFW_gamepadButtonPressed :
1181
1181
{
1182
- int button = RGFW_gpConvTable [event -> button ];
1182
+ int button = RGFW_gpConvTable [event -> button ];
1183
1183
1184
1184
if (button >= 0 )
1185
1185
{
@@ -1189,42 +1189,42 @@ void PollInputEvents(void)
1189
1189
} break ;
1190
1190
case RGFW_gamepadButtonReleased :
1191
1191
{
1192
- int button = RGFW_gpConvTable [event -> button ];
1192
+ int button = RGFW_gpConvTable [event -> button ];
1193
1193
1194
1194
CORE .Input .Gamepad .currentButtonState [event -> gamepad ][button ] = 0 ;
1195
1195
if (CORE .Input .Gamepad .lastButtonPressed == button ) CORE .Input .Gamepad .lastButtonPressed = 0 ;
1196
1196
} break ;
1197
1197
case RGFW_gamepadAxisMove :
1198
1198
{
1199
1199
int axis = -1 ;
1200
- float value = 0 ;
1200
+ float value = 0 ;
1201
1201
1202
- switch (event -> whichAxis )
1202
+ switch (event -> whichAxis )
1203
1203
{
1204
- case 0 :
1205
- {
1206
- CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_LEFT_X ] = event -> axis [0 ].x / 100.0f ;
1207
- CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_LEFT_Y ] = event -> axis [0 ].y / 100.0f ;
1208
- } break ;
1209
- case 1 :
1210
- {
1211
- CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_RIGHT_X ] = event -> axis [1 ].x / 100.0f ;
1212
- CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_RIGHT_Y ] = event -> axis [1 ].y / 100.0f ;
1213
- } break ;
1214
- case 2 : axis = GAMEPAD_AXIS_LEFT_TRIGGER ;
1215
- case 3 :
1204
+ case 0 :
1205
+ {
1206
+ CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_LEFT_X ] = event -> axis [0 ].x / 100.0f ;
1207
+ CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_LEFT_Y ] = event -> axis [0 ].y / 100.0f ;
1208
+ } break ;
1209
+ case 1 :
1210
+ {
1211
+ CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_RIGHT_X ] = event -> axis [1 ].x / 100.0f ;
1212
+ CORE .Input .Gamepad .axisState [event -> gamepad ][GAMEPAD_AXIS_RIGHT_Y ] = event -> axis [1 ].y / 100.0f ;
1213
+ } break ;
1214
+ case 2 : axis = GAMEPAD_AXIS_LEFT_TRIGGER ;
1215
+ case 3 :
1216
1216
{
1217
1217
if (axis == -1 ) axis = GAMEPAD_AXIS_RIGHT_TRIGGER ;
1218
1218
1219
- int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER )? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2 ;
1220
- int pressed = (value > 0.1f );
1221
- CORE .Input .Gamepad .currentButtonState [event -> gamepad ][button ] = pressed ;
1222
-
1223
- if (pressed ) CORE .Input .Gamepad .lastButtonPressed = button ;
1224
- else if (CORE .Input .Gamepad .lastButtonPressed == button ) CORE .Input .Gamepad .lastButtonPressed = 0 ;
1225
- }
1226
- default : break ;
1227
- }
1219
+ int button = (axis == GAMEPAD_AXIS_LEFT_TRIGGER )? GAMEPAD_BUTTON_LEFT_TRIGGER_2 : GAMEPAD_BUTTON_RIGHT_TRIGGER_2 ;
1220
+ int pressed = (value > 0.1f );
1221
+ CORE .Input .Gamepad .currentButtonState [event -> gamepad ][button ] = pressed ;
1222
+
1223
+ if (pressed ) CORE .Input .Gamepad .lastButtonPressed = button ;
1224
+ else if (CORE .Input .Gamepad .lastButtonPressed == button ) CORE .Input .Gamepad .lastButtonPressed = 0 ;
1225
+ }
1226
+ default : break ;
1227
+ }
1228
1228
} break ;
1229
1229
default : break ;
1230
1230
}
@@ -1322,14 +1322,14 @@ int InitPlatform(void)
1322
1322
CORE .Window .display .width = screenSize .w ;
1323
1323
CORE .Window .display .height = screenSize .h ;
1324
1324
#else
1325
- CORE .Window .display .width = CORE .Window .screen .width ;
1325
+ CORE .Window .display .width = CORE .Window .screen .width ;
1326
1326
CORE .Window .display .height = CORE .Window .screen .height ;
1327
1327
#endif
1328
- // TODO: Is this needed by raylib now?
1328
+ // TODO: Is this needed by raylib now?
1329
1329
// If so, rcore_desktop_sdl should be updated too
1330
- //SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height);
1331
-
1332
- if (CORE .Window .flags & FLAG_VSYNC_HINT ) RGFW_window_swapInterval (platform .window , 1 );
1330
+ //SetupFramebuffer(CORE.Window.display.width, CORE.Window.display.height);
1331
+
1332
+ if (CORE .Window .flags & FLAG_VSYNC_HINT ) RGFW_window_swapInterval (platform .window , 1 );
1333
1333
RGFW_window_makeCurrent (platform .window );
1334
1334
1335
1335
// Check surface and context activation
@@ -1410,5 +1410,5 @@ static KeyboardKey ConvertScancodeToKey(u32 keycode)
1410
1410
{
1411
1411
if (keycode > sizeof (keyMappingRGFW )/sizeof (unsigned short )) return 0 ;
1412
1412
1413
- return keyMappingRGFW [keycode ];
1413
+ return keyMappingRGFW [keycode ];
1414
1414
}
0 commit comments