PIF fixes + implement drag and drop

This commit is contained in:
CocoSimone
2022-09-20 23:02:05 +02:00
parent 82578cd914
commit 8c97be3619
3 changed files with 25 additions and 18 deletions

View File

@@ -5,9 +5,10 @@
void App::Run() {
// Main loop
const u8* state = SDL_GetKeyboardState(nullptr);
SDL_EventState(SDL_DROPFILE, SDL_ENABLE);
while (!core.done) {
core.Run(window, window.volumeL, window.volumeR);
core.UpdateController(state);
core.Run(window, window.volumeL, window.volumeR);
SDL_Event event;
while (SDL_PollEvent(&event)) {
@@ -38,6 +39,13 @@ void App::Run() {
}
} break;
} break;
case SDL_DROPFILE: {
char* droppedDir = event.drop.file;
if(droppedDir) {
LoadROM(droppedDir);
}
free(droppedDir);
} break;
}
}
}