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

Method OnIdle

GTE/Samples/Graphics/Texturing/TexturingWindow3.cpp:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void TexturingWindow3::OnIdle()
29{
30 mTimer.Measure();
31
32 if (mCameraRig.Move())
33 {
34 mPVWMatrices.Update();
35 }
36
37 mEngine->ClearBuffers();
38 mEngine->Draw(mSquare);
39 mEngine->Draw(8, mYSize - 8, { 0.0f, 0.0f, 0.0f, 1.0f }, mTimer.GetFPS());
40 mEngine->DisplayColorBuffer(0);
41
42#if defined(SAVE_RENDERING_TO_DISK)
43 mEngine->Enable(mTarget);
44 mEngine->ClearBuffers();
45 mEngine->Draw(mSquare);
46 mEngine->Disable(mTarget);
47 mEngine->CopyGpuToCpu(mTarget->GetRTTexture(0));
48 WICFileIO::SaveToPNG("Texturing.png", mTarget->GetRTTexture(0));
49#endif
50
51 mTimer.UpdateFrameCount();
52}
53
54bool TexturingWindow3::SetEnvironment()
55{

Callers

nothing calls this directly

Calls 12

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

Tested by

no test coverage detected