Totally refactored UILabel

This commit is contained in:
2023-03-05 23:42:15 -08:00
parent aeb5014a07
commit ee2dc931f2
15 changed files with 463 additions and 194 deletions

View File

@ -1,43 +1,14 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "SimpleTexturedShaderProgram.hpp"
#define UI_SHADER_PROGRAM_PRIORITY 100
namespace Dawn {
class UIShaderProgram : public SimpleTexturedShaderProgram {
public:
struct ShaderPassItem getUIPassItem(
glm::mat4 projection,
glm::mat4 view,
glm::mat4 transform,
Texture *texture,
struct Color color,
Mesh *mesh,
float_t z
) {
struct ShaderPassItem item;
item.shaderProgram = this;
item.colorValues[this->paramColor] = color;
if(texture == nullptr) {
item.boolValues[this->paramHasTexture] = false;
} else {
item.textureSlots[0] = texture;
item.textureValues[this->paramTexture] = 0;
item.boolValues[this->paramHasTexture] = true;
}
item.matrixValues[this->paramProjection] = projection;
item.matrixValues[this->paramView] = view;
item.matrixValues[this->paramModel] = transform;
item.priority = UI_SHADER_PROGRAM_PRIORITY;
item.w = z;
item.renderFlags = RENDER_MANAGER_RENDER_FLAG_BLEND;
item.mesh = mesh;
return item;
}
};
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "SimpleTexturedShaderProgram.hpp"
#define UI_SHADER_PROGRAM_PRIORITY 100
namespace Dawn {
class UIShaderProgram : public SimpleTexturedShaderProgram {
};
}