The fruits of my labor
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#include "UIBorder.hpp"
|
||||
#include "game/DawnGame.hpp"
|
||||
|
||||
using namespace Dawn;
|
||||
|
||||
@@ -20,6 +21,7 @@ void UIBorder::updatePositions() {
|
||||
glm::vec2 overallDimensions = glm::vec2(this->getWidth(), this->getHeight());
|
||||
glm::vec2 innerDimensions = overallDimensions - (this->edgeDimensions * 2.0f);
|
||||
|
||||
|
||||
// Top Left.
|
||||
QuadMesh::bufferQuadMesh(&this->mesh,
|
||||
glm::vec2(0, 0),
|
||||
@@ -102,13 +104,25 @@ void UIBorder::updatePositions() {
|
||||
);
|
||||
}
|
||||
|
||||
void UIBorder::drawSelf(UIShader *shader, glm::mat4 transform) {
|
||||
if(this->texture == nullptr) return;
|
||||
std::vector<struct ShaderPassItem> UIBorder::getSelfPassItems(
|
||||
glm::mat4 projection,
|
||||
glm::mat4 view,
|
||||
glm::mat4 transform
|
||||
) {
|
||||
std::vector<struct ShaderPassItem> items;
|
||||
if(this->texture == nullptr) return items;
|
||||
|
||||
shader->setUIColor(COLOR_WHITE);
|
||||
shader->setUIModel(transform);
|
||||
shader->setUITexture(this->texture);
|
||||
this->mesh.draw(MESH_DRAW_MODE_TRIANGLES, 0, -1);
|
||||
items.push_back(this->getGame()->renderManager.uiShaderProgram.getUIPassItem(
|
||||
projection,
|
||||
view,
|
||||
transform,
|
||||
this->texture,
|
||||
COLOR_WHITE,
|
||||
&this->mesh,
|
||||
this->z
|
||||
));
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
void UIBorder::setBorderSize(glm::vec2 borderSize) {
|
||||
|
Reference in New Issue
Block a user