Dawn/src/dawnopengl/display/TextureRenderTarget.hpp

38 lines
910 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;
Texture texture;
struct Color clearColor = COLOR_CORNFLOWER_BLUE;
public:
TextureRenderTarget(float_t width, float_t height);
Texture * getTexture();
void setSize(float_t width, float_t height);
float_t getScale() override;
float_t getWidth() override;
float_t getHeight() override;
void setClearColor(struct Color color) override;
void clear(flag8_t clearFlags) override;
void bind() override;
~TextureRenderTarget();
};
}