/////////////////////////////////////////////////////////////////////////// AppImplLinux ///////////////////////////////////////////////////////////////////////////
| 318 | // AppImplLinux |
| 319 | //////////////////////////////////////////////////////////////////////////////// |
| 320 | AppImplLinux::AppImplLinux( AppLinux *aApp, const AppLinux::Settings &settings ) |
| 321 | : mApp( aApp ) |
| 322 | { |
| 323 | // Set error callback |
| 324 | ::glfwSetErrorCallback( GlfwCallbacks::onError ); |
| 325 | |
| 326 | // Must be called before we can do anything with GLFW |
| 327 | if( ! ::glfwInit() ) { |
| 328 | std::cerr << std::string( "::glfwInit failed!" ) << std::endl; |
| 329 | std::exit( 1 ); |
| 330 | } |
| 331 | |
| 332 | mFrameRate = settings.getFrameRate(); |
| 333 | mFrameRateEnabled = settings.isFrameRateEnabled(); |
| 334 | mQuitOnLastWindowClosed = settings.isQuitOnLastWindowCloseEnabled(); |
| 335 | |
| 336 | auto formats = settings.getWindowFormats(); |
| 337 | if( formats.empty() ) { |
| 338 | formats.push_back( settings.getDefaultWindowFormat() ); |
| 339 | } |
| 340 | |
| 341 | for( auto& format : formats ) { |
| 342 | if( ! format.isTitleSpecified() ) { |
| 343 | format.setTitle( settings.getTitle() ); |
| 344 | } |
| 345 | |
| 346 | // We need to keep tabs on the main window since it's how |
| 347 | // we will communicate with GLFW. |
| 348 | if( ! mMainWindow ) { |
| 349 | mMainWindow = this->createWindow( format ); |
| 350 | } |
| 351 | else { |
| 352 | this->createWindow( format ); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | // Set the active window |
| 357 | if( ! mWindows.empty() ) { |
| 358 | setWindow( mWindows.back()->getWindow() ); |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | AppImplLinux::~AppImplLinux() |
| 363 | { |
nothing calls this directly
no test coverage detected