#include <tb_render_target.h>
Public Member Functions | |
RenderTarget (const PixelSpace &targetWidth, const PixelSpace &targetHeight) | |
~RenderTarget (void) | |
void | BindRenderTarget (void) const |
void | UnbindRenderTarget (void) const |
tbGraphics::TextureHandle | GetTextureHandle (void) const |
PixelSpace | GetWidth (void) const |
PixelSpace | GetHeight (void) const |
float | GetAspectRatio (void) const |
The RenderTarget sets up a texture to render to and apply to be rendered after. Just call BindRenderTarget() to start rendering on the texture and UnbindRenderTarget() to go back to normal.
TurtleBrains::Graphics::RenderTarget::RenderTarget | ( | const PixelSpace & | targetWidth, |
const PixelSpace & | targetHeight | ||
) |
Creates a RenderTarget with specified width and height that can be used to setup and render desired results to the target texture and then applied however later, for full screen effects or other.
TurtleBrains::Graphics::RenderTarget::~RenderTarget | ( | void | ) |
Cleans up all resources used by the RenderTarget.
void TurtleBrains::Graphics::RenderTarget::BindRenderTarget | ( | void | ) | const |
Binds the RenderTarget to the context so any other Render calls will get displayed on the texture instead of the frame/back-buffer. Must call UnbindRenderTarget() to return back to the frame/back-buffer.
float TurtleBrains::Graphics::RenderTarget::GetAspectRatio | ( | void | ) | const |
Computes and returns the aspect ratio of the RenderTarget, (width/height) 1920 / 1080 ~= 1.77778.
PixelSpace TurtleBrains::Graphics::RenderTarget::GetHeight | ( | void | ) | const |
Retrieves the height in pixels.
tbGraphics::TextureHandle TurtleBrains::Graphics::RenderTarget::GetTextureHandle | ( | void | ) | const |
Retrieves the texture handle of the RenderTarget to be applied for full screen or object effects. This texture will be plain white unless rendered to between Bind/Unbind.
PixelSpace TurtleBrains::Graphics::RenderTarget::GetWidth | ( | void | ) | const |
Retrieves the width in pixels.
void TurtleBrains::Graphics::RenderTarget::UnbindRenderTarget | ( | void | ) | const |
Changes the graphics context to render to the frame/back-buffer back again.