# Plutonium framework API: pu::ui::render Namespace Reference

pu::ui::render Namespace Reference

## Classes

class | Renderer
struct | RendererInitOptions
struct | TextureRenderOptions

## Functions

sdl2::Renderer | GetMainRenderer ()
sdl2::Window | GetMainWindow ()
sdl2::Surface | GetMainSurface ()
std::pair< u32, u32 > | GetDimensions ()
bool | AddSharedFont (const std::string &font_name, const u32 font_size, const PlSharedFontType type)
bool | AddAllSharedFonts (const std::string &font_name, const u32 font_size)
bool | AddFontFile (const std::string &font_name, const u32 font_size, const std::string &path)
void | AddDefaultFontFromShared (const u32 font_size)
void | AddDefaultFontFromFile (const u32 font_size, const std::string &path)
sdl2::Texture | RenderText (const std::string &font_name, const std::string &text, const Color clr)
i32 | GetTextWidth (const std::string &font_name, const std::string &text)
i32 | GetTextHeight (const std::string &font_name, const std::string &text)
sdl2::Texture | ConvertToTexture (sdl2::Surface surface)
sdl2::Texture | LoadImage (const std::string &path)
i32 | GetTextureWidth (sdl2::Texture texture)
i32 | GetTextureHeight (sdl2::Texture texture)
void | SetAlphaValue (sdl2::Texture texture, const u8 alpha)
void | DeleteTexture (sdl2::Texture &texture)

## Variables

constexpr u32 | ScreenWidth = 1280
constexpr u32 | ScreenHeight = 720
constexpr u32 | MixerAllFlags = MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG
constexpr u32 | IMGAllFlags = IMG_INIT_PNG | IMG_INIT_JPG | IMG_INIT_TIF | IMG_INIT_WEBP
constexpr u32 | RendererSoftwareFlags = SDL_RENDERER_SOFTWARE
constexpr u32 | RendererHardwareFlags = SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED

## Function Documentation

## AddAllSharedFonts()

bool pu::ui::render::AddAllSharedFonts | ( | const std::string & | font_name,
|  | const u32 | font_size
| ) |  |

## AddDefaultFontFromFile()

void pu::ui::render::AddDefaultFontFromFile | ( | const u32 | font_size,
|  | const std::string & | path
| ) |  |

inline

## AddDefaultFontFromShared()

void pu::ui::render::AddDefaultFontFromShared | ( | const u32 | font_size | ) |

inline

## AddFontFile()

bool pu::ui::render::AddFontFile | ( | const std::string & | font_name,
|  | const u32 | font_size,
|  | const std::string & | path
| ) |  |

## AddSharedFont()

bool pu::ui::render::AddSharedFont | ( | const std::string & | font_name,
|  | const u32 | font_size,
|  | const PlSharedFontType | type
| ) |  |

## ConvertToTexture()

sdl2::Texture pu::ui::render::ConvertToTexture | ( | sdl2::Surface | surface | ) |

## DeleteTexture()

void pu::ui::render::DeleteTexture | ( | sdl2::Texture & | texture | ) |

## GetDimensions()

std::pair< u32, u32 > pu::ui::render::GetDimensions | ( |  | ) |

## GetMainRenderer()

sdl2::Renderer pu::ui::render::GetMainRenderer | ( |  | ) |

## GetMainSurface()

sdl2::Surface pu::ui::render::GetMainSurface | ( |  | ) |

## GetMainWindow()

sdl2::Window pu::ui::render::GetMainWindow | ( |  | ) |

## GetTextHeight()

i32 pu::ui::render::GetTextHeight | ( | const std::string & | font_name,
|  | const std::string & | text
| ) |  |

## GetTextureHeight()

i32 pu::ui::render::GetTextureHeight | ( | sdl2::Texture | texture | ) |

## GetTextureWidth()

i32 pu::ui::render::GetTextureWidth | ( | sdl2::Texture | texture | ) |

## GetTextWidth()

i32 pu::ui::render::GetTextWidth | ( | const std::string & | font_name,
|  | const std::string & | text
| ) |  |

## LoadImage()

sdl2::Texture pu::ui::render::LoadImage | ( | const std::string & | path | ) |

## RenderText()

sdl2::Texture pu::ui::render::RenderText | ( | const std::string & | font_name,
|  | const std::string & | text,
|  | const Color | clr
| ) |  |

## SetAlphaValue()

void pu::ui::render::SetAlphaValue | ( | sdl2::Texture | texture,
|  | const u8 | alpha
| ) |  |

## Variable Documentation

## IMGAllFlags

constexpr u32 pu::ui::render::IMGAllFlags = IMG_INIT_PNG | IMG_INIT_JPG | IMG_INIT_TIF | IMG_INIT_WEBP

constexpr

## MixerAllFlags

constexpr u32 pu::ui::render::MixerAllFlags = MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG

constexpr

## RendererHardwareFlags

constexpr u32 pu::ui::render::RendererHardwareFlags = SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED

constexpr

## RendererSoftwareFlags

constexpr u32 pu::ui::render::RendererSoftwareFlags = SDL_RENDERER_SOFTWARE

constexpr

## ScreenHeight

constexpr u32 pu::ui::render::ScreenHeight = 720

constexpr

## ScreenWidth

constexpr u32 pu::ui::render::ScreenWidth = 1280

constexpr