Skip to content

Commit

Permalink
Removed SpatialMappingObject destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Bvallon-sl committed Nov 12, 2020
1 parent e89a22a commit 2e10741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 0 additions & 11 deletions Tutorials/tutorial 9 - spatial mapping/GLViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public void update()
{
if (ask_clear)
{
Console.WriteLine("CLEAR");
sub_maps.Clear();
ask_clear = false;
}
Expand Down Expand Up @@ -341,16 +340,6 @@ public void draw(bool draw_mesh)
}
}

~SpatialMappingObject()
{
current_fc = 0;
if(vaoID_ != 0)
{
Gl.DeleteBuffers(vboID_);
Gl.DeleteVertexArrays(vaoID_);
}
}

uint vaoID_;
uint[] vboID_ = new uint[2];
int current_fc;
Expand Down
5 changes: 5 additions & 0 deletions Tutorials/tutorial 9 - spatial mapping/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public MainWindow(string[] args)
// Create OpenGL Viewer
viewer = new GLViewer(new Resolution((uint)Width, (uint)Height));

Console.WriteLine("Hit SPACE BAR to start spatial mapping...");

// Create OpenGL window
CreateWindow();
}
Expand Down Expand Up @@ -210,6 +212,7 @@ private void NativeWindow_Render(object sender, NativeWindowEventArgs e)

zedCamera.EnableSpatialMapping(ref spatialMappingParameters);

Console.WriteLine("Hit SPACE BAR to stop spatial mapping...");
// Clear previous Mesh data
viewer.clearCurrentMesh();

Expand Down Expand Up @@ -256,6 +259,8 @@ private void NativeWindow_Render(object sender, NativeWindowEventArgs e)
mapping_state = SPATIAL_MAPPING_STATE.NOT_ENABLED;
mapping_activated = false;
zedCamera.DisableSpatialMapping();

Console.WriteLine("Hit SPACE BAR to start spatial mapping...");
}
}
timer++;
Expand Down

0 comments on commit 2e10741

Please sign in to comment.