|
Golias Engine
A C++ 20 'game engine' built with SDL3 with wide platform support.
|
#include <rendering_canvas.h>
Public Member Functions | |
| RenderingCanvas (RenderingDevice *device) | |
| ~RenderingCanvas () | |
| bool | initialize (int window_width, int window_height) |
| void | shutdown () |
| void | begin (const Color &color=Color::BLACK) |
| void | end () |
| void | set_camera (const glm::mat4 &view_projection) |
| void | reset_camera () |
| void | set_viewport_size (int width, int height) |
| void | set_scale_mode (ScaleMode mode) |
| void | draw_rect (float x, float y, float width, float height, const Color &color=Color::WHITE, float rotation=0.0f) |
| void | draw_rect_outlined (float x, float y, float width, float height, const Color &color=Color::WHITE, float thickness=1.0f) |
| void | draw_circle (float x, float y, float radius, const Color &color=Color::WHITE, int segments=32) |
| void | draw_circle_outlined (float x, float y, float radius, const Color &color=Color::WHITE, float thickness=1.0f, int segments=32) |
| void | draw_arc (float x, float y, float radius, float start_angle, float end_angle, const Color &color=Color::WHITE, int segments=32) |
| void | draw_line (float x1, float y1, float x2, float y2, const Color &color=Color::WHITE, float thickness=1.0f) |
| void | draw_triangle (float x1, float y1, float x2, float y2, float x3, float y3, const Color &color=Color::WHITE) |
| void | draw_polygon (const Vector< glm::vec2 > &points, const Color &color=Color::WHITE) |
| void | draw_texture (RID texture, float x, float y, float width=0, float height=0, const Color &tint=Color::WHITE, float rotation=0.0f) |
| void | draw_custom (RID shader, float x, float y, float width, float height, RID texture=INVALID_RID, const Color &color=Color::WHITE) |
| void | draw_texture_ex (float x, float y, float width, float height, RID texture=INVALID_RID, const Rect &source={0, 0, 0, 0}, const Color &color=Color::WHITE, float rotation=0.0f, bool flip_h=false, bool flip_v=false, const CanvasMaterial *material=nullptr) |
| template<typename... Args> | |
| void | draw_text (Font font, float x, float y, const Color &color, const char *format_str, Args &&... args) |
| void | draw_text (Font font, float x, float y, const Color &color, const String &text) |
| void | draw_text (float x, float y, const Color &color, const String &text) |
| Font | load_font_from_file (const char *filepath, int size) |
| RID | load_texture (const char *filepath) |
| RID | load_texture (const char *filepath, const TextureDescription &desc) |
| Texture | load_texture_from_file (const char *filepath) |
| Texture | load_texture_from_file (const char *filepath, const TextureDescription &desc) |
| void | get_texture_size (RID texture, uint32_t &out_width, uint32_t &out_height) |
| RID | load_texture_from_memory (void *data, int width, int height, int channels=4) |
| void | unload_texture (RID texture) |
| RID | load_shader_from_source (const char *vertex_src, const char *fragment_src) |
| RID | load_shader_from_file (const char *filepath) |
| RID | load_shader_from_source (const char *source) |
| void | destroy_shader (RID shader) |
| void | set_blend_mode (BlendMode mode) |
| void | set_line_width (float width) |
| void | present () |
| RenderingDevice * | get_rendering_device () const |
|
explicit |
| RenderingCanvas::~RenderingCanvas | ( | ) |
| void RenderingCanvas::begin | ( | const Color & | color = Color::BLACK | ) |
| void RenderingCanvas::destroy_shader | ( | RID | shader | ) |
| void RenderingCanvas::draw_arc | ( | float | x, |
| float | y, | ||
| float | radius, | ||
| float | start_angle, | ||
| float | end_angle, | ||
| const Color & | color = Color::WHITE, |
||
| int | segments = 32 |
||
| ) |
| void RenderingCanvas::draw_circle | ( | float | x, |
| float | y, | ||
| float | radius, | ||
| const Color & | color = Color::WHITE, |
||
| int | segments = 32 |
||
| ) |
| void RenderingCanvas::draw_circle_outlined | ( | float | x, |
| float | y, | ||
| float | radius, | ||
| const Color & | color = Color::WHITE, |
||
| float | thickness = 1.0f, |
||
| int | segments = 32 |
||
| ) |
| void RenderingCanvas::draw_custom | ( | RID | shader, |
| float | x, | ||
| float | y, | ||
| float | width, | ||
| float | height, | ||
| RID | texture = INVALID_RID, |
||
| const Color & | color = Color::WHITE |
||
| ) |
| void RenderingCanvas::draw_line | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| const Color & | color = Color::WHITE, |
||
| float | thickness = 1.0f |
||
| ) |
| void RenderingCanvas::draw_polygon | ( | const Vector< glm::vec2 > & | points, |
| const Color & | color = Color::WHITE |
||
| ) |
| void RenderingCanvas::draw_rect | ( | float | x, |
| float | y, | ||
| float | width, | ||
| float | height, | ||
| const Color & | color = Color::WHITE, |
||
| float | rotation = 0.0f |
||
| ) |
| void RenderingCanvas::draw_rect_outlined | ( | float | x, |
| float | y, | ||
| float | width, | ||
| float | height, | ||
| const Color & | color = Color::WHITE, |
||
| float | thickness = 1.0f |
||
| ) |
| void RenderingCanvas::draw_text | ( | Font | font, |
| float | x, | ||
| float | y, | ||
| const Color & | color, | ||
| const char * | format_str, | ||
| Args &&... | args | ||
| ) |
| void RenderingCanvas::draw_text | ( | Font | font, |
| float | x, | ||
| float | y, | ||
| const Color & | color, | ||
| const String & | text | ||
| ) |
| void RenderingCanvas::draw_texture | ( | RID | texture, |
| float | x, | ||
| float | y, | ||
| float | width = 0, |
||
| float | height = 0, |
||
| const Color & | tint = Color::WHITE, |
||
| float | rotation = 0.0f |
||
| ) |
| void RenderingCanvas::draw_texture_ex | ( | float | x, |
| float | y, | ||
| float | width, | ||
| float | height, | ||
| RID | texture = INVALID_RID, |
||
| const Rect & | source = {0, 0, 0, 0}, |
||
| const Color & | color = Color::WHITE, |
||
| float | rotation = 0.0f, |
||
| bool | flip_h = false, |
||
| bool | flip_v = false, |
||
| const CanvasMaterial * | material = nullptr |
||
| ) |
TODO: get from engine DT
| void RenderingCanvas::draw_triangle | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| float | x3, | ||
| float | y3, | ||
| const Color & | color = Color::WHITE |
||
| ) |
| void RenderingCanvas::end | ( | ) |
| RenderingDevice * RenderingCanvas::get_rendering_device | ( | ) | const |
| void RenderingCanvas::get_texture_size | ( | RID | texture, |
| uint32_t & | out_width, | ||
| uint32_t & | out_height | ||
| ) |
| bool RenderingCanvas::initialize | ( | int | window_width, |
| int | window_height | ||
| ) |
| Font RenderingCanvas::load_font_from_file | ( | const char * | filepath, |
| int | size | ||
| ) |
| RID RenderingCanvas::load_shader_from_file | ( | const char * | filepath | ) |
| RID RenderingCanvas::load_shader_from_source | ( | const char * | source | ) |
| RID RenderingCanvas::load_shader_from_source | ( | const char * | vertex_src, |
| const char * | fragment_src | ||
| ) |
| RID RenderingCanvas::load_texture | ( | const char * | filepath | ) |
| RID RenderingCanvas::load_texture | ( | const char * | filepath, |
| const TextureDescription & | desc | ||
| ) |
| Texture RenderingCanvas::load_texture_from_file | ( | const char * | filepath | ) |
| Texture RenderingCanvas::load_texture_from_file | ( | const char * | filepath, |
| const TextureDescription & | desc | ||
| ) |
| RID RenderingCanvas::load_texture_from_memory | ( | void * | data, |
| int | width, | ||
| int | height, | ||
| int | channels = 4 |
||
| ) |
| void RenderingCanvas::present | ( | ) |
| void RenderingCanvas::reset_camera | ( | ) |
| void RenderingCanvas::set_blend_mode | ( | BlendMode | mode | ) |
| void RenderingCanvas::set_camera | ( | const glm::mat4 & | view_projection | ) |
| void RenderingCanvas::set_line_width | ( | float | width | ) |
| void RenderingCanvas::set_scale_mode | ( | ScaleMode | mode | ) |
| void RenderingCanvas::set_viewport_size | ( | int | width, |
| int | height | ||
| ) |
| void RenderingCanvas::shutdown | ( | ) |
| void RenderingCanvas::unload_texture | ( | RID | texture | ) |