60 mxWindow(
const std::string &name,
int w,
int h,
bool full =
false);
74 virtual void event(SDL_Event &
e) = 0;
80 virtual void draw(SDL_Renderer *ren) = 0;
115 void setIcon(SDL_Surface *icon);
121 void setIcon(
const std::string &icon);
163 void create_window(
const std::string &name,
int w,
int h,
bool full);
SDL_mixer–based audio manager.
Helper for rendering text strings with SDL_Renderer.
Utility bag for SDL-based applications.
void setObject(obj::Object *o)
Attach an obj::Object to receive draw/event callbacks.
void setIcon(SDL_Surface *icon)
Set the window icon from an SDL_Surface.
void setFullScreen(bool full)
Toggle fullscreen mode.
void destroy()
Stop the loop on the next cycle (sets active = false).
void create_window(const std::string &name, int w, int h, bool full)
Internal helper: create and initialise the SDL window+renderer.
void loop()
Run the event+draw loop until setActive(false) is called.
void proc()
Process one iteration of events and drawing.
SDL_Renderer * renderer
Active SDL renderer.
virtual void event(SDL_Event &e)=0
Process a single SDL event (pure virtual).
Mixer mixer
Audio mixer (only when built with WITH_MIXER).
mxUtil util
Utility/asset helper.
virtual ~mxWindow()
Destructor — destroys the SDL2 window and renderer.
SDL_Event e
Reusable SDL event structure.
void quit()
Request the SDL event loop to quit.
virtual void draw(SDL_Renderer *ren)=0
Draw the current frame (pure virtual).
void setActive(bool a)
Enable or disable the main loop.
mxWindow(mxWindow &&)=delete
void setWindowTitle(const std::string &title)
Change the window title bar text.
mxWindow & operator=(const mxWindow &)=delete
mxWindow & operator=(mxWindow &&)=delete
SDL_Window * window
Underlying SDL window handle.
int width
Window width in pixels.
std::unique_ptr< obj::Object > object
Optional attached game object.
Text text
2D text renderer.
void setPath(const std::string &path)
Prepend the asset directory to all relative file paths.
SDL_Texture * createTexture(int w, int h)
Create a streaming SDL_Texture of the given size.
mxWindow(const mxWindow &)=delete
int height
Window height in pixels.
bool active
Controls the main loop.
Abstract base class for all drawable game objects.
Compile-time feature flags and version macros for libmx.
Exception type used throughout libmx.
SDL_ttf font and 2D text rendering wrappers.
SDL joystick and game controller RAII wrappers.
PNG image loading and saving utilities via SDL.
Abstract game-object interface for the SDL window loop.
SDL_mixer audio subsystem wrapper (requires WITH_MIXER build flag).
Tee stream utilities that duplicate output to two sinks simultaneously.
SDL_Texture RAII wrapper with loading, saving, and flip utilities.
General SDL utility helpers, file I/O, and compression utilities.
Type-safe nullable pointer wrapper inspired by Rust's Option<T>.