|
| OpenglRenderer () |
|
| ~OpenglRenderer () override |
|
void | setup_shaders (Shader *default_shader, Shader *framebuffer_shader) |
|
void | initialize () override |
| Initialize the renderer and its resources. More...
|
|
void | resize_viewport (int view_width, int view_height) override |
| Resize the rendering context. More...
|
|
void | set_context (const void *ctx) override |
| Set the platform-specific rendering context. More...
|
|
void * | get_context () override |
| Get the platform-specific rendering context. More...
|
|
void | destroy () override |
| Destroy rendering resources. More...
|
|
std::shared_ptr< Texture > | load_texture (const std::string &file_path) override |
| Load a texture from disk. More...
|
|
std::shared_ptr< Texture > | get_texture (const std::string &path) override |
| Get a previously loaded texture. More...
|
|
bool | load_font (const std::string &file_path, const std::string &font_alias, int font_size) override |
| Load a font. More...
|
|
void | set_default_font (const std::string &font_name) override |
| Set the current font to use for rendering. More...
|
|
void | unload_font (const Font &font) override |
| Unload a loaded font. More...
|
|
void | unload_texture (Uint32 id) override |
| Unload a texture by its ID. More...
|
|
void | draw_texture (const Texture *texture, const Rect2 &dest_rect, float rotation, const glm::vec4 &color, const Rect2 &src_rect, int z_index, bool flip_h, bool flip_v, const UberShader &uber_shader) override |
| Draw a textured quad. More...
|
|
void | draw_rect (Rect2 rect, float rotation, const glm::vec4 &color, bool filled, int z_index) override |
| Draw a rectangle (filled or outlined). More...
|
|
void | draw_text (const std::string &text, float x, float y, float rotation, float scale, const glm::vec4 &color, const std::string &font_alias, int z_index, const UberShader &uber_shader, int ft_size) override |
| Draw text to screen. More...
|
|
void | draw_line (float x1, float y1, float x2, float y2, float width, float rotation, const glm::vec4 &color, int z_index) override |
| Draw a line. More...
|
|
void | draw_triangle (float x1, float y1, float x2, float y2, float x3, float y3, float rotation, const glm::vec4 &color, bool filled, int z_index) override |
| Draw a triangle. More...
|
|
void | draw_circle (float center_x, float center_y, float rotation, float radius, const glm::vec4 &color, bool filled, int segments, int z_index) override |
| Draw a circle. More...
|
|
void | draw_polygon (const std::vector< glm::vec2 > &points, float rotation, const glm::vec4 &color, bool filled, int z_index) override |
| Draw a polygon. More...
|
|
void | flush () override |
| Submit all batched draw calls. More...
|
|
void | present () override |
| Swap buffers to present the rendered frame. More...
|
|
void | clear (glm::vec4 color) override |
| Clear the screen to the given color. More...
|
|
Uint32 | get_framebuffer_texture () const override |
|
virtual | ~Renderer ()=default |
|
void | set_view_matrix (const glm::mat4 &view_matrix=glm::mat4(1.f)) |
|
glm::mat4 | get_view_matrix () const |
|
virtual HashMap< std::string, std::shared_ptr< Texture > > & | get_loaded_textures () |
|
virtual std::vector< std::string > & | get_loaded_fonts_name () |
|
|
int | Viewport [2] = {800, 600} |
| Viewport size. More...
|
|
SDL_Window * | Window = nullptr |
| SDL Window. More...
|
|
Backend | Type = Backend::GL_COMPATIBILITY |
| Default Type of renderer. More...
|
|
glm::vec2 | rotate_point (const glm::vec2 &point, const glm::vec2 ¢er, float radians) |
| Rotate a point around a center point. More...
|
|
Recti | calc_display () |
| Calculate the display rectangle for rendering based on the viewport and window size. More...
|
|
void | submit (const BatchKey &key, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const glm::vec4 &color, float rotation=0.0f, bool is_filled=true) |
| Add a quad (textured or untextured) to the appropriate batch. More...
|
|
HashMap< BatchKey, Batch > | _batches |
| All batches by key. More...
|
|
FT_Library | _ft = {} |
| FreeType library instance. More...
|
|
HashMap< std::string, Font > | fonts |
| Loaded fonts. More...
|
|
std::string | current_font_name |
| Currently selected font alias. More...
|
|
glm::mat4 | _projection = glm::mat4(1.f) |
| Projection matrix. More...
|
|
glm::mat4 | _view = glm::mat4(1.f) |
| View matrix. More...
|
|
HashMap< std::string, std::shared_ptr< Texture > > | _textures |
| Cached textures. More...
|
|
HashMap< Uint32, glm::vec2 > | _texture_sizes |
| HACK_FIX: Cached texture sizes by ID. More...
|
|
Opengl Renderer implementation.