![]() |
nomlib
|
Public Types | |
| typedef RenderWindow | SelfType |
| typedef SelfType * | RawPtr |
Public Member Functions | |
| RenderWindow (void) | |
| Default constructor; initialize an object to sane, but invalid defaults. | |
| ~RenderWindow (void) | |
| Destructor; the current rendering context for the object is freed at this time. | |
| RenderWindow (const SelfType ©)=delete | |
| Copy constructor. | |
| SelfType & | operator= (const SelfType &other)=delete |
| Copy assignment operator. | |
| bool | create (const std::string &window_title, const Size2i &res, uint32 window_flags, int rendering_driver=DEFAULT_RENDERING_DRIVER, uint32 renderer_flags=DEFAULT_RENDERER_FLAGS) |
| Initialize a native platform window and renderer. | |
| bool | create (const std::string &window_title, const Point2i &pos, int display_index, const Size2i &res, uint32 window_flags, int rendering_driver=DEFAULT_RENDERING_DRIVER, uint32 renderer_flags=DEFAULT_RENDERER_FLAGS) |
| Initialize a native platform window and renderer. | |
| RenderWindow::RawPtr | get (void) |
| Obtain a pointer to this Window object. | |
| SDL_WINDOW::RawPtr | window (void) const |
| Returns a raw pointer to the SDL_Window struct in use for this object. | |
| SDL_SURFACE::RawPtr | window_surface (void) const |
| Obtain a SDL_Surface pointer from this Window. | |
| bool | valid (void) const |
| Get validity of the window and rendering context. | |
| bool | window_valid (void) const |
| Is this object initialized – not nullptr? | |
| Point2i | position () const |
| Get the window's current position. | |
| Size2i | size (void) const |
| Get this window's size dimensions. | |
| const uint8 | bits_per_pixel (void) const |
| Obtain the BPP (bits per pixel) of this window. | |
| uint32 | window_flags (void) const |
| uint32 | pixel_format (void) const |
| const IntRect | display_bounds (void) const |
| bool | display_modes (DisplayModeList &modes) const |
| Get the display mode capabilities of the window. | |
| int | refresh_rate () const |
| Get a video mode's refresh rate for the display of the window. | |
| void | set_size (int32 width, int32 height) |
| void | set_position (const Point2i &window_pos) |
| Set the window's position. | |
| bool | flip (void) const |
| bool | fullscreen (void) const |
| Getter for fullscreen_ state variable. | |
| void | set_fullscreen (bool state) |
| Set new fullscreen state. | |
| bool | toggle_fullscreen (void) |
| Set this window full screen if it is windowed, and windowed if it is full screen. | |
| bool | toggle_fullscreen (uint32 flags) |
| const std::string | window_title (void) const |
| void | set_window_title (const std::string &title) |
| bool | set_window_icon (const std::string &filename) |
| Set an icon for this window. | |
| uint32 | window_id (void) const |
| int | window_display_id () const |
| Get the display index associated with this window. | |
| std::string | display_name () const |
| Get the display name associated with this window. | |
| SDL_Window * | mouse_focus (void) const |
| Get the window which currently has mouse focus. | |
| void | enable_screensaver (void) |
| void | disable_screensaver (void) |
| bool | screen_saver (void) |
| void | maximize_window (void) |
| void | minimize_window (void) |
| void | raise_window (void) |
| void | restore_window (void) |
| void | show_window (void) |
| void | hide_window (void) |
| void | set_window_grab (bool grab) |
| void | set_minimum_window_size (int min_width, int min_height) |
| void | set_maximum_window_size (int max_width, int max_height) |
| bool | save_png_file (const std::string &filename) const |
| Output a screen-shot of the window as a PNG file. | |
| bool | save_screenshot (const std::string &filename) const |
| void | make_current (void) |
| Public Member Functions inherited from nom::Renderer | |
| Renderer (void) | |
| Default constructor; initializes instance to sane defaults. | |
| virtual | ~Renderer (void) |
| Lazy destructor with nothing to do. | |
| bool | create (SDL_WINDOW::RawPtr window, int rendering_driver=DEFAULT_RENDERING_DRIVER, uint32 renderer_flags=DEFAULT_RENDERER_FLAGS) |
| SDL_Renderer * | renderer (void) const |
| Get a raw pointer to the SDL_Renderer in use. | |
| bool | renderer_valid (void) const |
| Is this object initialized? Valid when NOT nullptr. | |
| Size2i | logical_size () const |
| Get the current logical resolution size. | |
| const Point2f | scale () const |
| Get the drawing scale for the rendering context. | |
| const IntRect | viewport (void) const |
| Get the current viewport dimensions. | |
| const SDL_BlendMode | blend_mode (void) const |
| Obtain the blending mode used for drawing. | |
| Size2i | output_size (void) const |
| Get the renderer's output size dimensions. | |
| IntRect | clip_bounds () const |
| Obtain the renderer's clipping rectangle bounds (in pixels). | |
| const RendererInfo | caps (void) const |
| Obtain information specific to your rendering hardware capabilities. | |
| bool | reset_render_target () const |
| Set the current rendering target back to the default renderer. | |
| bool | set_render_target (const Texture *texture) const |
| Set a texture as the current rendering target. | |
| void | update (void) const |
| Update the renderer surface on the attached window. | |
| bool | clear (void) const |
| bool | fill (const Color4i &color) |
| bool | set_logical_size (int width, int height) |
| bool | set_logical_size (const Size2i &size) |
| bool | set_scale (const Point2f &scale_factor) |
| Set the drawing scale for this rendering context. | |
| bool | set_viewport (const IntRect &bounds) |
| bool | set_color (const Color4i &color) |
| bool | set_blend_mode (const SDL_BlendMode mode) |
| bool | set_clip_bounds (const IntRect &bounds) |
| Set new clipping rectangle bounds for the rendering target. | |
| void * | pixels () const |
| Obtain pixels buffer of the entire rendering target. | |
Static Public Member Functions | |
| static SDL_WINDOW::RawPtr | window_id (uint32 id) |
| static std::string | display_name (int display_id) |
| Get the display name associated with a window. | |
| static SDL_Renderer * | context (void) |
| Obtain the active rendering context. | |
| static int | num_video_displays () |
| Get the number of available video displays. | |
| Static Public Member Functions inherited from nom::Renderer | |
| static const RendererInfo | caps (SDL_Renderer *target) |
| Obtain information specific to your rendering hardware capabilities. | |
Static Public Attributes | |
| static const Point2i | DEFAULT_WINDOW_POS |
| static const Point2i | WINDOW_POS_CENTERED |
| static const uint32 | DEFAULT_WINDOW_FLAGS = 0 |
| Static Public Attributes inherited from nom::Renderer | |
| static const int | DEFAULT_RENDERING_DRIVER = -1 |
| The index of the default rendering driver to use. | |
| static const uint32 | DEFAULT_RENDERER_FLAGS |
Static Private Member Functions | |
| static void | set_context (RenderWindow::RawPtr window) |
| Set a new nom::RenderWindow as the active rendering context; we must always have a context active at any given time for generating resources – nom::Texture, nom::Image, etc. | |
Private Attributes | |
| SDL_WINDOW::UniquePtr | window_ |
| uint32 | window_id_ |
| The unique identifier as recognized internally by SDL. | |
| int | window_display_id_ |
| The unique identifier given to the display. | |
| bool | enabled_ |
| State of the window (visible or not). | |
| bool | fullscreen_ |
| Toggle window & full-screen states. | |
Static Private Attributes | |
| static SDL_Renderer * | context_ |
Additional Inherited Members | |
| Protected Attributes inherited from nom::Renderer | |
| std::unique_ptr< SDL_Renderer, void(*)(SDL_Renderer *)> | renderer_ |
Definition at line 56 of file RenderWindow.hpp.
| typedef SelfType* nom::RenderWindow::RawPtr |
Definition at line 60 of file RenderWindow.hpp.
| typedef RenderWindow nom::RenderWindow::SelfType |
Definition at line 59 of file RenderWindow.hpp.
| nom::RenderWindow::~RenderWindow | ( | void | ) |
Destructor; the current rendering context for the object is freed at this time.
|
delete |
Copy constructor.
|
static |
Obtain the active rendering context.
| bool nom::RenderWindow::create | ( | const std::string & | window_title, |
| const Point2i & | pos, | ||
| int | display_index, | ||
| const Size2i & | res, | ||
| uint32 | window_flags, | ||
| int | rendering_driver = DEFAULT_RENDERING_DRIVER, | ||
| uint32 | renderer_flags = DEFAULT_RENDERER_FLAGS ) |
Initialize a native platform window and renderer.
| pos | The position of the window, relative to the video display bounds. |
| display_index | The video display to position the window on. |
| void nom::RenderWindow::disable_screensaver | ( | void | ) |
Prevent the screen from being blanked by a screen saver.
It is automatically re-enabled by SDL upon exit.
| const IntRect nom::RenderWindow::display_bounds | ( | void | ) | const |
Get the desktop area represented by a display monitor
The primary desktop display is located at 0, 0.
| bool nom::RenderWindow::display_modes | ( | DisplayModeList & | modes | ) | const |
Get the display mode capabilities of the window.
| modes | The object reference to fill with the list of display video modes. |
| std::string nom::RenderWindow::display_name | ( | ) | const |
Get the display name associated with this window.
|
static |
Get the display name associated with a window.
| void nom::RenderWindow::enable_screensaver | ( | void | ) |
Allow the screen to be blanked by a screen saver.
| bool nom::RenderWindow::flip | ( | void | ) | const |
Update the surface of the screen inside the window
(For use only with SDL Surfaces API)
Equivalent to SDL 1.2 API SDL_Flip()
| void nom::RenderWindow::hide_window | ( | void | ) |
Hide this window
| void nom::RenderWindow::make_current | ( | void | ) |
Set the current Window as the active rendering context; this must be called before doing any drawing (this includes creation of textures) when using multiple rendering windows.
| void nom::RenderWindow::maximize_window | ( | void | ) |
Maximize this window.
| void nom::RenderWindow::minimize_window | ( | void | ) |
Minimize this window.
| SDL_Window * nom::RenderWindow::mouse_focus | ( | void | ) | const |
Get the window which currently has mouse focus.
|
static |
Get the number of available video displays.
|
delete |
Copy assignment operator.
| void nom::RenderWindow::raise_window | ( | void | ) |
Raise this window.
| int nom::RenderWindow::refresh_rate | ( | ) | const |
Get a video mode's refresh rate for the display of the window.
| void nom::RenderWindow::restore_window | ( | void | ) |
Restore this window.
| bool nom::RenderWindow::save_png_file | ( | const std::string & | filename | ) | const |
Output a screen-shot of the window as a PNG file.
| filename | Absolute or relative file path. |
| bool nom::RenderWindow::save_screenshot | ( | const std::string & | filename | ) | const |
Save a screen shot of the window as a PNG file
| filename | Absolute or relative file path |
| bool nom::RenderWindow::screen_saver | ( | void | ) |
| void nom::RenderWindow::set_maximum_window_size | ( | int | max_width, |
| int | max_height ) |
Set the maximum size of the window's client area.
| max_width | Maximum width of window in pixels |
| max_height | Maximum height of window in pixels |
| void nom::RenderWindow::set_minimum_window_size | ( | int | min_width, |
| int | min_height ) |
Set the minimum size of the window's client area.
| min_width | Minimum width of window in pixels |
| min_height | Minimum height of window in pixels |
| void nom::RenderWindow::set_window_grab | ( | bool | grab | ) |
Set the window input grab mode.
| grab | TRUE to grab input; FALSE to release input |
| bool nom::RenderWindow::set_window_icon | ( | const std::string & | filename | ) |
Set an icon for this window.
| void nom::RenderWindow::show_window | ( | void | ) |
Show this window
| Size2i nom::RenderWindow::size | ( | void | ) | const |
Get this window's size dimensions.
| bool nom::RenderWindow::toggle_fullscreen | ( | uint32 | flags | ) |
Set this window full screen if it is windowed, and windowed if it is full screen.
| flags | SDL_WINDOW_FULLSCREEN_DESKTOP || SDL_WINDOW_FULLSCREEN |
| bool nom::RenderWindow::toggle_fullscreen | ( | void | ) |
Set this window full screen if it is windowed, and windowed if it is full screen.
| int nom::RenderWindow::window_display_id | ( | ) | const |
Get the display index associated with this window.
|
static |
| uint32 nom::RenderWindow::window_id | ( | void | ) | const |
Obtain this window's unique identifier
|
staticprivate |
Definition at line 377 of file RenderWindow.hpp.
|
static |
Definition at line 64 of file RenderWindow.hpp.
|
static |
Definition at line 62 of file RenderWindow.hpp.
|
private |
State of the window (visible or not).
Definition at line 388 of file RenderWindow.hpp.
|
private |
Toggle window & full-screen states.
Definition at line 391 of file RenderWindow.hpp.
|
private |
Definition at line 379 of file RenderWindow.hpp.
|
private |
The unique identifier given to the display.
Definition at line 385 of file RenderWindow.hpp.
|
private |
The unique identifier as recognized internally by SDL.
Definition at line 382 of file RenderWindow.hpp.
|
static |
Definition at line 63 of file RenderWindow.hpp.