decided on a structure

This commit is contained in:
Ben
2019-02-22 17:08:01 +00:00
parent 684c14eda0
commit 3af5d5dc02
12 changed files with 1243 additions and 1 deletions

1167
include/OBJLoader.h Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -25,10 +25,14 @@ int main (int argc, char** argv) {
Display display {"SMH Engine", logger, 1280, 720, MXAA_4X, VSYNC_ENABLED}; Display display {"SMH Engine", logger, 1280, 720, MXAA_4X, VSYNC_ENABLED};
SDL_Event e; SDL_Event e;
while (!display.isClosed) while (!display.isClosed) {
while (SDL_PollEvent(&e)) while (SDL_PollEvent(&e))
if (e.type == SDL_QUIT || e.key.keysym.sym == SDLK_ESCAPE) if (e.type == SDL_QUIT || e.key.keysym.sym == SDLK_ESCAPE)
display.isClosed = true; display.isClosed = true;
SDL_GL_SwapWindow(display.window);
}
return 0; return 0;
} }

3
src/material.cpp Normal file
View File

@@ -0,0 +1,3 @@
#include "material.h"

9
src/material.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef SMHENGINE_SRC_MATERIAL_H_
#define SMHENGINE_SRC_MATERIAL_H_
class Material {
};
#endif

7
src/mesh.cpp Normal file
View File

@@ -0,0 +1,7 @@
#include "mesh.h"
Mesh::Mesh() {
}

40
src/mesh.h Normal file
View File

@@ -0,0 +1,40 @@
#ifndef SMHENGINE_SRC_MESH_H_
#define SMHENGINE_SRC_MESH_H_
#include <string>
#include <vector>
#include <glad/glad.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
class Shader;
class Mesh {
public:
Mesh();
Mesh(std::string objPath);
void LoadFromObj(std::string objPath);
void settup();
void bind();
void render(Shader& shader);
void unbind();
GLuint VAOid;
std::vector<glm::vec3> vertices;
std::vector<glm::vec4> colours;
std::vector<glm::vec2> texCoords;
std::vector<glm::vec3> normals;
std::vector<GLuint> indices;
private:
GLuint vertexBuffer;
GLuint indexBuffer;
};
#endif

0
src/renderer.cpp Normal file
View File

0
src/renderer.h Normal file
View File

3
src/shader.cpp Normal file
View File

@@ -0,0 +1,3 @@
#include "shader.h"

9
src/shader.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef SMHENGINE_SRC_SHADER_H_
#define SMHENGINE_SRC_SHADER_H_
class Shader {
};
#endif

0
src/shaderManager.cpp Normal file
View File

0
src/shaderManager.h Normal file
View File