![]() |
nomlib
|
Video subsystem responsible for managing high-level graphics display (think: very fancy back-buffer). More...
#include <Renderer.hpp>
Public Member Functions | |
| 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 const RendererInfo | caps (SDL_Renderer *target) |
| Obtain information specific to your rendering hardware capabilities. | |
Static Public Attributes | |
| static const int | DEFAULT_RENDERING_DRIVER = -1 |
| The index of the default rendering driver to use. | |
| static const uint32 | DEFAULT_RENDERER_FLAGS |
Protected Attributes | |
| std::unique_ptr< SDL_Renderer, void(*)(SDL_Renderer *)> | renderer_ |
Video subsystem responsible for managing high-level graphics display (think: very fancy back-buffer).
A nom::RenderWindow is lifeless without its attached Renderer buddy!
Definition at line 53 of file Renderer.hpp.
|
static |
Obtain information specific to your rendering hardware capabilities.
| const RendererInfo nom::Renderer::caps | ( | void | ) | const |
Obtain information specific to your rendering hardware capabilities.
| bool nom::Renderer::clear | ( | void | ) | const |
Clear the whole rendering object; ignoring the viewport.
(to a rendering color, if set?)
This method is usually called after setting the rendering draw color.
| bool nom::Renderer::create | ( | SDL_WINDOW::RawPtr | window, |
| int | rendering_driver = DEFAULT_RENDERING_DRIVER, | ||
| uint32 | renderer_flags = DEFAULT_RENDERER_FLAGS ) |
Initialize a Renderer instance with an existing, initialized SDL_Window
Initializes with the first rendering driver supporting our request flags Enables video acceleration when able
| bool nom::Renderer::fill | ( | const Color4i & | color | ) |
Fill the rendering target video display with a new color.
This combines two methods into one: set_color() and clear().
| Size2i nom::Renderer::output_size | ( | void | ) | const |
Get the renderer's output size dimensions.
| void * nom::Renderer::pixels | ( | ) | const |
Obtain pixels buffer of the entire rendering target.
| const Point2f nom::Renderer::scale | ( | ) | const |
Get the drawing scale for the rendering context.
| bool nom::Renderer::set_blend_mode | ( | const SDL_BlendMode | mode | ) |
Set the color blending mode (fill and line).
SDL_BLENDMODE_NONE SDL_BLENDMODE_BLEND SDL_BLENDMODE_ADD SDL_BLENDMODE_MOD
| bool nom::Renderer::set_clip_bounds | ( | const IntRect & | bounds | ) |
Set new clipping rectangle bounds for the rendering target.
| bounds | Passing nom::IntRect::null will disable clipping on the target. |
| bool nom::Renderer::set_logical_size | ( | const Size2i & | size | ) |
| bool nom::Renderer::set_logical_size | ( | int | width, |
| int | height ) |
Set device independent resolution for rendering
| width | Width of the new logical resolution |
| height | Height of the new logical resolution |
Sets both a new view port and any necessary rescaling to fit within a fixed, logical resolution for rendering.
| bool nom::Renderer::set_render_target | ( | const Texture * | texture | ) | const |
Set a texture as the current rendering target.
| bool nom::Renderer::set_scale | ( | const Point2f & | scale_factor | ) |
Set the drawing scale for this rendering context.
| bool nom::Renderer::set_viewport | ( | const IntRect & | bounds | ) |
Set a new drawing area for rendering
| bounds | Represents the drawing area to update; passing IntRect::null to set the viewport to the entire target |
|
static |
Definition at line 64 of file Renderer.hpp.
|
static |
The index of the default rendering driver to use.
Definition at line 62 of file Renderer.hpp.
|
protected |
This is automatically released after the attached nom::RenderWindow has been destroyed.
Definition at line 213 of file Renderer.hpp.