#include <iostream>

#include "kekengine.h"
#include <GL/glew.h>
#include <GLFW/glfw3.h>

using namespace kek;

int main(int argc, char **argv) {
	Engine::init();

	MemoryBuffer *buf = Resource::loadResource("object/sphere/Sphere.obj");
	Mesh *mesh = ObjParser::parseMesh(buf, "object/sphere/");
	delete buf;

	GameObject *test = new GameObject();
	test->addMesh(mesh);

	Scene *scene = new Scene();
	scene->addObject(test);

	for(int i = 0; i < 10; i++) {
		GameObject *test2 = new GameObject();
		test2->addMesh(ObjParser::loadMesh("object/cube_colored/Cube.obj"));
		test2->moveTo(glm::vec3(0.0f, 5.0f, 3 * i));
		scene->addObject(test2);
	}

	PointLight *light = new PointLight(glm::vec3(1), 1, 0, 1);
	scene->lights->add(light);

	DirectionalLight *l = new DirectionalLight(glm::vec3(1), glm::vec3(1, -1, 1));
	scene->lights->add(l);

	//SpotLight *spot = new SpotLight(glm::vec3(1), glm::vec3(0, 0, -1), 1, 0, 1, glm::radians(8.0f), glm::radians(15.0f));
	//spot->moveTo(glm::vec3(0, 0, 5));
	//scene->lights->add(spot);

	Engine::setActiveScene(scene);

	Engine::start();
}
