Antkeeper  0.0.1
Public Member Functions | Friends | List of all members
app::sdl_window Class Reference

#include <sdl-window.hpp>

Inheritance diagram for app::sdl_window:
app::window

Public Member Functions

 sdl_window (const std::string &title, const math::ivec2 &windowed_position, const math::ivec2 &windowed_size, bool maximized, bool fullscreen, bool v_sync)
 
 sdl_window (const sdl_window &)=delete
 
 sdl_window (sdl_window &&)=delete
 
sdl_windowoperator= (const sdl_window &)=delete
 
sdl_windowoperator= (sdl_window &&)=delete
 
virtual ~sdl_window ()
 
void set_title (const std::string &title) override
 Changes the title of the window. More...
 
void set_position (const math::ivec2 &position) override
 Changes the position of the window. More...
 
void set_size (const math::ivec2 &size) override
 Changes the size of the window. More...
 
void set_minimum_size (const math::ivec2 &size) override
 Sets the minimum size of the window. More...
 
void set_maximum_size (const math::ivec2 &size) override
 Sets the maximum size of the window. More...
 
void set_maximized (bool maximized) override
 Maximizes or unmaximizes the window. More...
 
void set_fullscreen (bool fullscreen) override
 Enables or disables fullscreen mode. More...
 
void set_v_sync (bool v_sync) override
 Enables or disables v-sync. More...
 
void make_current () override
 Makes the window's graphics context current. More...
 
void swap_buffers () override
 Swaps the front and back buffers of the window's graphics context. More...
 
const gl::pipelineget_graphics_pipeline () const noexcept override
 Returns the graphics pipeline associated with this window. More...
 
gl::pipelineget_graphics_pipeline () noexcept override
 Returns the graphics pipeline associated with this window. More...
 
- Public Member Functions inherited from app::window
const std::string & get_title () const noexcept
 Returns the title of the window. More...
 
const math::ivec2get_windowed_position () const noexcept
 Returns the windowed (non-maximized, non-fullscreen) position of the window, in display units. More...
 
const math::ivec2get_position () const noexcept
 Returns the current position of the window, in display units. More...
 
const math::ivec2get_windowed_size () const noexcept
 Returns the windowed (non-maximized, non-fullscreen) size of the window, in display units. More...
 
const math::ivec2get_size () const noexcept
 Returns the current size of the window, in display units. More...
 
const math::ivec2get_minimum_size () const noexcept
 Returns the minimum size of the window, in display units. More...
 
const math::ivec2get_maximum_size () const noexcept
 Returns the maximum size of the window, in display units. More...
 
const math::ivec2get_viewport_size () const noexcept
 Returns the current size of the window's drawable viewport, in pixels. More...
 
bool is_maximized () const noexcept
 Returns true if the window is maximized, false otherwise. More...
 
bool is_fullscreen () const noexcept
 Returns true if the window is in fullscreen mode, false otherwise. More...
 
bool get_v_sync () const noexcept
 Returns true if the v-sync is enabled, false otherwise. More...
 
event::channel< window_closed_event > & get_closed_channel () noexcept
 Returns the channel through which window closed events are published. More...
 
event::channel< window_focus_changed_event > & get_focus_changed_channel () noexcept
 Returns the channel through which window focus changed events are published. More...
 
event::channel< window_maximized_event > & get_maximized_channel () noexcept
 Returns the channel through which window maximized events are published. More...
 
event::channel< window_minimized_event > & get_minimized_channel () noexcept
 Returns the channel through which window minimized events are published. More...
 
event::channel< window_moved_event > & get_moved_channel () noexcept
 Returns the channel through which window moved events are published. More...
 
event::channel< window_resized_event > & get_resized_channel () noexcept
 Returns the channel through which window resized events are published. More...
 
event::channel< window_restored_event > & get_restored_channel () noexcept
 Returns the channel through which window restored events are published. More...
 

Friends

class sdl_window_manager
 

Additional Inherited Members

- Protected Attributes inherited from app::window
std::string m_title
 
math::ivec2 m_windowed_position {0, 0}
 
math::ivec2 m_position {0, 0}
 
math::ivec2 m_windowed_size {0, 0}
 
math::ivec2 m_size {0, 0}
 
math::ivec2 m_minimum_size {0, 0}
 
math::ivec2 m_maximum_size {0, 0}
 
math::ivec2 m_viewport_size {0, 0}
 
bool m_maximized {false}
 
bool m_fullscreen {false}
 
bool m_v_sync {false}
 
event::publisher< window_closed_eventm_closed_publisher
 
event::publisher< window_focus_changed_eventm_focus_changed_publisher
 
