Dawn/src/dawnopengl/display/TextureRenderTarget.hpp
2023-11-13 00:48:48 -06:00

38 lines
978 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "dawnopengl.hpp"
#include "display/RenderTarget.hpp"
#include "display/Texture.hpp"
namespace Dawn {
class RenderManager;
class TextureRenderTarget : public RenderTarget {
private:
GLuint fboId = -1;
GLuint rboId = -1;
std::shared_ptr<Texture> texture;
struct Color clearColor = COLOR_CORNFLOWER_BLUE;
public:
TextureRenderTarget(const float_t width, const float_t height);
std::shared_ptr<Texture> getTexture();
void setSize(const float_t width, const float_t height);
float_t getScale() override;
float_t getWidth() override;
float_t getHeight() override;
void setClearColor(const struct Color color) override;
void clear(const flag8_t clearFlags) override;
void bind() override;
~TextureRenderTarget();
};
}