-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathShop.cpp
More file actions
27 lines (21 loc) · 672 Bytes
/
Shop.cpp
File metadata and controls
27 lines (21 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "Shop.h"
using namespace std;
Shop::Shop(GLuint* f, glm::vec3 p, GLint s, vector<GLuint> t)
: UIElement(f, p, s) {
for (int i = 0; i < t.size(); ++i) {
glm::vec3 pos = position + glm::vec3(1.0f, (i+1) * -3.f, 0.0f);
costs.push_back(new AmountView(f, pos, s, 10, glm::vec4(0.9f, 0.9f, 0.0f, 0.0f)));
costs[i]->add(50);
items.push_back(new Renderable(pos + glm::vec3(-0.5f, 1.f, 0.0f), t[i], s));
items[i]->setScale(glm::vec3(6.f, 6.f, 0.0f));
}
}
void Shop::render(Shader &shader) {
for (AmountView* a : costs) {
a->render(shader);
}
shader.setUniform4f("colorMod", glm::vec4(0.0f));
for (Renderable* i : items) {
i->render(shader);
}
}