Files
untitled-game/inc/engine/sdl.hpp
2025-11-23 10:10:57 +00:00

29 lines
649 B
C++

#ifndef SDL_HPP
#define SDL_HPP
// Includes
#include <SDL3/SDL.h>
// Classes
class SDLWindow {
public:
SDLWindow(const char* title, int width, int height, SDL_WindowFlags flags = SDL_WINDOW_OPENGL | SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_HIDDEN);
~SDLWindow();
void setEventCallback(void (*callback)(const SDL_Event&));
void pollEvents();
bool isRunning() const;
void showWindow();
void hideWindow();
void setPosition(int x, int y);
SDL_Window* getSDLWindow() const;
private:
SDL_Window* window;
SDL_Event event;
bool running;
void (*eventCallback)(const SDL_Event&) = nullptr;
};
#endif