Compare commits

...

4 Commits

Author SHA1 Message Date
013d1fef3b error message on plugin load fail 2024-05-18 14:04:43 +02:00
35026dfa0f try improve entt across-boundry support 2024-05-18 12:29:45 +02:00
2095bc6889 update sdl 2024-05-15 14:06:31 +02:00
634bc92665 update sdl_image 2024-05-15 13:54:06 +02:00
7 changed files with 53 additions and 13 deletions

View File

@ -38,6 +38,10 @@ if (TOMATO_ASAN)
endif()
endif()
# uggly, but it needs to be defined for all of tomato.
# but this also means that we can not compile tomato in the same cmake as plugins
add_compile_definitions(ENTT_API_EXPORT)
# external libs
add_subdirectory(./external) # before increasing warn levels, sad :(

View File

@ -10,7 +10,10 @@ if (NOT TARGET SDL3::SDL3)
FetchContent_Declare(SDL3
GIT_REPOSITORY https://github.com/libsdl-org/SDL
#GIT_TAG 0429f5d6a36fc35b551bcc2acd4a40c2db6dab82 # tip when looking
GIT_TAG 14f584a94bfd49cf1524db75bf3c419fdf9436cd # tip 26-04-2024
#GIT_TAG 14f584a94bfd49cf1524db75bf3c419fdf9436cd # tip 26-04-2024
GIT_TAG 06d6f2cb2518622593570985589700910cf4399f # 13-05-2024 - before
# made changes that break imgui release 1.90.6
#GIT_TAG 1103294d33f47ab4c697bb22a9cf27c79c658630 # tip 15-05-2024
FIND_PACKAGE_ARGS # for the future
)
FetchContent_MakeAvailable(SDL3)

View File

@ -15,7 +15,8 @@ if (NOT TARGET SDL3_image::SDL3_image)
FetchContent_Declare(SDL3_image
GIT_REPOSITORY https://github.com/libsdl-org/SDL_image
# waiting on the imgui pr to get merged so i can update sdl <.<
GIT_TAG a45d6e5b84ccc0f3faae6ba7d561709ed600eee7 # tip last check
#GIT_TAG a45d6e5b84ccc0f3faae6ba7d561709ed600eee7 # tip last check
GIT_TAG a34ccf16f961e6d5a480045eb650fc3dddb4bfaa # tip 14-05-2024
FIND_PACKAGE_ARGS # for the future
)
FetchContent_MakeAvailable(SDL3_image)

16
flake.lock generated
View File

@ -63,34 +63,34 @@
"sdl3": {
"flake": false,
"locked": {
"lastModified": 1714100414,
"narHash": "sha256-eaiVG5WJoLnFvdpYBR+DF+YuMu5C3lA1SKuzN8+hfDM=",
"lastModified": 1715616572,
"narHash": "sha256-SCl7RbRThjci0xXUz9vmwDfqp0kenxEuuvoNlx6yiyU=",
"owner": "libsdl-org",
"repo": "SDL",
"rev": "14f584a94bfd49cf1524db75bf3c419fdf9436cd",
"rev": "06d6f2cb2518622593570985589700910cf4399f",
"type": "github"
},
"original": {
"owner": "libsdl-org",
"repo": "SDL",
"rev": "14f584a94bfd49cf1524db75bf3c419fdf9436cd",
"rev": "06d6f2cb2518622593570985589700910cf4399f",
"type": "github"
}
},
"sdl3_image": {
"flake": false,
"locked": {
"lastModified": 1712700609,
"narHash": "sha256-PVPH1uJ6g65SzHUboeQE6ZkC+72doMz9t9SG2LBo+7I=",
"lastModified": 1715708273,
"narHash": "sha256-scNPhzGk+d8VqkOKsSxmH/OVLgkWrOkEeWn/b2f3XaU=",
"owner": "libsdl-org",
"repo": "SDL_image",
"rev": "a45d6e5b84ccc0f3faae6ba7d561709ed600eee7",
"rev": "a34ccf16f961e6d5a480045eb650fc3dddb4bfaa",
"type": "github"
},
"original": {
"owner": "libsdl-org",
"repo": "SDL_image",
"rev": "a45d6e5b84ccc0f3faae6ba7d561709ed600eee7",
"rev": "a34ccf16f961e6d5a480045eb650fc3dddb4bfaa",
"type": "github"
}
},

View File

@ -11,11 +11,11 @@
flake = false;
};
sdl3 = {
url = "github:libsdl-org/SDL/14f584a94bfd49cf1524db75bf3c419fdf9436cd"; # keep in sync this cmake
url = "github:libsdl-org/SDL/06d6f2cb2518622593570985589700910cf4399f"; # keep in sync this cmake
flake = false;
};
sdl3_image = {
url = "github:libsdl-org/SDL_image/a45d6e5b84ccc0f3faae6ba7d561709ed600eee7";
url = "github:libsdl-org/SDL_image/a34ccf16f961e6d5a480045eb650fc3dddb4bfaa";
flake = false;
};
};

View File

@ -105,3 +105,8 @@ target_link_libraries(tomato PUBLIC
SDL3_image::SDL3_image
)
# probably not enough
#target_compile_definitions(tomato PUBLIC ENTT_API_EXPORT)
set_target_properties(tomato PROPERTIES POSITION_INDEPENDENT_CODE ON)

View File

@ -80,8 +80,35 @@ MainScreen::MainScreen(SDL_Renderer* renderer_, Theme& theme_, std::string save_
for (const auto& ppath : plugins) {
if (!pm.add(ppath)) {
std::cerr << "MS error: loading plugin '" << ppath << "' failed!\n";
// thow?
assert(false && "failed to load plugin");
//assert(false && "failed to load plugin");
SDL_MessageBoxData mb;
mb.flags = SDL_MESSAGEBOX_ERROR;
mb.window = nullptr;
mb.title = "Tomato failed to load a plugin!";
std::string message {"Failed to load plugin '"};
message += ppath;
message += "' !";
mb.message = message.c_str();
mb.numbuttons = 2;
SDL_MessageBoxButtonData mb_buttons[2] {};
mb_buttons[0].buttonID = 1;
mb_buttons[0].flags = SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT;
mb_buttons[0].text = "Abort";
mb_buttons[1].buttonID = 2;
mb_buttons[1].flags = SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT;
mb_buttons[1].text = "Continue Anyway";
mb.buttons = mb_buttons;
mb.colorScheme = nullptr;
int button_id = 0;
SDL_ShowMessageBox(&mb, &button_id);
if (button_id == 1) {
exit(1);
}
}
}