1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
SaveDataWrapper saveWrapper; // Relevant Line
void drawGraphWindow(PATHS_TYPE paths, vector<string>* pathsFileNames,
Vertex* smallest, Vertex* largest);
void glutInitialization(Plugin* plugin);
void fillVBOs(Data* data);
int main()
{
Vertex* smallest = new Vertex(DBL_MAX, DBL_MAX);
Vertex* largest = new Vertex(DBL_MIN, DBL_MIN);
PATHS_TYPE paths = readInput(*smallest, *largest);
vector<string>* pathsFileNames = new vector<string>();
pathsFileNames->push_back("hello.csv");
pathsFileNames->push_back("goodbye.csv");
drawGraphWindow(paths, pathsFileNames, smallest, largest);
cout << "hello" << endl; // Never prints this before destructor
return 0;
}
// Pass a subclass of plugin as plugin if you want to use its draw method
// otherwise pass NULL and the default draw method will be used
void drawGraphWindow(PATHS_TYPE paths, vector<string>* pathsFileNames,
Vertex* smallest, Vertex* largest)
{
Data* data = new Data(paths, pathsFileNames, smallest,
largest, windowWidth, windowHeight);
saveWrapper = SaveDataWrapper(data); // Relevant Line
// Destructor called before code gets here.
GLDisplay::data = data;
GlutUI::data = data;
glClearColor(0.0, 0.0, 0.0, 0.0);
glutInitialization(new GLDisplay());
glewInit();
fillVBOs(data);
glutMainLoop();
}
|