Explorar o código

OS Specific path seperator char (#316)

* OS Specific path seperator char

Adds OS specific path seperator char

* Update gui_window_file_dialog.h

* Update custom_file_dialog.c
Hanaxar %!s(int64=2) %!d(string=hai) anos
pai
achega
7567816d3e

+ 1 - 1
examples/custom_file_dialog/custom_file_dialog.c

@@ -61,7 +61,7 @@ int main()
             // Load image file (if supported extension)
             if (IsFileExtension(fileDialogState.fileNameText, ".png"))
             {
-                strcpy(fileNameToLoad, TextFormat("%s/%s", fileDialogState.dirPathText, fileDialogState.fileNameText));
+                strcpy(fileNameToLoad, TextFormat("%s" PATH_SEPERATOR "%s", fileDialogState.dirPathText, fileDialogState.fileNameText));
                 UnloadTexture(texture);
                 texture = LoadTexture(fileNameToLoad);
             }

+ 5 - 0
examples/custom_file_dialog/gui_window_file_dialog.h

@@ -126,6 +126,11 @@ void GuiWindowFileDialog(GuiWindowFileDialogState *state);
 //----------------------------------------------------------------------------------
 #define MAX_DIRECTORY_FILES    2048
 #define MAX_ICON_PATH_LENGTH    512
+#ifdef _WIN32
+#define PATH_SEPERATOR "\\"
+#else
+#define PATH_SEPERATOR "/"
+#endif
 
 //----------------------------------------------------------------------------------
 // Types and Structures Definition