//------------------------------------------------------------------------------ void Camera::onCreate() { // Note: Application should never be null here, because it's the first object // to be created when the engine runs sf::Vector2i screenSize = Application::instance()->screenSize(); onScreenResized(sf::Vector2u(screenSize.x, screenSize.y)); }
void CoreManager::enableResizing() { onScreenResized(); // register resize handler struct sigaction sig; sig.sa_handler = signalHandler; sigemptyset(&sig.sa_mask); sig.sa_flags = SA_RESTART; sigaction(SIGWINCH, &sig, NULL); }
//------------------------------------------------------------------------------ void Camera::setFixedZoom(f32 fixedZoom) { const f32 epsilon = 0.001f; if(fixedZoom < epsilon) { m_fixedZoom = epsilon; #ifdef ZN_DEBUG std::cout << "W: Camera::setFixedZoom: too tiny (" << fixedZoom << ")" << std::endl; #endif } else { m_fixedZoom = fixedZoom; } sf::Vector2i screenSize = Application::instance()->screenSize(); onScreenResized(sf::Vector2u(screenSize.x, screenSize.y)); }