summaryrefslogtreecommitdiffhomepage
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/main.c b/main.c
index 38da11a..ca0a70d 100644
--- a/main.c
+++ b/main.c
@@ -110,6 +110,8 @@ void CheckDifference();
void DrawCodeDisplay();
void DrawOutput();
+void HandleDroppedFiles();
+
int main()
{
InitWindow(screenWidth, screenHeight, "DrawTexturePro Example");
@@ -138,6 +140,8 @@ int main()
while (!WindowShouldClose())
{
+ HandleDroppedFiles();
+
BeginDrawing();
ClearBackground(RAYWHITE);
@@ -850,3 +854,17 @@ void DrawOutput() {
);
};
+
+void HandleDroppedFiles()
+{
+ if (IsFileDropped()) {
+ FilePathList droppedFiles = LoadDroppedFiles();
+ Texture2D tmp = LoadTexture(droppedFiles.paths[0]);
+ if (tmp.id != 0) {
+ // Texture loaded successfully
+ UnloadTexture(sampleSprite);
+ sampleSprite = tmp;
+ }
+ UnloadDroppedFiles(droppedFiles);
+ }
+}