|
Plutonium framework API 1.0.0
Easy-to-use, SDL2-based UI framework for Nintendo Switch homebrew
|
The main class dealing with rendering. More...
#include <render_Renderer.hpp>
Public Member Functions | |
| Renderer (const RendererInitOptions init_opts) | |
| Creates a new Renderer with the specified initialization options. | |
| Result | Initialize () |
| Initializes the Renderer. | |
| void | Finalize () |
| Finalizes the Renderer. | |
| bool | HasInitialized () |
| Checks if the Renderer has been initialized. | |
| void | InitializeRender (const Color clr) |
| Initializes the rendering process. | |
| void | FinalizeRender () |
| Finalizes the rendering process. | |
| void | RenderTexture (sdl2::Texture texture, const i32 x, const i32 y, const TextureRenderOptions opts=TextureRenderOptions()) |
| Renders a texture to the screen. | |
| void | RenderRectangle (const Color clr, const i32 x, const i32 y, const i32 width, const i32 height) |
| Renders a rectangle to the screen (only the border). | |
| void | RenderRectangleFill (const Color clr, const i32 x, const i32 y, const i32 width, const i32 height) |
| Renders a filled rectangle to the screen. | |
| void | RenderRectangleOutline (const Color clr, const i32 x, const i32 y, const i32 width, const i32 height, const i32 border_width) |
| Renders a rectangle outline to the screen. | |
| void | RenderRoundedRectangle (const Color clr, const i32 x, const i32 y, const i32 width, const i32 height, const i32 radius) |
| Renders a rounded rectangle to the screen (only the border). | |
| void | RenderRoundedRectangleFill (const Color clr, const i32 x, const i32 y, const i32 width, const i32 height, const i32 radius) |
| Renders a filled rounded rectangle to the screen. | |
| void | RenderCircle (const Color clr, const i32 x, const i32 y, const i32 radius) |
| Renders a circle to the screen (only the border). | |
| void | RenderCircleFill (const Color clr, const i32 x, const i32 y, const i32 radius) |
| Renders a filled circle to the screen. | |
| void | RenderShadowSimple (const i32 x, const i32 y, const i32 width, const i32 height, const i32 base_alpha, const u8 main_alpha=0xFF) |
| Renders a simple shadow to the screen. | |
| void | SetBaseRenderPosition (const i32 x, const i32 y) |
| Sets the base render position for all rendering functions. | |
| void | ResetBaseRenderPosition () |
| Resets the base render position to (0, 0). | |
| void | SetBaseRenderAlpha (const u8 alpha) |
| Sets the base render alpha for all rendering functions. | |
| void | ResetBaseRenderAlpha () |
| Resets the base render alpha(no alpha modifications). | |
| void | UpdateInput () |
| Updates the input state. | |
| u64 | GetButtonsDown () |
| Gets the buttons that are currently pressed. | |
| u64 | GetButtonsUp () |
| Gets the buttons that are currently released. | |
| u64 | GetButtonsHeld () |
| Gets the buttons that are currently held. | |
The main class dealing with rendering.
|
inline |
| void pu::ui::render::Renderer::Finalize | ( | ) |
Finalizes the Renderer.
| void pu::ui::render::Renderer::FinalizeRender | ( | ) |
Finalizes the rendering process.
|
inline |
Gets the buttons that are currently pressed.
|
inline |
Gets the buttons that are currently held.
|
inline |
Gets the buttons that are currently released.
|
inline |
| Result pu::ui::render::Renderer::Initialize | ( | ) |
Initializes the Renderer.
| void pu::ui::render::Renderer::InitializeRender | ( | const Color | clr | ) |
Initializes the rendering process.
| clr | The color to use for the background. |
| void pu::ui::render::Renderer::RenderCircle | ( | const Color | clr, |
| const i32 | x, | ||
| const i32 | y, | ||
| const i32 | radius ) |
Renders a circle to the screen (only the border).
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| radius | The radius of the circle. |
| void pu::ui::render::Renderer::RenderCircleFill | ( | const Color | clr, |
| const i32 | x, | ||
| const i32 | y, | ||
| const i32 | radius ) |
Renders a filled circle to the screen.
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| radius | The radius of the circle. |
| void pu::ui::render::Renderer::RenderRectangle | ( | const Color | clr, |
| const i32 | x, | ||
| const i32 | y, | ||
| const i32 | width, | ||
| const i32 | height ) |
Renders a rectangle to the screen (only the border).
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| void pu::ui::render::Renderer::RenderRectangleFill | ( | const Color | clr, |
| const i32 | x, | ||
| const i32 | y, | ||
| const i32 | width, | ||
| const i32 | height ) |
Renders a filled rectangle to the screen.
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
|
inline |
Renders a rectangle outline to the screen.
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| border_width | The width of the border. |
| void pu::ui::render::Renderer::RenderRoundedRectangle | ( | const Color | clr, |
| const i32 | x, | ||
| const i32 | y, | ||
| const i32 | width, | ||
| const i32 | height, | ||
| const i32 | radius ) |
Renders a rounded rectangle to the screen (only the border).
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| radius | The radius of the rounded corners. |
| void pu::ui::render::Renderer::RenderRoundedRectangleFill | ( | const Color | clr, |
| const i32 | x, | ||
| const i32 | y, | ||
| const i32 | width, | ||
| const i32 | height, | ||
| const i32 | radius ) |
Renders a filled rounded rectangle to the screen.
| clr | The color to use for the rectangle. |
| x | The X position to render the rectangle. |
| y | The Y position to render the rectangle. |
| width | The width of the rectangle. |
| height | The height of the rectangle. |
| radius | The radius of the rounded corners. |
| void pu::ui::render::Renderer::RenderShadowSimple | ( | const i32 | x, |
| const i32 | y, | ||
| const i32 | width, | ||
| const i32 | height, | ||
| const i32 | base_alpha, | ||
| const u8 | main_alpha = 0xFF ) |
Renders a simple shadow to the screen.
| x | The X position to render the shadow. |
| y | The Y position to render the shadow. |
| width | The width of the shadow. |
| height | The height of the shadow. |
| base_alpha | The base alpha to use for the shadow. This is the starting alpha value at the top of the shadow. |
| main_alpha | The main alpha to use for the shadow. The shadow's alpha will be blended with this value. |
| void pu::ui::render::Renderer::RenderTexture | ( | sdl2::Texture | texture, |
| const i32 | x, | ||
| const i32 | y, | ||
| const TextureRenderOptions | opts = TextureRenderOptions() ) |
Renders a texture to the screen.
| texture | The texture to render. |
| x | The X position to render the texture. |
| y | The Y position to render the texture. |
| opts | The options to use for rendering the texture. |
|
inline |
Resets the base render alpha(no alpha modifications).
|
inline |
Resets the base render position to (0, 0).
|
inline |
Sets the base render alpha for all rendering functions.
| alpha | The alpha to use as the base render alpha. |
Sets the base render position for all rendering functions.
| x | The X position to use as the base render position. |
| y | The Y position to use as the base render position. |
|
inline |
Updates the input state.