decided on a structure
This commit is contained in:
1167
include/OBJLoader.h
Normal file
1167
include/OBJLoader.h
Normal file
File diff suppressed because it is too large
Load Diff
@@ -25,10 +25,14 @@ int main (int argc, char** argv) {
|
||||
Display display {"SMH Engine", logger, 1280, 720, MXAA_4X, VSYNC_ENABLED};
|
||||
|
||||
SDL_Event e;
|
||||
while (!display.isClosed)
|
||||
while (!display.isClosed) {
|
||||
while (SDL_PollEvent(&e))
|
||||
if (e.type == SDL_QUIT || e.key.keysym.sym == SDLK_ESCAPE)
|
||||
display.isClosed = true;
|
||||
|
||||
|
||||
SDL_GL_SwapWindow(display.window);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
3
src/material.cpp
Normal file
3
src/material.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "material.h"
|
||||
|
||||
|
||||
9
src/material.h
Normal file
9
src/material.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef SMHENGINE_SRC_MATERIAL_H_
|
||||
#define SMHENGINE_SRC_MATERIAL_H_
|
||||
|
||||
|
||||
class Material {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
7
src/mesh.cpp
Normal file
7
src/mesh.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "mesh.h"
|
||||
|
||||
Mesh::Mesh() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
40
src/mesh.h
Normal file
40
src/mesh.h
Normal 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
0
src/renderer.cpp
Normal file
0
src/renderer.h
Normal file
0
src/renderer.h
Normal file
3
src/shader.cpp
Normal file
3
src/shader.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "shader.h"
|
||||
|
||||
|
||||
9
src/shader.h
Normal file
9
src/shader.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef SMHENGINE_SRC_SHADER_H_
|
||||
#define SMHENGINE_SRC_SHADER_H_
|
||||
|
||||
|
||||
class Shader {
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
0
src/shaderManager.cpp
Normal file
0
src/shaderManager.cpp
Normal file
0
src/shaderManager.h
Normal file
0
src/shaderManager.h
Normal file
Reference in New Issue
Block a user