Skip to content
Snippets Groups Projects
Commit 70c09b18 authored by Joseph Walton-Rivers's avatar Joseph Walton-Rivers
Browse files

assimp import

parent dd745317
No related branches found
No related tags found
No related merge requests found
Pipeline #3409 failed
...@@ -2,6 +2,7 @@ build/ ...@@ -2,6 +2,7 @@ build/
builds/ builds/
cmake-build-debug/ cmake-build-debug/
cmake-build-debug-coverage/ cmake-build-debug-coverage/
cmake-build-debug-coverage-event-trace/
imgui.ini imgui.ini
.flatpak-builder/ .flatpak-builder/
compile_commands.json compile_commands.json
...@@ -13,4 +14,4 @@ compile_commands.json ...@@ -13,4 +14,4 @@ compile_commands.json
# windows vs stuff # windows vs stuff
.vs/ .vs/
CMakePresets.json CMakePresets.json
CMakeSettings.json CMakeSettings.json
\ No newline at end of file
...@@ -23,6 +23,7 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) ...@@ -23,6 +23,7 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
conan_cmake_configure( conan_cmake_configure(
REQUIRES REQUIRES
assimp/5.2.2
opengl/system opengl/system
glfw/3.3.7 glfw/3.3.7
glad/0.1.35 glad/0.1.35
......
...@@ -64,9 +64,9 @@ target_sources(${PROJECT_NAME} ...@@ -64,9 +64,9 @@ target_sources(${PROJECT_NAME}
find_package(yaml-cpp) find_package(yaml-cpp)
target_link_libraries(fggl PUBLIC yaml-cpp) target_link_libraries(fggl PUBLIC yaml-cpp)
# spdlog for cleaner logging # model loading
find_package(spdlog) find_package(assimp)
target_link_libraries(${PROJECT_NAME} PRIVATE spdlog::spdlog) target_link_libraries(${PROJECT_NAME} PUBLIC assimp)
find_package(freetype) find_package(freetype)
target_link_libraries(${PROJECT_NAME} PUBLIC freetype) target_link_libraries(${PROJECT_NAME} PUBLIC freetype)
......
...@@ -12,3 +12,7 @@ target_sources(fggl ...@@ -12,3 +12,7 @@ target_sources(fggl
imgui/imgui_impl_glfw.cpp imgui/imgui_impl_glfw.cpp
imgui/imgui_impl_opengl3.cpp imgui/imgui_impl_opengl3.cpp
) )
# spdlog for cleaner logging
find_package(spdlog)
target_link_libraries(fggl PRIVATE spdlog::spdlog)
/*
* ${license.title}
* Copyright (C) 2022 ${license.owner}
* ${license.mailto}
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//
// Created by webpigeon on 11/06/22.
//
#ifndef FGGL_DATA_GEOM_HPP
#define FGGL_DATA_GEOM_HPP
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include <filesystem>
#include "storage.hpp"
#include "model.hpp"
namespace fggl::data {
template<>
bool fggl_deserialize(std::filesystem::path &data, StaticMesh *out) {
Assimp::Importer importer;
const aiScene* scene = importer.ReadFile( data.c_str(), aiProcess_Triangulate | aiProcess_FlipUVs );
if (!scene || scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) {
return false;
}
//TODO implement the rest of this
return false;
}
} // namespace fggl::data
#endif //FGGL_DATA_GEOM_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment