Skip to content

Commit

Permalink
Simple Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherrytree56567 committed Mar 26, 2024
1 parent 2bce71e commit b0a9853
Show file tree
Hide file tree
Showing 40 changed files with 70 additions and 9 deletions.
1 change: 1 addition & 0 deletions Drizzle3D/Drizzle3D.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<ClCompile Include="vendor\imgui\imgui_draw.cpp" />
<ClCompile Include="vendor\imgui\imgui_tables.cpp" />
<ClCompile Include="vendor\imgui\imgui_widgets.cpp" />
<ClCompile Include="Vulkan.cpp" />
<ClCompile Include="Window.cpp" />
</ItemGroup>
<ItemGroup>
Expand Down
7 changes: 5 additions & 2 deletions Drizzle3D/Drizzle3D.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<Filter Include="Source Files\Flags">
<UniqueIdentifier>{d2494ee0-6d9c-46f2-8671-60f383df2474}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\Rendering\OpenGL">
<Filter Include="Source Files\Rendering\Renderers">
<UniqueIdentifier>{55af9157-afcc-4973-b2b9-89fdb471e1d1}</UniqueIdentifier>
</Filter>
</ItemGroup>
Expand Down Expand Up @@ -166,7 +166,10 @@
<Filter>Source Files\Flags</Filter>
</ClCompile>
<ClCompile Include="OpenGL.cpp">
<Filter>Source Files\Rendering\OpenGL</Filter>
<Filter>Source Files\Rendering\Renderers</Filter>
</ClCompile>
<ClCompile Include="Vulkan.cpp">
<Filter>Source Files\Rendering\Renderers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down
31 changes: 31 additions & 0 deletions Drizzle3D/RenderingLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Drizzle3D {
flags.AddFlag("Fullscreen", fullscreen);
flags.AddFlag("Show", show);
flags.AddFlag("UseOpenGL", UseOpenGL);
flags.AddFlag("UseVulkan", UseVulkan);
}

