27 lines
627 B
C++
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;
|
|
} |