Skip to content

Commit

Permalink
Assimp DLL
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-loi committed Apr 19, 2022
1 parent 57ffc5e commit f0cde70
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 5 deletions.
Binary file not shown.
8 changes: 8 additions & 0 deletions OpenGL/OpenGL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,14 @@
<ShowProgress>LinkVerboseLib</ShowProgress>
<AdditionalDependencies>glfw3.lib;opengl32.lib;User32.lib;Gdi32.lib;Shell32.lib;glew32s.lib;assimp-vc142-mt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>xcopy /y /d "$(SolutionDir)Dependencies\ASSIMP\lib-vc2022\assimp-vc142-mt.dll" "$(OutDir)"</Command>
<Message>Copies dlls</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\Controllers\ModelLoader.cpp" />
<ClCompile Include="src\EngineObj\Scene.cpp" />
<ClCompile Include="src\Controllers\RandomGenerator.cpp" />
<ClCompile Include="src\Camera.cpp" />
<ClCompile Include="src\GLData\Instance.cpp" />
Expand All @@ -190,6 +196,8 @@
<ClCompile Include="src\GLData\Texture.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Controllers\ModelLoader.h" />
<ClInclude Include="src\EngineObj\Scene.h" />
<ClInclude Include="src\Controllers\RandomGenerator.h" />
<ClInclude Include="src\Camera.h" />
<ClInclude Include="src\GLData\Instance.h" />
Expand Down
12 changes: 12 additions & 0 deletions OpenGL/OpenGL.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
<ClCompile Include="src\Controllers\RandomGenerator.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\EngineObj\Scene.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Controllers\ModelLoader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Shader.h">
Expand Down Expand Up @@ -80,6 +86,12 @@
<ClInclude Include="src\Controllers\RandomGenerator.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\EngineObj\Scene.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\Controllers\ModelLoader.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="Doxyfile" />
Expand Down
2 changes: 0 additions & 2 deletions OpenGL/src/GLData/Buffers/VAO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ VAO::~VAO()

}



void VAO::Bind()
{

Expand Down
4 changes: 3 additions & 1 deletion OpenGL/src/GLData/Model.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Model.h"
Model::Model(std::unique_ptr<float[]> vertices, unsigned int size_vertices, std::unique_ptr<unsigned int[]> indices,
unsigned int size_indices)
: m_Vbo(std::move(vertices), size_vertices), m_Ebo(std::move(indices), size_indices), m_Vao(0)
: m_Vbo(std::move(vertices), size_vertices), m_Ebo(std::move(indices), size_indices), m_Vao(++Model::free_idx)
{

}
Expand Down Expand Up @@ -55,3 +55,5 @@ VBO& Model::getVBO()
{
return m_Vbo;
}

long long int Model::free_idx = 0;
7 changes: 6 additions & 1 deletion OpenGL/src/GLData/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include "Buffers/VAO.h"
#include "Buffers/VBO.h"

#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>

class Model
{
Expand All @@ -11,9 +14,11 @@ class Model
EBO m_Ebo;
VAO m_Vao;

static long long int free_idx;

public:
Model(std::unique_ptr<float[]> vertices, unsigned int size_vertices,
std::unique_ptr<unsigned int[]> indices, unsigned int size_indices);
std::unique_ptr<unsigned int[]> indices, unsigned int size_indices);
~Model();

void Bind();
Expand Down
2 changes: 1 addition & 1 deletion OpenGL/src/GLData/Texture.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Texture.h"

#include <iostream>
#include <cassert>
#include <assert.h>

#include "..\..\res\vendor\stb_image.h"

Expand Down

0 comments on commit f0cde70

Please sign in to comment.