diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-08-24 13:54:14 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-08-24 13:54:14 +0200 |
commit | 61b2725ef174e4cec734e29bce4f69d6fcd2a813 (patch) | |
tree | b17b0ae285976f3f6762ae470c176c04e4d63228 /src/window | |
parent | 17254ca13ce7985e87a413df1d8546779734f05e (diff) |
Vertices: fix alpha blending when window background is transparent, add uniform for color, add position for vertices draw
Diffstat (limited to 'src/window')
-rw-r--r-- | src/window/Window.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/window/Window.cpp b/src/window/Window.cpp index 0e80456..8cfc28e 100644 --- a/src/window/Window.cpp +++ b/src/window/Window.cpp @@ -53,13 +53,13 @@ namespace mgl { Shader::use(nullptr); } - void Window::draw(const Vertex *vertices, size_t vertex_count, PrimitiveType primitive_type, Shader *shader) { + void Window::draw(const Vertex *vertices, size_t vertex_count, PrimitiveType primitive_type, mgl::vec2f position, Shader *shader) { // TODO: Make the opengl context active for this thread and window, if it already isn't if(shader) Shader::use(shader); mgl_context *context = mgl_get_context(); - mgl_vertices_draw(context, (const mgl_vertex*)vertices, vertex_count, (mgl_primitive_type)primitive_type, { 0.0f, 0.0f }); + mgl_vertices_draw(context, (const mgl_vertex*)vertices, vertex_count, (mgl_primitive_type)primitive_type, { position.x, position.y }); if(shader) Shader::use(nullptr); |