Positioning & Rotation bugfixes.
Some checks failed
Run ReCI Build Test / Explore-Gitea-Actions (push) Failing after 1m51s

Make it such that a sprites "origin" doesn't effect the position. It is only the point at which transformations are done about.
This commit is contained in:
2024-09-14 21:28:32 -04:00
parent 881d031f3c
commit 0e22bc721a
4 changed files with 24 additions and 14 deletions

View File

@@ -11,6 +11,8 @@ namespace JGL {
class JGL::RenderTarget {
private:
Color4 clear_color{0,0,0,0};
/// "Size" in this sense is the "Renderable Area" because OpenGL textures behave strangely if they're not square.
Vector2 size{0, 0};
bool using_depth = false;
GLuint framebuffer_object = 0;
GLuint depth_buffer = 0;
@@ -29,7 +31,7 @@ public:
/// Create a render target for a texture that already exists. For decals.
explicit RenderTarget(const Texture& texture, const Color4& clear_color = Colors::Black, bool use_depth = false);
/// Create a Render Target with a brand new texture. Want to render JGL elements onto a texture and display it as a sprite?
explicit RenderTarget(unsigned int size, const Color4& clear_color = Colors::Black, bool use_depth = false);
explicit RenderTarget(const Vector2& size, const Color4& clear_color = Colors::Black, bool use_depth = false);
void Erase();
};