Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Главный цикл приложения
- _s32 Engine::Run()
- {
- LOGLN(L"[DBG] Engine started ...");
- if (m_pInitData->bFullScreen)
- SetFullScreenMode(true);
- LogProcessorInfo();
- LogDisplayDevicesInfo();
- m_pCamera = new Camera();
- m_frame3D = new Frame3D();
- if (!SetUpNewFrame(m_frame3D))
- return E_FAIL;
- SelectGameFrame(m_frame3D);
- MSG msg = { 0 };
- LOGLN((L"[Localization]: " + LOCCS("#localization_title")).c_str());
- GetWindowRect(m_hWnd, m_pWindowClientRect);
- m_iWidth = m_pWindowClientRect->right - m_pWindowClientRect->left;
- m_iHeight = m_pWindowClientRect->bottom - m_pWindowClientRect->top;
- UI_GetInput();
- m_timeLastUpdate = time(nullptr);
- while (msg.message != WM_QUIT)
- {
- if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- else
- {
- auto now = time(nullptr);
- _f32 delta = static_cast<_f32>(difftime(now, m_timeLastUpdate));
- /*if (delta < m_fTargetDelay)
- continue;*/
- m_timeLastUpdate = now;
- Update(delta);
- Render(delta);
- }
- }
- LOGLN(L"[DBG] Engine closed!");
- return static_cast<_s32>(msg.wParam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement