Refactor window creation and enhance file dialog functionality

- Removed unnecessary ImGui frame initialization calls in CreateWindow function to streamline window setup.
- Updated FileDialogWrapper to restrict file types in the open file dialog, allowing only specific extensions (sfc, smc, yaze) for improved user experience.
This commit is contained in:
scawful
2025-09-13 11:46:17 -04:00
parent d5ec1ece19
commit b530d4a58b
2 changed files with 1 additions and 3 deletions

View File

@@ -71,6 +71,7 @@ std::string yaze::core::FileDialogWrapper::ShowOpenFileDialog() {
[openPanel setCanChooseFiles:YES];
[openPanel setCanChooseDirectories:NO];
[openPanel setAllowsMultipleSelection:NO];
[openPanel setAllowedFileTypes:@[ @"sfc", @"smc", @"yaze" ]];
if ([openPanel runModal] == NSModalResponseOK) {
NSURL* url = [[openPanel URLs] objectAtIndex:0];

View File

@@ -49,9 +49,6 @@ absl::Status CreateWindow(Window& window, int flags) {
gui::ColorsYaze();
ImGui_ImplSDLRenderer2_NewFrame();
ImGui_ImplSDL2_NewFrame();
const int audio_frequency = 48000;
SDL_AudioSpec want, have;
SDL_memset(&want, 0, sizeof(want));