Ghettomerge

This commit is contained in:
Tobias Dahl
2014-03-11 22:32:49 +01:00
parent 33dbcc10a1
commit bb6cc1a23e
41 changed files with 892 additions and 648 deletions
+23 -14
View File
@@ -8,37 +8,48 @@
#include <vector>
#include <memory>
#define _CRT_SECURE_NO_WARNINGS
#include <GL/glew.h>
#define GLFW_INCLUDE_GLU
#include <GLFW/glfw3.h>
#include <glext.h>
#define GLM_FORCE_RADIANS
#include "OpenGL.h"
#include <glm/glm.hpp>
#include <glm/gtc/constants.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "glerror.h"
#include <cstdlib>
#include <stack>
#include "glerror.h"
#include "Texture.h"
#include "OBJ.h"
class Model
{
public:
Model(OBJ &obj);
Model(const char* path);
struct TextureGroup
{
std::shared_ptr<Texture> Texture;
unsigned int StartIndex;
unsigned int EndIndex;
};
GLuint VAO;
std::vector<TextureGroup> TextureGroups;
std::vector<std::shared_ptr<Texture>> texture;
glm::mat4 GetMatrix();
std::vector<glm::vec3> Vertices;
private:
std::vector<glm::vec3> Normals;
std::vector<glm::vec2> TextureCoords;
GLuint VertexBuffer;
GLuint NormalBuffer;
GLuint TextureCoordBuffer;
GLuint VAO;
std::vector<std::shared_ptr<Texture>> texture;
Model(const char* path);
bool Loadobj(
const char* path,
@@ -47,8 +58,6 @@ public:
std::vector <glm::vec2> & out_TextureCoords
);
glm::mat4 GetMatrix();
void CreateBuffers(
std::vector<glm::vec3> _Vertices,
std::vector<glm::vec3> _Normals,