event::publisher< window_maximized_eventm_maximized_publisher
 
event::publisher< window_minimized_eventm_minimized_publisher
 
event::publisher< window_moved_eventm_moved_publisher
 
event::publisher< window_resized_eventm_resized_publisher
 
event::publisher< window_restored_eventm_restored_publisher
 

Detailed Description

Definition at line 32 of file sdl-window.hpp.

Constructor & Destructor Documentation

◆ sdl_window() [1/3]

app::sdl_window::sdl_window ( const std::string &  title,
const math::ivec2 windowed_position,
const math::ivec2 windowed_size,
bool  maximized,
bool  fullscreen,
bool  v_sync 
)

Definition at line 29 of file sdl-window.cpp.

◆ sdl_window() [2/3]

app::sdl_window::sdl_window ( const sdl_window )
delete

◆ sdl_window() [3/3]

app::sdl_window::sdl_window ( sdl_window &&  )
delete

◆ ~sdl_window()

app::sdl_window::~sdl_window ( )
virtual

Definition at line 185 of file sdl-window.cpp.

Member Function Documentation

◆ get_graphics_pipeline() [1/2]

const gl::pipeline& app::sdl_window::get_graphics_pipeline ( ) const
inlineoverridevirtualnoexcept

Returns the graphics pipeline associated with this window.

Implements app::window.

Definition at line 62 of file sdl-window.hpp.

◆ get_graphics_pipeline() [2/2]

gl::pipeline& app::sdl_window::get_graphics_pipeline ( )
inlineoverridevirtualnoexcept

Returns the graphics pipeline associated with this window.

Implements app::window.

Definition at line 67 of file sdl-window.hpp.

◆ make_current()

void app::sdl_window::make_current ( )
overridevirtual

Makes the window's graphics context current.

Implements app::window.

Definition at line 286 of file sdl-window.cpp.

◆ operator=() [1/2]

sdl_window& app::sdl_window::operator= ( const sdl_window )
delete

◆ operator=() [2/2]

sdl_window& app::sdl_window::operator= ( sdl_window &&  )
delete

◆ set_fullscreen()

void app::sdl_window::set_fullscreen ( bool  fullscreen)
overridevirtual

Enables or disables fullscreen mode.

Parameters
fullscreentrue if the window should be in fullscreen mode, false otherwise.

Implements app::window.

Definition at line 237 of file sdl-window.cpp.

◆ set_maximized()

void app::sdl_window::set_maximized ( bool  maximized)
overridevirtual

Maximizes or unmaximizes the window.

Parameters
maximizedtrue if the window should be maximized, false otherwise.

Implements app::window.

Definition at line 225 of file sdl-window.cpp.

◆ set_maximum_size()

void app::sdl_window::set_maximum_size ( const math::ivec2 size)
overridevirtual

Sets the maximum size of the window.

Parameters
sizeMaximum size of the window, in display units.

Implements app::window.

Definition at line 219 of file sdl-window.cpp.

◆ set_minimum_size()

void app::sdl_window::set_minimum_size ( const math::ivec2 size)
overridevirtual

Sets the minimum size of the window.

Parameters
sizeMinimum size of the window, in display units.

Implements app::window.

Definition at line 213 of file sdl-window.cpp.

◆ set_position()

void app::sdl_window::set_position ( const math::ivec2 position)
overridevirtual

Changes the position of the window.

Parameters
positionPosition of the window, in display units.

Implements app::window.

Definition at line 203 of file sdl-window.cpp.

◆ set_size()

void app::sdl_window::set_size ( const math::ivec2 size)
overridevirtual

Changes the size of the window.

Parameters
sizeSize of the window, in display units.

Implements app::window.

Definition at line 208 of file sdl-window.cpp.

◆ set_title()

void app::sdl_window::set_title ( const std::string &  title)
overridevirtual

Changes the title of the window.

Parameters
titleWindow title.

Implements app::window.

Definition at line 197 of file sdl-window.cpp.

◆ set_v_sync()

void app::sdl_window::set_v_sync ( bool  v_sync)
overridevirtual

Enables or disables v-sync.

Parameters
v_synctrue if the v-sync should be enabled, false otherwise.

Implements app::window.

Definition at line 245 of file sdl-window.cpp.

◆ swap_buffers()

void app::sdl_window::swap_buffers ( )
overridevirtual

Swaps the front and back buffers of the window's graphics context.

Implements app::window.

Definition at line 291 of file sdl-window.cpp.

Friends And Related Function Documentation

◆ sdl_window_manager

friend class sdl_window_manager
friend

Definition at line 73 of file sdl-window.hpp.


The documentation for this class was generated from the following files: