Added UI Scaling support

This commit is contained in:
2023-07-24 11:01:29 -07:00
parent 34ff460343
commit 404d1c6227
10 changed files with 83 additions and 21 deletions

View File

@ -12,6 +12,10 @@ BackBufferRenderTarget::BackBufferRenderTarget(RenderManager &renderManager) :
{
}
float_t BackBufferRenderTarget::getScale() {
return this->scale;
}
float_t BackBufferRenderTarget::getWidth() {
return this->width;
}

View File

@ -19,6 +19,8 @@ namespace Dawn {
struct Color clearColor = COLOR_CORNFLOWER_BLUE;
public:
float_t scale = 1.0f;
/**
* Construct the back buffer render target.
*
@ -38,6 +40,7 @@ namespace Dawn {
*/
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;

View File

@ -64,6 +64,10 @@ void TextureRenderTarget::setSize(float_t width, float_t height) {
}
}
float_t TextureRenderTarget::getScale() {
return 1.0f;
}
float_t TextureRenderTarget::getWidth() {
return (float_t)this->texture.getWidth();
}

View File

@ -26,6 +26,7 @@ namespace Dawn {
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;