copy construct RenderTarget.
All checks were successful
Run ReCI Build Test / Explore-Gitea-Actions (push) Successful in 1m36s

This commit is contained in:
2024-10-13 16:37:51 -04:00
parent bb4a80e36d
commit cc504c65ec
4 changed files with 24 additions and 5 deletions

View File

@@ -10,9 +10,6 @@ namespace JGL {
class Texture; // Forward declare.
}
//TODO copy constructor for this. Copying this as it is and then that copy going out of scope will crash the program as it sits.
//If you do copy it you're doing it wrong. But still.
class JGL::RenderTarget {
private:
Color4 clear_color{0,0,0,0};
@@ -59,6 +56,8 @@ public:
/// Get the data back from the FBO. This is *not* async friendly.
[[nodiscard]] std::vector<GLfloat> GetData() const;
public:
/// Copy constructor. Will always set "texture_created_by_us" to true and use our own texture to avoid memleaks.
RenderTarget(const RenderTarget& rhs);
/// Create a render target for a texture that already exists. For adding to an existing texture.
explicit RenderTarget(const Texture* texture, const Color4& clear_color = Colors::Black);
/// Create a Render Target with a brand new texture. Want to render JGL elements onto a texture and display it as a sprite?