Skip to content

Commit

Permalink
Still Doesn't work. :(
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherrytree56567 committed Mar 21, 2024
1 parent 39db040 commit f82b0a9
Show file tree
Hide file tree
Showing 38 changed files with 147 additions and 122 deletions.
2 changes: 1 addition & 1 deletion Drizzle3D/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "App.h"

namespace Drizzle3D {
App::App(char* WindowName, int width, int height) : D3DWindow(&dispatch, WindowName, width, height), imguilayer(std::make_shared<ImGuiLayer>(&D3DWindow)), renderinglayer(std::make_shared<RenderingLayer>(&D3DWindow, &resourcemgr)) {
App::App(char* WindowName, int width, int height) : D3DWindow(&dispatch, WindowName, width, height), imguilayer(std::make_shared<ImGuiLayer>(&D3DWindow)), resourcemgr(std::make_shared<ResourceManager>()), renderinglayer(std::make_shared<RenderingLayer>(&D3DWindow, resourcemgr)) {
imguilayer->setIGUI(imguilayer);
LayerDispatcher.AddLayer(renderinglayer);
LayerDispatcher.AddLayer(imguilayer);
Expand Down
8 changes: 4 additions & 4 deletions Drizzle3D/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ namespace Drizzle3D {
Window* window() { return &D3DWindow; }
std::shared_ptr<ImGuiLayer> ImguiLayer() { return imguilayer; }
std::shared_ptr<RenderingLayer> GetRenderingLayer() { return renderinglayer; }
ResourceManager& GetResourceManager() { return resourcemgr; }
std::shared_ptr<ResourceManager> GetResourceManager() { return resourcemgr; }
EventDispatcher* dispatcher() { return &dispatch; }

typedef void(*UpdateFunc)(App* myApp);
UpdateFunc update = [](App* myApp){};

private:
// Managers
std::shared_ptr<ResourceManager> resourcemgr;

Window D3DWindow;

// Layers
Expand All @@ -59,8 +62,5 @@ namespace Drizzle3D {
// Dispatchers
EventDispatcher dispatch;
LayerDispatch LayerDispatcher;

// Managers
ResourceManager resourcemgr;
};
}
6 changes: 3 additions & 3 deletions Drizzle3D/Material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
#include "Material.h"

namespace Drizzle3D {
Material::Material(ResourceManager& resourcemgr, const char* fname, const char* fgname) {
Resource frag = resourcemgr.loadFile(fname, "r");
Material::Material(std::shared_ptr<ResourceManager> resourcemgr, const char* fname, const char* fgname) {
Resource frag = resourcemgr->loadFile(fname, "r");

const char* VSSource = frag.content.c_str();

Resource vert = resourcemgr.loadFile(fgname, "r");
Resource vert = resourcemgr->loadFile(fgname, "r");

const char* FSSource = vert.content.c_str();

Expand Down
2 changes: 1 addition & 1 deletion Drizzle3D/Material.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
namespace Drizzle3D {
class Drizzle3D_API Material {
public:
Material(ResourceManager& resourcemgr, const char* fname, const char* fgname);
Material(std::shared_ptr<ResourceManager> resourcemgr, const char* fname, const char* fgname);
GLuint GetShaderProgram() { return shaderProgram; }
private:
GLuint shaderProgram;
Expand Down
5 changes: 2 additions & 3 deletions Drizzle3D/RenderingLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace Drizzle3D {

class Drizzle3D_API RenderingLayer : public Layer {
public:
RenderingLayer(Window* window, ResourceManager* resmgr) : name("3DLayer"), show(true), pWindow(window), resourcemgr(resmgr) {}
RenderingLayer(Window* window, std::shared_ptr<ResourceManager> resmgr) : name("3DLayer"), show(true), pWindow(window), resourcemgr(resmgr) {}

void OnAttach() override;
void OnDetach() override {}
Expand All @@ -90,7 +90,6 @@ namespace Drizzle3D {
char* GetActiveCamera() { return current_camera; }
Camera ReturnActiveCamera();
Camera GetCameraFromID(char* cam);
ResourceManager& getResourceManager() { return *resourcemgr; }

bool Lighting = true;

Expand All @@ -106,6 +105,6 @@ namespace Drizzle3D {

GLuint lightsBuffer;
char* current_camera;
ResourceManager* resourcemgr;
std::shared_ptr<ResourceManager> resourcemgr;
};
}
4 changes: 2 additions & 2 deletions Drizzle3D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ Drizzle3D_API int TestProgram() {
Drizzle3D::App app;
Drizzle3D::FirstPersonCamera fpc(app);
Drizzle3D::Skybox sky(app, "skybox.png");
Drizzle3D::Material mat1(app.GetRenderingLayer()->getResourceManager(), "Scene1_vertex.glsl", "Scene1_fragment.glsl");
Drizzle3D::Material def(app.GetRenderingLayer()->getResourceManager(), "VertexShader.glsl", "FragmentShader.glsl");
Drizzle3D::Material mat1(app.GetResourceManager(), "Scene1_vertex.glsl", "Scene1_fragment.glsl");
Drizzle3D::Material def(app.GetResourceManager(), "VertexShader.glsl", "FragmentShader.glsl");

app.dispatcher()->AddEventListener(EMouseMoved, [](GLFWwindow* window, std::unique_ptr<Drizzle3D::Event> ev, std::any a) {
std::cout << "Mouse Moved\n";
Expand Down
Binary file modified Drizzle3D/x64/Debug/App.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Camera.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.ilk
Binary file not shown.
130 changes: 33 additions & 97 deletions Drizzle3D/x64/Debug/Drizzle3D.log

Large diffs are not rendered by default.

Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/CL.command.1.tlog
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/CL.read.1.tlog
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/CL.write.1.tlog
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/link.read.1.tlog
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/FirstPersonCamera.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Light.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Material.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Object.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/RenderingLayer.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Shader.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Skybox.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/main.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/vc143.idb
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/vc143.pdb
Binary file not shown.
3 changes: 1 addition & 2 deletions ExampleProject/ExampleProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ int main() {
Drizzle3D::App app;
Drizzle3D::FirstPersonCamera fpc(app);
Drizzle3D::Skybox sky(app, "skybox.png");
Drizzle3D::ResourceManager resman;
Drizzle3D::Material mat1(resman, "Scene1_vertex.glsl", "Scene1_fragment.glsl");
Drizzle3D::Material mat1(app.GetResourceManager(), "Scene1_vertex.glsl", "Scene1_fragment.glsl");

app.dispatcher()->AddEventListener(EMouseMoved, [](GLFWwindow* window, std::unique_ptr<Drizzle3D::Event> ev, std::any a) {
std::cout << "Mouse Moved\n";
Expand Down
15 changes: 7 additions & 8 deletions ExampleProject/vendor/Drizzle3D/Drizzle3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ namespace Drizzle3D {

class Drizzle3D_API RenderingLayer : public Layer {
public:
RenderingLayer(Window* window, ResourceManager* resmgr);
RenderingLayer(Window* window, std::shared_ptr<ResourceManager> resmgr);

void OnAttach() override;
void OnDetach() override;
Expand All @@ -555,7 +555,6 @@ namespace Drizzle3D {
char* GetActiveCamera();
Camera ReturnActiveCamera();
Camera GetCameraFromID(char* cam);
ResourceManager& getResourceManager();

bool Lighting = true;

Expand All @@ -571,7 +570,7 @@ namespace Drizzle3D {

GLuint lightsBuffer;
char* current_camera;
ResourceManager* resourcemgr;
std::shared_ptr<ResourceManager> resourcemgr;
};

/*
Expand Down Expand Up @@ -628,13 +627,16 @@ namespace Drizzle3D {
Window* window() { return &D3DWindow; }
std::shared_ptr<ImGuiLayer> ImguiLayer() { return imguilayer; }
std::shared_ptr<RenderingLayer> GetRenderingLayer() { return renderinglayer; }
ResourceManager& GetResourceManager() { return resourcemgr; }
std::shared_ptr<ResourceManager> GetResourceManager() { return resourcemgr; }
EventDispatcher* dispatcher() { return &dispatch; }

typedef void(*UpdateFunc)(App* myApp);
UpdateFunc update = [](App* myApp) {};

private:
// Managers
std::shared_ptr<ResourceManager> resourcemgr;

Window D3DWindow;

// Layers
Expand All @@ -644,9 +646,6 @@ namespace Drizzle3D {
// Dispatchers
EventDispatcher dispatch;
LayerDispatch LayerDispatcher;

// Managers
ResourceManager resourcemgr;
};

/*
Expand Down Expand Up @@ -689,7 +688,7 @@ namespace Drizzle3D {

class Drizzle3D_API Material {
public:
Material(ResourceManager& resourcemgr, const char* fname, const char* fgname);
Material(std::shared_ptr<ResourceManager> resourcemgr, const char* fname, const char* fgname);
GLuint GetShaderProgram();
};
}
Binary file modified ExampleProject/x64/Debug/ExampleProject.ilk
Binary file not shown.
94 changes: 93 additions & 1 deletion ExampleProject/x64/Debug/ExampleProject.log
Original file line number Diff line number Diff line change
@@ -1 +1,93 @@
 ExampleProject.vcxproj -> C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\ExampleProject.exe
 Scanning sources for module dependencies...
ExampleProject.cpp
C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(108,45): warning C4251: 'Drizzle3D::EventDispatcher::events': class 'std::vector<std::unique_ptr<Drizzle3D::Event,std::default_delete<Drizzle3D::Event>>,std::allocator<std::unique_ptr<Drizzle3D::Event,std::default_delete<Drizzle3D::Event>>>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::EventDispatcher'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(436,7):
see declaration of 'std::vector<std::unique_ptr<Drizzle3D::Event,std::default_delete<Drizzle3D::Event>>,std::allocator<std::unique_ptr<Drizzle3D::Event,std::default_delete<Drizzle3D::Event>>>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(109,88): warning C4251: 'Drizzle3D::EventDispatcher::eventCallbacks': class 'std::unordered_map<Drizzle3D::EventType,std::vector<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>,std::allocator<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>>>,std::hash<Drizzle3D::EventType>,std::equal_to<Drizzle3D::EventType>,std::allocator<std::pair<const Drizzle3D::EventType,std::vector<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>,std::allocator<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>>>>>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::EventDispatcher'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\unordered_map(66,7):
see declaration of 'std::unordered_map<Drizzle3D::EventType,std::vector<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>,std::allocator<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>>>,std::hash<Drizzle3D::EventType>,std::equal_to<Drizzle3D::EventType>,std::allocator<std::pair<const Drizzle3D::EventType,std::vector<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>,std::allocator<std::pair<Drizzle3D::EventDispatcher::EventCallback,std::any>>>>>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(411,54): warning C4251: 'Drizzle3D::ResourceManager::resources': class 'std::unordered_map<std::string,std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::pair<const std::string,std::string>>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::ResourceManager'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\unordered_map(66,7):
see declaration of 'std::unordered_map<std::string,std::string,std::hash<std::string>,std::equal_to<std::string>,std::allocator<std::pair<const std::string,std::string>>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(461,21): warning C4251: 'Drizzle3D::Layer::name': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::Layer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xstring(2337,7):
see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(480,45): warning C4251: 'Drizzle3D::LayerDispatch::layers': class 'std::vector<std::shared_ptr<Drizzle3D::Layer>,std::allocator<std::shared_ptr<Drizzle3D::Layer>>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::LayerDispatch'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(436,7):
see declaration of 'std::vector<std::shared_ptr<Drizzle3D::Layer>,std::allocator<std::shared_ptr<Drizzle3D::Layer>>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(565,21): warning C4251: 'Drizzle3D::RenderingLayer::name': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::RenderingLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xstring(2337,7):
see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(567,29): warning C4251: 'Drizzle3D::RenderingLayer::Objects': class 'std::vector<Drizzle3D::Object,std::allocator<Drizzle3D::Object>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::RenderingLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(436,7):
see declaration of 'std::vector<Drizzle3D::Object,std::allocator<Drizzle3D::Object>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(568,28): warning C4251: 'Drizzle3D::RenderingLayer::Lights': class 'std::vector<Drizzle3D::Light,std::allocator<Drizzle3D::Light>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::RenderingLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(436,7):
see declaration of 'std::vector<Drizzle3D::Light,std::allocator<Drizzle3D::Light>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(569,29): warning C4251: 'Drizzle3D::RenderingLayer::Cameras': class 'std::vector<Drizzle3D::Camera,std::allocator<Drizzle3D::Camera>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::RenderingLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(436,7):
see declaration of 'std::vector<Drizzle3D::Camera,std::allocator<Drizzle3D::Camera>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(573,42): warning C4251: 'Drizzle3D::RenderingLayer::resourcemgr': class 'std::shared_ptr<Drizzle3D::ResourceManager>' needs to have dll-interface to be used by clients of class 'Drizzle3D::RenderingLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\memory(1525,7):
see declaration of 'std::shared_ptr<Drizzle3D::ResourceManager>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(611,21): warning C4251: 'Drizzle3D::ImGuiLayer::name': class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::ImGuiLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\xstring(2337,7):
see declaration of 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(613,37): warning C4251: 'Drizzle3D::ImGuiLayer::igui': class 'std::shared_ptr<Drizzle3D::ImGuiLayer>' needs to have dll-interface to be used by clients of class 'Drizzle3D::ImGuiLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\memory(1525,7):
see declaration of 'std::shared_ptr<Drizzle3D::ImGuiLayer>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(614,34): warning C4251: 'Drizzle3D::ImGuiLayer::SliderFloats': class 'std::vector<Drizzle3D::SliderFloat,std::allocator<Drizzle3D::SliderFloat>>' needs to have dll-interface to be used by clients of class 'Drizzle3D::ImGuiLayer'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\vector(436,7):
see declaration of 'std::vector<Drizzle3D::SliderFloat,std::allocator<Drizzle3D::SliderFloat>>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(638,42): warning C4251: 'Drizzle3D::App::resourcemgr': class 'std::shared_ptr<Drizzle3D::ResourceManager>' needs to have dll-interface to be used by clients of class 'Drizzle3D::App'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\memory(1525,7):
see declaration of 'std::shared_ptr<Drizzle3D::ResourceManager>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(643,37): warning C4251: 'Drizzle3D::App::imguilayer': class 'std::shared_ptr<Drizzle3D::ImGuiLayer>' needs to have dll-interface to be used by clients of class 'Drizzle3D::App'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\memory(1525,7):
see declaration of 'std::shared_ptr<Drizzle3D::ImGuiLayer>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(644,41): warning C4251: 'Drizzle3D::App::renderinglayer': class 'std::shared_ptr<Drizzle3D::RenderingLayer>' needs to have dll-interface to be used by clients of class 'Drizzle3D::App'
(compiling source file 'ExampleProject.cpp')
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\memory(1525,7):
see declaration of 'std::shared_ptr<Drizzle3D::RenderingLayer>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(659,19): warning C4251: 'Drizzle3D::FirstPersonCamera::position': struct 'glm::vec<3,float,glm::packed_highp>' needs to have dll-interface to be used by clients of class 'Drizzle3D::FirstPersonCamera'
(compiling source file 'ExampleProject.cpp')
C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\glm\detail\qualifier.hpp(35,66):
see declaration of 'glm::vec<3,float,glm::packed_highp>'

C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\Drizzle3D.h(682,19): warning C4251: 'Drizzle3D::Skybox::pos': struct 'glm::vec<3,float,glm::packed_highp>' needs to have dll-interface to be used by clients of class 'Drizzle3D::Skybox'
(compiling source file 'ExampleProject.cpp')
C:\Users\ronit\Desktop\Drizzle3D\ExampleProject\vendor\Drizzle3D\glm\detail\qualifier.hpp(35,66):
see declaration of 'glm::vec<3,float,glm::packed_highp>'

ExampleProject.vcxproj -> C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\ExampleProject.exe
Loading

0 comments on commit f82b0a9

Please sign in to comment.