summaryrefslogtreecommitdiff
path: root/game/physical.cpp
blob: 17d85ddcfdb57f5786f429416dad423ee7999353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "physical.h"
#include "gfx/models/mesh.h"
#include "gfx/models/texture.h"
#include <cache.h>
#include <gfx/gl/shader.h>
#include <gfx/gl/transform.h>

Cache<Mesh> Physical::cachedMesh;
Cache<Texture> Physical::cachedTexture;

Physical::Physical(glm::vec3 where, const std::string & m, const std::string & t) :
	location {where}, mesh {cachedMesh.get(m)}, texture {cachedTexture.get(t)}
{
}

void
Physical::render(const Shader & shader) const
{
	shader.setModel(location.GetModel());
	texture->Bind();
	mesh->Draw();
}