This commit is contained in:
AzaezelX 2022-03-23 01:43:08 -05:00
parent ee4253c982
commit 2614274639
1225 changed files with 148950 additions and 51674 deletions

View file

@ -1,5 +1,5 @@
/*
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@ -61,9 +61,9 @@ button_messagebox(void *eventNumber)
if (success == -1) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());
if (eventNumber) {
SDL_UserEvent event;
SDL_Event event;
event.type = (intptr_t)eventNumber;
SDL_PushEvent((SDL_Event*)&event);
SDL_PushEvent(&event);
return 1;
} else {
quit(2);
@ -72,9 +72,9 @@ button_messagebox(void *eventNumber)
SDL_Log("Pressed button: %d, %s\n", button, button == -1 ? "[closed]" : button == 1 ? "Cancel" : "OK");
if (eventNumber) {
SDL_UserEvent event;
SDL_Event event;
event.type = (intptr_t)eventNumber;
SDL_PushEvent((SDL_Event*)&event);
SDL_PushEvent(&event);
}
return 0;
@ -189,9 +189,15 @@ main(int argc, char *argv[])
SDL_Event event;
SDL_Window *window = SDL_CreateWindow("Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, 0);
/* On wayland, no window will actually show until something has
actually been displayed.
*/
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0);
SDL_RenderPresent(renderer);
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Simple MessageBox",
"This is a simple error MessageBox with a parent window",
"This is a simple error MessageBox with a parent window. Press a key or close the window after dismissing this messagebox.",
window);
if (success == -1) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s\n", SDL_GetError());