diff options
| author | Yong He <yonghe@outlook.com> | 2021-01-06 12:58:57 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-06 12:58:57 -0800 |
| commit | 92636513abe72d2da0c45f0e2c1235415e0671c3 (patch) | |
| tree | 234136e9d89006df9d6775e8bcd07e91ae344af7 /tools/gfx/model.h | |
| parent | 706d4f91e269d473c963d31792fb2c8320933c9b (diff) | |
Refactor GUI/Window utils out of gfx library (#1649)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/model.h')
| -rw-r--r-- | tools/gfx/model.h | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/tools/gfx/model.h b/tools/gfx/model.h deleted file mode 100644 index 17b16510e..000000000 --- a/tools/gfx/model.h +++ /dev/null @@ -1,77 +0,0 @@ -// model.h -#pragma once - -#include "render.h" -#include "vector-math.h" - -#include <vector> -#include <string> - -namespace gfx { - -struct ModelLoader -{ - struct MaterialData - { - glm::vec3 diffuseColor; - glm::vec3 specularColor; - float specularity; - - RefPtr<TextureResource> diffuseMap; - }; - - struct Vertex - { - glm::vec3 position; - glm::vec3 normal; - glm::vec2 uv; - }; - - typedef uint32_t Index; - - struct MeshData - { - int firstIndex; - int indexCount; - - void* material; - }; - - struct ModelData - { - RefPtr<BufferResource> vertexBuffer; - RefPtr<BufferResource> indexBuffer; - PrimitiveTopology primitiveTopology; - int vertexCount; - int indexCount; - int meshCount; - void* const* meshes; - }; - - struct ICallbacks - { - typedef ModelLoader::MaterialData MaterialData; - typedef ModelLoader::MeshData MeshData; - typedef ModelLoader::ModelData ModelData; - - virtual void* createMaterial(MaterialData const& data) = 0; - virtual void* createMesh(MeshData const& data) = 0; - virtual void* createModel(ModelData const& data) = 0; - }; - - typedef uint32_t LoadFlags; - enum LoadFlag : LoadFlags - { - FlipWinding = 1 << 0, - }; - - ICallbacks* callbacks = nullptr; - RefPtr<Renderer> renderer; - LoadFlags loadFlags = 0; - float scale = 1.0f; - - Result load(char const* inputPath, void** outModel); -}; - - -} // gfx |
