diff --git a/CMakeLists.txt b/CMakeLists.txt index a1ebd99..f3536df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,15 +23,15 @@ find_package(SDL2 REQUIRED) find_package(SDL2_image REQUIRED) find_package(OpenGL REQUIRED) find_package(GLEW REQUIRED) - find_package(GLM REQUIRED) -message(STATUS "GLM included: ${GLM_INCLUDE_DIR}") +find_package(assimp REQUIRED) include_directories( ${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_DIRS} ${OPENGL_INCLUDE_DIRS} - ${GLEW_INCLUDE_DIRS}) + ${GLEW_INCLUDE_DIRS} + ${ASSIMP_INCLUDE_DIRS}) add_executable(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES}) @@ -39,4 +39,5 @@ target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${OPENGL_LIBRARIES} - ${GLEW_LIBRARIES}) + ${GLEW_LIBRARIES} + ${ASSIMP_LIBRARIES}) diff --git a/cmake/FindGLM.cmake b/cmake/FindGLM.cmake index 2d90092..a039182 100644 --- a/cmake/FindGLM.cmake +++ b/cmake/FindGLM.cmake @@ -59,5 +59,5 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLM DEFAULT_MSG IF(GLM_FOUND) SET(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}") - MESSAGE(STATUS "GLM_INCLUDE_DIR = ${GLM_INCLUDE_DIR}") + #MESSAGE(STATUS "GLM_INCLUDE_DIR = ${GLM_INCLUDE_DIR}") ENDIF(GLM_FOUND) diff --git a/src/Model.cpp b/src/Model.cpp index 106cec6..31488fd 100644 --- a/src/Model.cpp +++ b/src/Model.cpp @@ -1,5 +1,6 @@ #include "Model.h" +Model::Model(char *path) {} Model::Model(Mesh mesh) { this->meshes.push_back(mesh); } Model::Model(std::vector meshes) { this->meshes = meshes; } @@ -19,3 +20,5 @@ void Model::translate(glm::vec3 translation) { // set model transform this->model = glm::translate(glm::mat4(1.0f), glm::vec3(this->position)); } + +void Model::loadModel(char *path) {} diff --git a/src/Model.h b/src/Model.h index 309ab28..7b0b9e8 100644 --- a/src/Model.h +++ b/src/Model.h @@ -2,6 +2,9 @@ #include "Error.h" #include "Mesh.h" #include "ShaderLoader.h" +#include +#include +#include #include #include #include @@ -19,7 +22,11 @@ private: // Position glm::vec4 position = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); + void loadModel(char *path); + public: + // Create a model from file + Model(char *path); // Used to create a mesh out of a single mesh. Model(Mesh mesh); // Used to create a mesh out of multiple meshes. diff --git a/src/main.cpp b/src/main.cpp index 361a1c8..652925d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -236,10 +236,6 @@ int main(int argc, char **argv) { // glBindVertexArray(VAO); // TODO: Run game here lol - // Draw triangle - // glDrawArrays(GL_TRIANGLES, 0, 3); - // glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0); - // glBindVertexArray(0); SDL_GL_SwapWindow(window); };