42 lines
869 B
C++
42 lines
869 B
C++
#include <glm/glm.hpp>
|
|
|
|
#include "u.hpp"
|
|
#include "game.hpp"
|
|
#include "dbg.hpp"
|
|
#include "entity.hpp"
|
|
#include "components.hpp"
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
(void)argc;
|
|
(void)argv;
|
|
|
|
Game game;
|
|
|
|
{
|
|
auto e = game.add_entity();
|
|
|
|
e->mesh.mesh = new Mesh(load_obj("resources/monkey.obj"),
|
|
new Shader("vertex.glsl", "fragment.glsl"));
|
|
e->mesh.enabled = true;
|
|
|
|
e->position.pos = glm::vec3(0,0,0);
|
|
e->position.enabled = true;
|
|
}
|
|
|
|
float dt = 0.0f;
|
|
uint64_t last_frame = 0;
|
|
|
|
dbg::info("initialization finished");
|
|
while (game.running) {
|
|
game.update(dt);
|
|
game.render();
|
|
|
|
uint64_t current_frame = SDL_GetTicks64();
|
|
dt = (float)(current_frame - last_frame) / 1000.0f;
|
|
last_frame = current_frame;
|
|
}
|
|
dbg::info("exiting");
|
|
}
|