Rev | Line | |
---|
[37] | 1 | #include <stdio.h> |
---|
| 2 | #include <stdlib.h> |
---|
| 3 | #include "Mesh.h" |
---|
| 4 | |
---|
| 5 | |
---|
| 6 | |
---|
| 7 | // Initialize the Mesh |
---|
| 8 | Mesh::Mesh() |
---|
| 9 | { |
---|
| 10 | numVerts = 0; |
---|
| 11 | verts = NULL; |
---|
| 12 | |
---|
| 13 | numTris = 0; |
---|
| 14 | tris = NULL; |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | // Clean up the Mesh |
---|
| 18 | Mesh::~Mesh() |
---|
| 19 | { |
---|
| 20 | // Free verts, and each vertex's pointers... |
---|
| 21 | if (verts != NULL) { |
---|
| 22 | for (int i = 0; i < numVerts; i++) { |
---|
| 23 | delete [] verts[i].verts; |
---|
| 24 | delete [] verts[i].tris; |
---|
| 25 | } |
---|
| 26 | delete [] verts; |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | // Free tris and edges |
---|
| 30 | if (tris != NULL) { delete [] tris; } |
---|
| 31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.