-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
127 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.15) | ||
project(HinaGUI) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
include(cmake/mymacros.cmake) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,43 @@ | ||
#include "model_loader.h" | ||
|
||
#ifndef HINA_USE_ASSIMP | ||
|
||
#include "assimp/Importer.hpp" | ||
#include "assimp/scene.h" | ||
#include "assimp/postprocess.h" | ||
|
||
#include <iostream> | ||
|
||
Mesh processMesh(aiMesh *mesh, const aiScene *scene) | ||
{ | ||
for (unsigned int i = 0; i < mesh->mNumVertices; ++i) | ||
{ | ||
|
||
} | ||
return Mesh(); | ||
} | ||
|
||
void process_node(aiNode *node, const aiScene *scene) | ||
{ | ||
std::vector<Mesh> meshes; | ||
for (unsigned int i = 0; i < node->mNumMeshes; i++) | ||
meshes.push_back(processMesh(scene->mMeshes[node->mMeshes[i]], scene)); | ||
|
||
for (unsigned int i = 0; i < node->mNumChildren; i++) | ||
process_node(node->mChildren[i], scene); | ||
} | ||
|
||
void ModelLoader::load_model(const std::string &model_path) | ||
{ | ||
Assimp::Importer importer; | ||
const aiScene *scene = importer.ReadFile(model_path, aiProcess_Triangulate | aiProcess_GenSmoothNormals | aiProcess_FlipUVs | aiProcess_CalcTangentSpace); | ||
if (!scene || scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) // if is Not Zero | ||
{ | ||
std::cout << "ERROR::ASSIMP:: " << importer.GetErrorString() << std::endl; | ||
return; | ||
} | ||
|
||
std::string directory = model_path.substr(0, model_path.find_last_of('/')); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
#ifndef HINAGUI_MODEL_LOADER_H | ||
#define HINAGUI_MODEL_LOADER_H | ||
|
||
#include "../core/renderable.h" | ||
|
||
#include <string> | ||
|
||
class ModelLoader | ||
{ | ||
|
||
public: | ||
static void load_model(const std::string& model_path); | ||
}; | ||
|
||
|
||
#endif //HINAGUI_MODEL_LOADER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,46 @@ | ||
#include "HinaGUI/HinaViewer.h" | ||
|
||
int main() | ||
#include <fstream> | ||
|
||
struct A | ||
{ | ||
int a; // 4 | ||
float b; // 4 | ||
char c; // 1 | ||
}; | ||
|
||
|
||
class Foo | ||
{ | ||
|
||
}; | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
|
||
HinaGUI::HinaViewer viewer; | ||
// viewer.init("C:/Users/Administrator/Desktop/BFU_Graphics/HinaGUI/HinaGUI/builtin-desc/classic_viewer.json"); | ||
viewer.init("/Users/xayah/Desktop/BFU-Graphics/HinaGUI/HinaGUI/builtin-desc/classic_viewer.json"); | ||
viewer.launch(); | ||
viewer.kill(); | ||
|
||
std::unique_ptr<Foo> a = std::make_unique<Foo>(); | ||
|
||
std::vector<int> b; 8 | ||
|
||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
b.push_back(1); | ||
|
||
std::sqrt() | ||
|
||
Foo * ptr = a.get(); | ||
|
||
return 0; | ||
} |