MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / OnIdle

Method OnIdle

GTE/Samples/Physics/Fluids2D/Fluids2DWindow2.cpp:25–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void Fluids2DWindow2::OnIdle()
26{
27 mTimer.Measure();
28
29 mFluid.DoSimulationStep();
30 mEngine->Draw(mOverlay);
31 mEngine->Draw(8, mYSize - 8, { 1.0f, 1.0f, 0.0f, 1.0f }, mTimer.GetFPS());
32 mEngine->DisplayColorBuffer(1);
33
34#if defined(SAVE_RENDERING_TO_DISK)
35 mEngine->Enable(mTarget);
36 mEngine->ClearBuffers();
37 mEngine->Draw(mOverlay);
38 mEngine->Disable(mTarget);
39 mEngine->CopyGpuToCpu(mTarget->GetRTTexture(0));
40 WICFileIO::SaveToPNG("Video/Smoke" + std::to_string(mVideoFrame) + ".png",
41 mTarget->GetRTTexture(0));
42 ++mVideoFrame;
43#endif
44
45 mTimer.UpdateFrameCount();
46}
47
48bool Fluids2DWindow2::OnCharPress(uint8_t key, int32_t x, int32_t y)
49{

Callers

nothing calls this directly

Calls 11

MeasureMethod · 0.80
GetFPSMethod · 0.80
UpdateFrameCountMethod · 0.80
DoSimulationStepMethod · 0.45
DrawMethod · 0.45
DisplayColorBufferMethod · 0.45
EnableMethod · 0.45
ClearBuffersMethod · 0.45
DisableMethod · 0.45
CopyGpuToCpuMethod · 0.45
GetRTTextureMethod · 0.45

Tested by

no test coverage detected