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
This commit is contained in:
Hanaxar 2023-08-02 20:18:22 +03:00 committed by GitHub
parent 3d20f06bf2
commit 7567816d3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -61,7 +61,7 @@ int main()
// Load image file (if supported extension) // Load image file (if supported extension)
if (IsFileExtension(fileDialogState.fileNameText, ".png")) 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); UnloadTexture(texture);
texture = LoadTexture(fileNameToLoad); texture = LoadTexture(fileNameToLoad);
} }

View File

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