|
Plutonium framework API 1.0.0
Easy-to-use, SDL2-based UI framework for Nintendo Switch homebrew
|
Classes | |
| class | Renderer |
| The main class dealing with rendering. More... | |
| struct | RendererInitOptions |
| Represents the options for initializing the Renderer. More... | |
| struct | TextureRenderOptions |
| Represents the options for rendering a texture. More... | |
Functions | |
| sdl2::Renderer | GetMainRenderer () |
| Gets the underlying SDL2 renderer. | |
| sdl2::Window | GetMainWindow () |
| Gets the underlying SDL2 window. | |
| sdl2::Surface | GetMainSurface () |
| Gets the underlying SDL2 surface. | |
| std::pair< u32, u32 > | GetDimensions () |
| Gets the underlying SDL2 window width/height. | |
| bool | AddFont (const std::string &font_name, std::shared_ptr< ttf::Font > &font) |
| Creates a font to the internal font list. | |
| bool | LoadSingleSharedFontInFont (std::shared_ptr< ttf::Font > &font, const PlSharedFontType type) |
| Loads a system shared font (pl:) in a font object. | |
| bool | LoadAllSharedFontsInFont (std::shared_ptr< ttf::Font > &font) |
| Loads all system shared fonts (pl:) in a font object. | |
| void | AddDefaultFont (std::shared_ptr< ttf::Font > &font) |
| Adds a font object as a default font to the internal font list. | |
| bool | GetTextDimensions (const std::string &font_name, const std::string &text, i32 &out_width, i32 &out_height) |
| Gets the resulting text size for rendering a text with the specified font. | |
| i32 | GetTextWidth (const std::string &font_name, const std::string &text) |
| Gets the resulting text width for rendering a text with the specified font. | |
| i32 | GetTextHeight (const std::string &font_name, const std::string &text) |
| Gets the resulting text height for rendering a text with the specified font. | |
| sdl2::Texture | RenderText (const std::string &font_name, const std::string &text, const Color clr, const u32 max_width=0, const u32 max_height=0) |
| Renders a text to a texture. | |
| sdl2::Texture | ConvertToTexture (sdl2::Surface surface) |
| Converts a Surface to a Texture. | |
| sdl2::Texture | LoadImage (const std::string &path) |
| Loads an image from the specified path. | |
| i32 | GetTextureWidth (sdl2::Texture texture) |
| Gets the width of a Texture. | |
| i32 | GetTextureHeight (sdl2::Texture texture) |
| Gets the height of a Texture. | |
| void | SetAlphaValue (sdl2::Texture texture, const u8 alpha) |
| Sets the alpha value (for blending) of a Texture. | |
| void | DeleteTexture (sdl2::Texture &texture) |
| Frees a Texture from memory, and sets nullptr to the reference. | |
Variables | |
| constexpr u32 | BaseScreenWidth = 1280 |
| constexpr u32 | BaseScreenHeight = 720 |
| constexpr u32 | ScreenWidth = 1920 |
| constexpr u32 | ScreenHeight = 1080 |
| constexpr double | ScreenFactor = (double)ScreenWidth / (double)BaseScreenWidth |
| constexpr u32 | ImgAllFlags = IMG_INIT_PNG | IMG_INIT_JPG | IMG_INIT_WEBP |
| constexpr u32 | RendererSoftwareFlags = SDL_RENDERER_SOFTWARE |
| constexpr u32 | RendererHardwareFlags = SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED |
|
inline |
Adds a font object as a default font to the internal font list.
| font | The font object to add. |
| bool pu::ui::render::AddFont | ( | const std::string & | font_name, |
| std::shared_ptr< ttf::Font > & | font ) |
Creates a font to the internal font list.
| font_name | The name to use for the font. |
| font | The font to add. |
| sdl2::Texture pu::ui::render::ConvertToTexture | ( | sdl2::Surface | surface | ) |
Converts a Surface to a Texture.
| surface | The Surface to convert. |
| void pu::ui::render::DeleteTexture | ( | sdl2::Texture & | texture | ) |
Frees a Texture from memory, and sets nullptr to the reference.
| texture | The Texture to free. |
| std::pair< u32, u32 > pu::ui::render::GetDimensions | ( | ) |
Gets the underlying SDL2 window width/height.
| sdl2::Renderer pu::ui::render::GetMainRenderer | ( | ) |
Gets the underlying SDL2 renderer.
| sdl2::Surface pu::ui::render::GetMainSurface | ( | ) |
Gets the underlying SDL2 surface.
| sdl2::Window pu::ui::render::GetMainWindow | ( | ) |
Gets the underlying SDL2 window.
| bool pu::ui::render::GetTextDimensions | ( | const std::string & | font_name, |
| const std::string & | text, | ||
| i32 & | out_width, | ||
| i32 & | out_height ) |
Gets the resulting text size for rendering a text with the specified font.
| font_name | The name of the font to use. |
| text | The text to render. |
| out_width | The resulting width of the text. |
| out_height | The resulting height of the text. |
| i32 pu::ui::render::GetTextHeight | ( | const std::string & | font_name, |
| const std::string & | text ) |
Gets the resulting text height for rendering a text with the specified font.
| font_name | The name of the font to use. |
| text | The text to render. |
| i32 pu::ui::render::GetTextureHeight | ( | sdl2::Texture | texture | ) |
Gets the height of a Texture.
| texture | The Texture to get the height from. |
| i32 pu::ui::render::GetTextureWidth | ( | sdl2::Texture | texture | ) |
Gets the width of a Texture.
| texture | The Texture to get the width from. |
| i32 pu::ui::render::GetTextWidth | ( | const std::string & | font_name, |
| const std::string & | text ) |
Gets the resulting text width for rendering a text with the specified font.
| font_name | The name of the font to use. |
| text | The text to render. |
| bool pu::ui::render::LoadAllSharedFontsInFont | ( | std::shared_ptr< ttf::Font > & | font | ) |
Loads all system shared fonts (pl:) in a font object.
| font | The font object to load the shared fonts in. |
| sdl2::Texture pu::ui::render::LoadImage | ( | const std::string & | path | ) |
Loads an image from the specified path.
| path | The path to the image. |
| bool pu::ui::render::LoadSingleSharedFontInFont | ( | std::shared_ptr< ttf::Font > & | font, |
| const PlSharedFontType | type ) |
Loads a system shared font (pl:) in a font object.
| font | The font object to load the shared font in. |
| type | The shared font type to add. |
| sdl2::Texture pu::ui::render::RenderText | ( | const std::string & | font_name, |
| const std::string & | text, | ||
| const Color | clr, | ||
| const u32 | max_width = 0, | ||
| const u32 | max_height = 0 ) |
Renders a text to a texture.
| font_name | The name of the font to use. |
| text | The text to render. |
| clr | The color to use for the text. |
| max_width | The maximum width of the text. |
| max_height | The maximum height of the text. |
| void pu::ui::render::SetAlphaValue | ( | sdl2::Texture | texture, |
| const u8 | alpha ) |
Sets the alpha value (for blending) of a Texture.
| texture | The Texture to set the alpha value to. |
| alpha | The alpha value to set. |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |