Files
hdk-sdl/examples/HelloWorld.cpp
T
2026-04-20 11:00:42 +00:00

27 lines
627 B
C++

#include <hdk/sdl.hpp>
using namespace hdk::sdl;
Window window { nullptr };
//Renderer renderer { nullptr };
int main(int argc, char* argv[])
{
window = Window::Create("Hello World", 800, 600, 0);
if (!window) {
SDL_Log("Failed to create window: %s", SDL_GetError());
return 1;
}
//
SDL_Event event;
bool running = true;
while (running) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_EVENT_QUIT) {
running = false;
}
}
}
window = nullptr; // Explicitly release the window before quitting SDL
return 0;
}