125 | | ATLASDLLIMPEXP void Atlas_StartWindow(const wchar_t* type) |
126 | | { |
127 | | // Initialise libxml2 |
128 | | // (If we're executed from the game instead, it has the responsibility to initialise libxml2) |
129 | | LIBXML_TEST_VERSION |
130 | | |
131 | | g_InitialWindowType = type; |
132 | | #ifdef __WXMSW__ |
133 | | wxEntry(g_Module); |
134 | | #else |
135 | | #ifdef __WXGTK__ |
136 | | // Because we do GL calls from a secondary thread, Xlib needs to |
137 | | // be told to support multiple threads safely |
138 | | int status = XInitThreads(); |
139 | | if (status == 0) |
140 | | { |
141 | | fprintf(stderr, "Error enabling thread-safety via XInitThreads\n"); |
142 | | } |
143 | | #endif |
144 | | int argc = 1; |
145 | | char atlas[] = "atlas"; |
146 | | char *argv[] = {atlas, NULL}; |
147 | | #ifndef __WXOSX__ |
148 | | wxEntry(argc, argv); |
149 | | #else |
150 | | // Fix for OS X init (see http://trac.wildfiregames.com/ticket/2427 ) |
151 | | // If we launched from in-game, SDL started NSApplication which will |
152 | | // break some things in wxWidgets |
153 | | wxEntryStart(argc, argv); |
154 | | wxTheApp->OnInit(); |
155 | | wxTheApp->OnRun(); |
156 | | wxTheApp->OnExit(); |
157 | | wxEntryCleanup(); |
158 | | #endif |
159 | | |
160 | | #endif |
161 | | } |
162 | | |
| 329 | |
| 330 | ATLASDLLIMPEXP void Atlas_StartWindow(const wchar_t* type) |
| 331 | { |
| 332 | // Initialise libxml2 |
| 333 | // (If we're executed from the game instead, it has the responsibility to initialise libxml2) |
| 334 | LIBXML_TEST_VERSION |
| 335 | |
| 336 | g_InitialWindowType = type; |
| 337 | #ifdef __WXMSW__ |
| 338 | wxEntry(g_Module); |
| 339 | #else |
| 340 | #ifdef __WXGTK__ |
| 341 | // Because we do GL calls from a secondary thread, Xlib needs to |
| 342 | // be told to support multiple threads safely |
| 343 | int status = XInitThreads(); |
| 344 | if (status == 0) |
| 345 | { |
| 346 | fprintf(stderr, "Error enabling thread-safety via XInitThreads\n"); |
| 347 | } |
| 348 | #endif |
| 349 | int argc = 1; |
| 350 | char atlas[] = "atlas"; |
| 351 | char *argv[] = {atlas, NULL}; |
| 352 | #ifndef __WXOSX__ |
| 353 | wxEntry(argc, argv); |
| 354 | #else |
| 355 | // Fix for OS X init (see http://trac.wildfiregames.com/ticket/2427 ) |
| 356 | // If we launched from in-game, SDL started NSApplication which will |
| 357 | // break some things in wxWidgets |
| 358 | wxApp::SetInstance(new AtlasDLLApp()); |
| 359 | wxEntry(argc, argv); |
| 360 | #endif |
| 361 | |
| 362 | #endif |
| 363 | } |
| 364 | |