summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/editor.c8
-rw-r--r--src/main.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/src/editor.c b/src/editor.c
index 425dc64..c1d9463 100644
--- a/src/editor.c
+++ b/src/editor.c
@@ -236,8 +236,12 @@ void drawPreview(EditorCreateBlockState *state, int wx, int wy, int ww, int wh,
}
void loadTexture(EditorCreateBlockState *state) {
- nfdchar_t *outPath = NULL;
- nfdresult_t result = NFD_OpenDialog(NULL, NULL, &outPath);
+ nfdu8char_t *outPath;
+ nfdu8filteritem_t filters[1] = {{"Images", "png"}};
+ nfdopendialogu8args_t args = {0};
+ args.filterList = filters;
+ args.filterCount = 1;
+ nfdresult_t result = NFD_OpenDialogU8_With(&outPath, &args);
if (result == NFD_OKAY) {
if (!IsFileExtension(outPath, ".png")) {
diff --git a/src/main.c b/src/main.c
index 0bcfa9b..5ba9463 100644
--- a/src/main.c
+++ b/src/main.c
@@ -5,10 +5,12 @@
#include "editor.h"
#include "floor.h"
#include "logger.h"
+#include "nfd.h"
#include "raylib.h"
#include "tileset.h"
int main() {
+ NFD_Init();
SetTraceLogCallback(SE_Logger);
SetConfigFlags(FLAG_WINDOW_RESIZABLE);