29 #ifndef NOMLIB_SDL2_WINDOW_HPP
30 #define NOMLIB_SDL2_WINDOW_HPP
40 #include "nomlib/config.hpp"
41 #include "nomlib/math/Coords.hpp"
42 #include "nomlib/math/Color.hpp"
43 #include "nomlib/math/Point2-inl.hpp"
44 #include "nomlib/graphics/VideoMode.hpp"
45 #include "nomlib/graphics/Renderer.hpp"
46 #include "nomlib/graphics/Image.hpp"
47 #include "nomlib/SDL_helpers.hpp"
66 const std::string& window_title, int32 width, int32 height,
68 uint32 context_flags = SDL_RENDERER_ACCELERATED
75 SDL_WINDOW::RawPtr
window (
void )
const;
120 void set_position ( int32 x, int32 y );
132 bool flip (
void )
const;
149 const std::string window_title (
void )
const;
151 void set_window_title (
const std::string& title );
166 static SDL_WINDOW::RawPtr
window_id ( uint32
id );
260 static SDL_RENDERER::RawPtr
context (
void );
271 static SDL_RENDERER::RawPtr context_;
273 SDL_WINDOW::UniquePtr window_;
295 #endif // include guard defined
void draw(SDL_SURFACE::RawPtr video_buffer, const Coords &bounds) const
static SDL_RENDERER::RawPtr context(void)
SDL_WINDOW::RawPtr window(void) const
Returns a raw pointer to the SDL_Window struct in use for this object.
const Coords bounds(void) const
uint32 window_id_
Cache the unique window identifier we get from SDL upon initialization.
void disable_screensaver(void)
bool create(const std::string &window_title, int32 width, int32 height, uint32 window_flags, uint32 context_flags=SDL_RENDERER_ACCELERATED)
void set_minimum_window_size(int min_width, int min_height)
bool save_screenshot(const std::string &filename) const
const Coords display_bounds(void) const
bool fullscreen(void) const
Getter for fullscreen_ state variable.
bool enabled_
State of the window (visible or not)
void maximize_window(void)
bool fullscreen_
Toggle window & full-screen states.
SDL_SURFACE::RawPtr window_surface(void) const
Obtain a SDL_Surface pointer from this Window.
void restore_window(void)
uint32 window_flags(void) const
static void set_context(Window::RawPtr window)
Video subsystem responsible for managing high-level graphics display (think: very fancy back-buffer)...
uint32 pixel_format(void) const
Obtain a pointer to this object's pixels.
Point2i position(void) const
Obtain this Window's position.
int window_display_id_
Cache the display identifier we get from SDL upon initialization.
void set_maximum_window_size(int max_width, int max_height)
VideoModeList getVideoModes(void) const
bool window_valid(void) const
Is this object initialized – not nullptr?
bool toggle_fullscreen(void)
uint32 window_id(void) const
Coordinate values (x, y, z, width, height ) wrapper.
int window_display_id(void) const
void enable_screensaver(void)
void set_fullscreen(bool state)
Set new fullscreen state.
bool set_window_icon(const std::string &filename)
Set an icon for this window.
void minimize_window(void)
void set_window_grab(bool grab)