#include <SDL3/SDL.h>
#if _WIN32 // PLATFORM_WINDOWS
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <windows.h>
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow) {
if (!SDL_Init(SDL_INIT_VIDEO)) {
SDL_Log("Couldn't initialize SDL: %s", SDL_GetError());
return SDL_APP_FAILURE;
}
SDL_Window* window = SDL_CreateWindow(
"SDL3 window", // window title
800, // width, in pixels
600, // height, in pixels
SDL_WINDOW_OPENGL // flag
);
// Check that the window was successfully created
if (window == NULL) {
// SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Could not create window: %s\n", SDL_GetError());
MessageBoxA(0, SDL_GetError(), "Could not create window", MB_OK);
return 1;
}
// The window is open for 2 second
SDL_Delay(2000); // Pause execution for 2000 milliseconds
// Close and destroy the window
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
#endif