Skip to content

Commit

Permalink
Cleaning up code
Browse files Browse the repository at this point in the history
  • Loading branch information
boingboomtschak committed Dec 7, 2021
1 parent fc960ad commit cb9f30c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 31 deletions.
1 change: 0 additions & 1 deletion FallingSandCubed.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@
<ClInclude Include="include\CameraControls.h" />
<ClInclude Include="include\dCube.h" />
<ClInclude Include="include\GeomUtils.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<None Include="shaders\compute.comp">
Expand Down
12 changes: 4 additions & 8 deletions fallingSandCubed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ void CompileShaders() {
}
}

void RenderDropper() {
void RenderBrush() {
glStencilFunc(GL_ALWAYS, 1, 0xFF);
glStencilMask(0xFF);
glUseProgram(renderProgram);
Expand All @@ -332,7 +332,7 @@ void RenderDropper() {
glDrawElements(GL_TRIANGLES, 36, GL_UNSIGNED_INT, cube_triangles);
}

void RenderDropperStencil() {
void RenderBrushStencil() {
glStencilFunc(GL_NOTEQUAL, 1, 0xFF);
glStencilMask(0x00);
glDisable(GL_DEPTH_TEST);
Expand All @@ -350,10 +350,6 @@ void RenderDropperStencil() {
glEnable(GL_DEPTH_TEST);
}





void ChangeBrushElement (int type) {
brushElement = type;
switch (type) {
Expand Down Expand Up @@ -736,8 +732,8 @@ void Display() {
cube.display(camera);
if (renderer == 0) grid.cpuManagedRender();
else if (renderer == 1) grid.instancedRender();
RenderDropper();
if (drawBrushHighlight) RenderDropperStencil();
RenderBrush();
if (drawBrushHighlight) RenderBrushStencil();
RenderImGui();
glFlush();
}
Expand Down
17 changes: 11 additions & 6 deletions imgui.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@ Size=181,70
Collapsed=0

[Window][Dear ImGui Demo]
Pos=256,47
Pos=271,174
Size=546,693
Collapsed=0

[Window][Example: Console]
Pos=190,98
Pos=1052,441
Size=520,600
Collapsed=0

[Window][Example: Log]
Pos=60,60
Pos=1318,93
Size=500,400
Collapsed=0

[Window][Example: Simple layout]
Pos=241,202
Pos=842,244
Size=500,403
Collapsed=0

Expand Down Expand Up @@ -84,7 +84,7 @@ Size=400,240
Collapsed=0

[Window][Help]
Pos=11,277
Pos=9,98
Size=400,240
Collapsed=0

Expand All @@ -109,7 +109,12 @@ Size=621,794
Collapsed=0

[Window][Elements]
Pos=14,535
Pos=286,211
Size=400,140
Collapsed=0

[Window][Example: Constrained Resize]
Pos=60,60
Size=689,293
Collapsed=0

15 changes: 0 additions & 15 deletions resource.h

This file was deleted.

1 change: 0 additions & 1 deletion shaders/gridRender.vert
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#version 430 core


in vec3 point;
in vec3 normal;

Expand Down

0 comments on commit cb9f30c

Please sign in to comment.