main.cpp

changeset 30
31ff9aabd506
parent 29
55406ce7446e
child 42
499c25af0303
equal deleted inserted replaced
29:55406ce7446e 30:31ff9aabd506
1 /*
2 * LDForge: LDraw parts authoring CAD
3 * Copyright (C) 2013 Santeri `arezey` Piippo
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
1 #include <QApplication> 19 #include <QApplication>
2 #include "gui.h" 20 #include "gui.h"
3 #include "file.h" 21 #include "file.h"
4 #include "bbox.h" 22 #include "bbox.h"
5 #include "misc.h" 23 #include "misc.h"
6 #include "config.h" 24 #include "config.h"
7 25
8 vector<OpenFile*> g_LoadedFiles; 26 vector<OpenFile*> g_LoadedFiles;
9 OpenFile* g_CurrentFile = NULL; 27 OpenFile* g_CurrentFile = nullptr;
10 ForgeWindow* g_qWindow = NULL; 28 ForgeWindow* g_qWindow = nullptr;
11 bbox g_BBox; 29 bbox g_BBox;
30 QApplication* g_qMainApp = nullptr;
12 31
13 int main (int dArgC, char* saArgV[]) { 32 int main (int dArgC, char* saArgV[]) {
14 // Load or create the configuration 33 // Load or create the configuration
15 if (!config::load()) { 34 if (!config::load()) {
16 printf ("Creating configuration file...\n"); 35 printf ("Creating configuration file...\n");
20 printf ("failed to create configuration file!\n"); 39 printf ("failed to create configuration file!\n");
21 } 40 }
22 41
23 QApplication app (dArgC, saArgV); 42 QApplication app (dArgC, saArgV);
24 ForgeWindow* win = new ForgeWindow; 43 ForgeWindow* win = new ForgeWindow;
44
45 g_qMainApp = &app;
25 g_qWindow = win; 46 g_qWindow = win;
47
26 win->show (); 48 win->show ();
27 return app.exec (); 49 return app.exec ();
28 } 50 }
29 51
30 vertex vertex::midpoint (vertex& other) { 52 vertex vertex::midpoint (vertex& other) {

mercurial