void Graphics::RefreshSceneRect() { // GFade is drawn after the scene buffer, so this is in window space UpdateScreenSize(windowWidth(), windowHeight()); /* Calculates the rectangle within the back buffer that the scene will be drawn in. This accounts for "fit to width/height" scenarios where the back buffer has a different aspect ratio. */ float w = static_cast<float>(windowWidth()); float h = static_cast<float>(windowHeight()); float wFactor = (float)w / config.renderWidth; float hFactor = (float)h / config.renderHeight; mSceneScale = std::min(wFactor, hFactor); int screenW = (int)round(mSceneScale * config.renderWidth); int screenH = (int)round(mSceneScale * config.renderHeight); // Center on screen RECT rect; rect.left = (mWindowWidth - screenW) / 2; rect.top = (mWindowHeight - screenH) / 2; rect.right = rect.left + screenW; rect.bottom = rect.top + screenH; mSceneRect = rect; }
void MainWindow::on_actionJulian_SetPreview_triggered() { JulianViewCentreCoordinates.setX(0); JulianViewCentreCoordinates.setY(0); SelectedEffect = MandelProt; julianset = true; UpdateScreenSize(); /* Calculate new image for new window size */ StartCalculation(false); }
void MainWindow::ReStartCalculation() { UpdateScreenSize(); if (ThreadsRunning == 0) { StartCalculation(julianset); } else { reCalculationPending = true; } }
void COptsDisplayDlg::UpdateDisplayList() { CMixer::EnumDDObjects(m_DDObj); UpdateCurDisplay(); if (IsWindow(m_hWnd)) { int objs = m_DDObj.GetSize(); for (int i = 0; i < objs; i++) { const CDDEnumObj& obj = m_DDObj[i]; CString s(obj.m_DriverName); s.TrimLeft(_T("\\.")); // remove leading delimiters m_DisplayCombo.AddString(s + _T(" / ") + obj.m_DriverDescription); } m_DisplayCombo.SetCurSel(m_CurDisplay); UpdateScreenSize(); } }
void COptsDisplayDlg::OnSelchangeDisplayCombo() { UpdateScreenSize(); }