Skip to content

Commit

Permalink
Associate native window to NFD parent window
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jan 5, 2025
1 parent ea31bb1 commit 3aa6aa4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion platforms/desktop-shared/gui_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
#include "imgui/imgui.h"
#include "imgui/memory_editor.h"
#include "nfd/nfd.h"
#include "nfd/nfd_sdl2.h"
#include "config.h"
#include "emu.h"
#include "renderer.h"
#include "../../src/gearboy.h"
#include "gui.h"
#include "imgui/colors.h"
#include "gui_debug_constants.h"
#include "application.h"

#define GUI_DEBUG_IMPORT
#include "gui_debug.h"
Expand Down Expand Up @@ -226,7 +228,17 @@ static void memory_editor_menu(void)
{
nfdchar_t *outPath;
nfdfilteritem_t filterItem[1] = { { "Memory Dump Files", "txt" } };
nfdresult_t result = NFD_SaveDialog(&outPath, filterItem, 1, NULL, NULL);
nfdsavedialogu8args_t args = { };
args.filterList = filterItem;
args.filterCount = 1;
args.defaultPath = NULL;
args.defaultName = NULL;
if (!NFD_GetNativeWindowFromSDLWindow(application_sdl_window, &args.parentWindow))
{
Log("NFD_GetNativeWindowFromSDLWindow failed: %s\n", SDL_GetError());
}

nfdresult_t result = NFD_SaveDialogU8_With(&outPath, &args);
if (result == NFD_OKAY)
{
mem_edit[current_mem_edit].SaveToFile(outPath);
Expand Down

0 comments on commit 3aa6aa4

Please sign in to comment.