MCPcopy Create free account
hub / github.com/cinder/Cinder / AppImplLinux

Method AppImplLinux

src/cinder/app/linux/AppImplLinuxGlfw.cpp:320–360  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// AppImplLinux ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

318// AppImplLinux
319////////////////////////////////////////////////////////////////////////////////
320AppImplLinux::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
362AppImplLinux::~AppImplLinux()
363{

Callers

nothing calls this directly

Calls 14

createWindowMethod · 0.95
glfwSetErrorCallbackFunction · 0.85
glfwInitFunction · 0.85
stringFunction · 0.85
setWindowFunction · 0.85
isTitleSpecifiedMethod · 0.80
backMethod · 0.80
getFrameRateMethod · 0.45
isFrameRateEnabledMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45
setTitleMethod · 0.45

Tested by

no test coverage detected