Drizzle3D_API std::pair<std::vector<float>, std::vector<unsigned int>> LoadObjFile(const std::string& filePath) {
Expand Down Expand Up @@ -74,8 +75,18 @@ namespace Drizzle3D {
// Index Buffer
// Shader (not needed)

if (UseOpenGL && UseVulkan) {
UseOpenGL = true;
UseVulkan = false;
}
if (!UseOpenGL && !UseVulkan) {
UseOpenGL = true;
UseVulkan = false;
}
if (UseOpenGL) {
InitGlRendering();
} else if (UseVulkan) {
InitVulkanRendering();
}

Light pointLight;
Expand Down Expand Up @@ -115,8 +126,18 @@ namespace Drizzle3D {
myOBJ.modelMatrix = modelMatrix;
myOBJ.mat = shaderProgram;
// Create Vertex Array Object (VAO), Vertex Buffer Object (VBO), and Element Buffer Object (EBO)
if (!UseOpenGL && !UseVulkan) {
UseOpenGL = true;
UseVulkan = false;
}
if (UseOpenGL && UseVulkan) {
UseOpenGL = true;
UseVulkan = false;
}
if (UseOpenGL) {
DrawVertGLRendering(myOBJ);
} else if (UseVulkan) {
DrawVertVulkanRendering(myOBJ);
}

return myOBJ;
Expand All @@ -129,8 +150,18 @@ namespace Drizzle3D {
glfwRestoreWindow(pWindow->returnwindow());
}

if (!UseOpenGL && !UseVulkan) {
UseOpenGL = true;
UseVulkan = false;
}
if (UseOpenGL && UseVulkan) {
UseOpenGL = true;
UseVulkan = false;
}
if (UseOpenGL) {
RenderInitGlRendering();
} else if (UseVulkan) {
RenderInitVulkanRendering();
}
}

Expand Down
7 changes: 6 additions & 1 deletion Drizzle3D/RenderingLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ namespace Drizzle3D {
Drizzle3D_API void InitGlRendering();
Drizzle3D_API void RenderInitGlRendering();
Drizzle3D_API void DrawVertGLRendering(Object &myOBJ);
Drizzle3D_API void InitVulkanRendering();
Drizzle3D_API void RenderInitVulkanRendering();
Drizzle3D_API void DrawVertVulkanRendering(Object& myOBJ);
private:
bool Lighting = true;
bool fullscreen = false;
bool UseOpenGL = true;
bool UseOpenGL = false;
bool UseVulkan = false;
bool show;
GLuint shaderProgram = 0;
GLuint OldshaderProgram = 0;
Expand All @@ -112,5 +116,6 @@ namespace Drizzle3D {
GLuint lightsBuffer = 0;
char* current_camera = (char*)"Default";
std::shared_ptr<ResourceManager> resourcemgr;
Logging log;
};
}
15 changes: 15 additions & 0 deletions Drizzle3D/Vulkan.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "RenderingLayer.h"

namespace Drizzle3D {
void RenderingLayer::InitVulkanRendering() {
log.Warning("Vulkan Initialization Not Implemented.");
}

void RenderingLayer::RenderInitVulkanRendering() {
log.Warning("Vulkan Rendering Not Implemented.");
}

void RenderingLayer::DrawVertVulkanRendering(Object& myOBJ) {
log.Warning("Vulkan Vertex Drawing Not Implemented.");
}
}
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.
5 changes: 2 additions & 3 deletions Drizzle3D/x64/Debug/Drizzle3D.log
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
FirstPersonCamera.cpp
Light.cpp
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\Light.cpp(13,16): warning C4244: '=': conversion from 'float' to 'int', possible loss of data
main.cpp
Object.cpp
OpenGL.cpp
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\OpenGL.cpp(178,59): warning C4267: 'argument': conversion from 'size_t' to 'GLsizei', possible loss of data
RenderingLayer.cpp
Shader.cpp
Skybox.cpp
Vulkan.cpp
main.cpp
Generating Code...
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\Camera.cpp(46,1): warning C4715: 'Drizzle3D::RenderingLayer::ReturnActiveCamera': not all control paths return a value
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\Camera.cpp(54,1): warning C4715: 'Drizzle3D::RenderingLayer::GetCameraFromID': not all control paths return a value
Creating library C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\Drizzle3D.lib and object C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\Drizzle3D.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Drizzle3D.vcxproj -> C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\Drizzle3D.dll
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.
1 change: 1 addition & 0 deletions Drizzle3D/x64/Debug/Drizzle3D.tlog/Cl.items.tlog
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\vendor\imgui\imgui_demo.cpp;C:\Users\
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\vendor\imgui\imgui_draw.cpp;C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\x64\Debug\imgui_draw.obj
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\vendor\imgui\imgui_tables.cpp;C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\x64\Debug\imgui_tables.obj
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\vendor\imgui\imgui_widgets.cpp;C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\x64\Debug\imgui_widgets.obj
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\Vulkan.cpp;C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\x64\Debug\Vulkan.obj
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\Window.cpp;C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\x64\Debug\Window.obj
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/link.command.1.tlog
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/link.read.1.tlog
Binary file not shown.
2 changes: 1 addition & 1 deletion Drizzle3D/x64/Debug/Drizzle3D.tlog/link.secondary.1.tlog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
^C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\APP.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\CAMERA.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\EVENTS.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\FIRSTPERSONCAMERA.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\FLAGS.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\GLAD.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\GLM.CPPM.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUI.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUILAYER.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUI_DEMO.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUI_DRAW.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUI_IMPL_GLFW.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUI_IMPL_OPENGL3.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\IMGUI_TABLES.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG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P\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\OPENGL.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\RENDERINGLAYER.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\RESOURCEMANAGER.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\SHADER.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\SKYBOX.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\VULKAN.OBJ|C:\USERS\RONIT\DESKTOP\DRIZZLE3D\DRIZZLE3D\X64\DEBUG\WINDOW.OBJ
C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\Drizzle3D.lib
C:\Users\ronit\Desktop\Drizzle3D\x64\Debug\Drizzle3D.EXP
C:\Users\ronit\Desktop\Drizzle3D\Drizzle3D\x64\Debug\Drizzle3D.ilk
Binary file modified Drizzle3D/x64/Debug/Drizzle3D.tlog/link.write.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/Object.obj
Binary file not shown.
Binary file modified Drizzle3D/x64/Debug/OpenGL.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 added Drizzle3D/x64/Debug/Vulkan.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: 2 additions & 1 deletion ExampleProject/ExampleProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ int main() {
app->dispatcher()->AddEventListener(EWindowClose, Closed);

app->GetRenderingLayer()->GetFlags()->ChangeFlag("Lighting", false);
app->GetRenderingLayer()->GetFlags()->ChangeFlag("UseOpenGL", true);
//app->GetRenderingLayer()->GetFlags()->ChangeFlag("UseOpenGL", false);
app->GetRenderingLayer()->GetFlags()->ChangeFlag("UseVulkan", true);

app->ImguiLayer()->code = ImGUICode;
app->GetRenderingLayer()->AddObject("Cube", app->GetRenderingLayer()->DrawVerts(Drizzle3D::LoadObjFile("Scene1_Cube.obj"), modelMatrix));
Expand Down
7 changes: 6 additions & 1 deletion ExampleProject/vendor/Drizzle3D/Drizzle3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,14 @@ namespace Drizzle3D {
Drizzle3D_API void InitGlRendering();
Drizzle3D_API void RenderInitGlRendering();
Drizzle3D_API void DrawVertGLRendering(Object& myOBJ);
Drizzle3D_API void InitVulkanRendering();
Drizzle3D_API void RenderInitVulkanRendering();
Drizzle3D_API void DrawVertVulkanRendering(Object& myOBJ);
private:
bool Lighting = true;
bool fullscreen = false;
bool UseOpenGL = true;
bool UseOpenGL = false;
bool UseVulkan = false;
bool show;
GLuint shaderProgram = 0;
GLuint OldshaderProgram = 0;
Expand All @@ -606,6 +610,7 @@ namespace Drizzle3D {
GLuint lightsBuffer = 0;
char* current_camera = (char*)"Default";
std::shared_ptr<ResourceManager> resourcemgr;
Logging log;
};

/*
Expand Down
Binary file modified ExampleProject/x64/Debug/ExampleProject.ilk
Binary file not shown.
Binary file modified ExampleProject/x64/Debug/ExampleProject.obj
Binary file not shown.
Binary file modified ExampleProject/x64/Debug/vc143.idb
Binary file not shown.
Binary file modified ExampleProject/x64/Debug/vc143.pdb
Binary file not shown.
Binary file modified x64/Debug/Drizzle3D.dll
Binary file not shown.
Binary file modified x64/Debug/Drizzle3D.exp
Binary file not shown.
Binary file modified x64/Debug/Drizzle3D.lib
Binary file not shown.
Binary file modified x64/Debug/Drizzle3D.pdb
Binary file not shown.
Binary file modified x64/Debug/ExampleProject.exe
Binary file not shown.
Binary file modified x64/Debug/ExampleProject.pdb
Binary file not shown.

0 comments on commit b0a9853

Please sign in to comment.