Skip to content

Commit

Permalink
Fixed No Renderer Object Issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherrytree56567 committed Mar 26, 2024
1 parent 27712f8 commit 2bce71e
Show file tree
Hide file tree
Showing 32 changed files with 31 additions and 14 deletions.
8 changes: 1 addition & 7 deletions Drizzle3D/OpenGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ namespace Drizzle3D {
glUseProgram(0);
}

Object RenderingLayer::DrawVertGLRendering(std::pair<std::vector<float>, std::vector<unsigned int>> vf, glm::mat4 modelMatrix) {
Object myOBJ;
myOBJ.vertices = vf.first;
myOBJ.indices = vf.second;
myOBJ.modelMatrix = modelMatrix;
myOBJ.mat = shaderProgram;
void RenderingLayer::DrawVertGLRendering(Object &myOBJ) {

glGenVertexArrays(1, &myOBJ.VertexArray);
glGenBuffers(1, &myOBJ.VertexBuffer);
Expand Down Expand Up @@ -53,7 +48,6 @@ namespace Drizzle3D {

// Unbind VAO to prevent accidentally modifying it elsewhere
glBindVertexArray(0);
return myOBJ;
}

void RenderingLayer::RenderInitGlRendering() {
Expand Down
10 changes: 8 additions & 2 deletions Drizzle3D/RenderingLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ namespace Drizzle3D {
}

Object RenderingLayer::DrawVerts(std::pair<std::vector<float>, std::vector<unsigned int>> vf, glm::mat4 modelMatrix) {

Object myOBJ;
myOBJ.vertices = vf.first;
myOBJ.indices = vf.second;
myOBJ.modelMatrix = modelMatrix;
myOBJ.mat = shaderProgram;
// Create Vertex Array Object (VAO), Vertex Buffer Object (VBO), and Element Buffer Object (EBO)
if (UseOpenGL) {
return DrawVertGLRendering(vf, modelMatrix);
DrawVertGLRendering(myOBJ);
}

return myOBJ;
}

void RenderingLayer::Render() {
Expand Down
2 changes: 1 addition & 1 deletion Drizzle3D/RenderingLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace Drizzle3D {
Drizzle3D_API Flags* GetFlags() { return &flags; }
Drizzle3D_API void InitGlRendering();
Drizzle3D_API void RenderInitGlRendering();
Drizzle3D_API Object DrawVertGLRendering(std::pair<std::vector<float>, std::vector<unsigned int>> vf, glm::mat4 modelMatrix);
Drizzle3D_API void DrawVertGLRendering(Object &myOBJ);
private:
bool Lighting = true;
bool fullscreen = false;
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.
17 changes: 15 additions & 2 deletions Drizzle3D/x64/Debug/Drizzle3D.log
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
 Scanning sources for module dependencies...
App.cpp
Camera.cpp
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(184,59): warning C4267: 'argument': conversion from 'size_t' to 'GLsizei', possible loss of data
Window.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
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.
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/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 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.
8 changes: 6 additions & 2 deletions ExampleProject/vendor/Drizzle3D/Drizzle3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,13 @@ namespace Drizzle3D {
Drizzle3D_API Camera ReturnActiveCamera();
Drizzle3D_API Camera GetCameraFromID(char* cam);
Drizzle3D_API Flags* GetFlags() { return &flags; }

bool Lighting = true;
Drizzle3D_API void InitGlRendering();
Drizzle3D_API void RenderInitGlRendering();
Drizzle3D_API void DrawVertGLRendering(Object& myOBJ);
private:
bool Lighting = true;
bool fullscreen = false;
bool UseOpenGL = true;
bool show;
GLuint shaderProgram = 0;
GLuint OldshaderProgram = 0;
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 2bce71e

Please sign in to comment.