The fruits of my labor

This commit is contained in:
2023-01-20 00:00:36 -08:00
parent 2dacb6f904
commit c20d85913c
55 changed files with 563 additions and 459 deletions

View File

@ -4,6 +4,7 @@
// https://opensource.org/licenses/MIT
#include "UISprite.hpp"
#include "game/DawnGame.hpp"
using namespace Dawn;
@ -22,12 +23,21 @@ void UISprite::updatePositions() {
);
}
void UISprite::drawSelf(UIShader *uiShader, glm::mat4 selfTransform) {
uiShader->setUITexture(nullptr);
uiShader->setUIModel(selfTransform);
uiShader->setUIModel(glm::mat4(1.0f));
uiShader->setUIColor(this->color);
uiShader->setUITexture(this->texture);
std::vector<struct ShaderPassItem> UISprite::getSelfPassItems(
glm::mat4 projection,
glm::mat4 view,
glm::mat4 transform
) {
std::vector<struct ShaderPassItem> items;
this->mesh.draw(MESH_DRAW_MODE_TRIANGLES, 0, -1);
items.push_back(this->getGame()->renderManager.uiShaderProgram.getUIPassItem(
projection,
view,
transform,
this->texture,
this->color,
&this->mesh,
this->z
));
return items;
}