6#include <J3ML/LinearAlgebra/Vector2.hpp>
15 Color4 clear_color{0,0,0,0};
18 bool using_depth =
false;
19 bool texture_created_by_us =
false;
20 GLuint framebuffer_object = 0;
21 GLuint depth_buffer = 0;
22 const Texture* texture =
nullptr;
24 GLuint msaa_framebuffer_object = 0;
25 GLuint msaa_depth_buffer = 0;
26 GLuint msaa_render_buffer = 0;
34 void Resize(
const Vector2& new_size);
57 [[nodiscard]] std::vector<GLfloat>
GetData()
const;
JGL::RenderTarget * render_target
Definition: JGL.cpp:14
Definition: RenderTarget.h:13
Color4 GetClearColor() const
Definition: RenderTarget.cpp:50
bool TextureCreatedByRenderTarget() const
Definition: RenderTarget.cpp:207
void SetMSAAEnabled(MSAA_SAMPLE_RATE sample_rate)
Definition: RenderTarget.cpp:219
RenderTarget(const RenderTarget &rhs)
Copy constructor. Will always set "texture_created_by_us" to true and use our own texture to avoid me...
Definition: RenderTarget.cpp:334
GLuint GetGLTextureHandle() const
Definition: RenderTarget.cpp:10
~RenderTarget()
Definition: RenderTarget.cpp:201
GLuint GetGLDepthBufferHandle() const
Definition: RenderTarget.cpp:18
MSAA_SAMPLE_RATE GetMSAASampleRate() const
Definition: RenderTarget.cpp:211
void Blit() const
If you're using raw OpenGL commands to draw to this outside of J2D or J3D don't forget to do this.
Definition: RenderTarget.cpp:276
std::vector< GLfloat > GetData() const
Get the data back from the FBO. This is not async friendly.
Definition: RenderTarget.cpp:127
static void SetActiveGLRenderTarget(const RenderTarget &render_target)
Definition: RenderTarget.cpp:28
Vector2 GetDimensions() const
Definition: RenderTarget.cpp:33
bool MSAAEnabled() const
Returns whether or not MSAA is enabled, If it is and you're not using J2D || J3D Begin / End,...
Definition: RenderTarget.cpp:215
void Resize(const Vector2 &new_size)
Change the size of the renderable area of the Render Target.
Definition: RenderTarget.cpp:138
GLuint GetGLFramebufferObjectHandle() const
Definition: RenderTarget.cpp:14
const Texture * GetJGLTexture() const
Definition: RenderTarget.cpp:6
static GLuint GetActiveGLFramebufferHandle()
Definition: RenderTarget.cpp:22
Represents texture data loaded on the GPU. Contains a handle that can be passed to OpenGL draw calls.
Definition: Texture.h:27
OpenGL Wrapper for rendering 2D & 3D graphics in both a 2D and 3D context.
Definition: JGL.h:31
MSAA_SAMPLE_RATE
Definition: Enums.h:37