void Boiler::run() { double prevTime = SDL_GetTicks(); double frameLag = 0.0f; running = true; while(running) { //get the delta time double currentTime = SDL_GetTicks(); double frameDelta = (currentTime - prevTime) / 1000.0f; prevTime = currentTime; frameLag += frameDelta; processInput(); while (frameLag >= frameInterval) { // TODO: Render system needs to not kick in when frame is lagging, only physics etc systems should be updated during frame lag catchup. // Need a clean way to essentially move the render() to outside the while loop here (after). update(frameInterval); part->update(frameInterval); frameLag -= frameInterval; } renderer->beginRender(); renderSystem->update(getEcs().getComponentStore(), frameDelta); glyphSystem->update(getEcs().getComponentStore(), frameDelta); renderer->endRender(); } }
void ArxDbgDbAdeskLogo::commonDraw(AcGiCommonDraw* drawContext) { if (drawContext->regenAbort()) return; AcGeMatrix3d scaleMat; m_scale.getMatrix(scaleMat); AcGeMatrix3d mat; getEcs(mat); // push ECS of this Logo mat *= scaleMat; drawContext->rawGeometry()->pushModelTransform(mat); ArxDbgDbAdeskLogoStyle* lStyle = NULL; Acad::ErrorStatus es = acdbOpenObject(lStyle, m_logoStyleId, AcDb::kForRead); drawLogo(drawContext, lStyle); drawLabel(drawContext, lStyle); drawBorder(drawContext, lStyle); if (es == Acad::eOk) lStyle->close(); drawContext->rawGeometry()->popModelTransform(); drawRefLine(drawContext); }