Mid prog font

This commit is contained in:
2023-05-26 10:44:17 -07:00
parent a2669f6eb9
commit 117262267c
10 changed files with 146 additions and 2 deletions

View File

@ -22,6 +22,10 @@ float_t BackBufferRenderTarget::getHeight() {
void BackBufferRenderTarget::setSize(float_t width, float_t height) {
if(this->width == width && this->height == height) return;
// Fixes a new bug that it seems GLFW has introduced.
if(width == 0) width = 1;
if(height == 0) height = 1;
this->width = width;
this->height = height;

View File

@ -28,6 +28,7 @@ void RenderManager::init() {
this->fontShader = this->shaderManager.getShader<FontShader>(this->lockFontShader);
this->renderPipeline.init();
this->fontManager.init();
// Prepare the initial values
glEnable(GL_TEXTURE_2D);

View File

@ -62,6 +62,14 @@ void Texture::fill(struct Color color) {
memoryFree(pixels);
}
void Texture::fill(uint8_t color) {
uint8_t *pixels = (uint8_t *)memoryAllocate(
sizeof(uint8_t) * this->width * this->height
);
this->buffer(pixels);
memoryFree(pixels);
}
bool_t Texture::isReady() {
return this->id != -1;
}

View File

@ -30,6 +30,7 @@ namespace Dawn {
int32_t getHeight() override;
void setSize(int32_t width, int32_t height, enum TextureFormat format) override;
void fill(struct Color) override;
void fill(uint8_t) override;
bool_t isReady() override;
void buffer(struct Color pixels[]) override;
void buffer(uint8_t pixels[]) override;