MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DrawRenderTab

Function DrawRenderTab

engine/Poseidon/Dev/Debug/DebugOverlay.cpp:1439–1484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1437 if (ImGui::Button("Reset window"))
1438 perf.Reset();
1439}
1440void DrawRenderTab()
1441{
1442 if (!GEngine)
1443 {
1444 ImGui::TextDisabled("engine not up");
1445 return;
1446 }
1447
1448 int samples = GEngine->GetMsaaSamples();
1449 int sampleIdx = samples >= 8 ? 3 : samples >= 4 ? 2 : samples >= 2 ? 1 : 0;
1450 if (ImGui::Combo("MSAA", &sampleIdx,
1451 "Off\0"
1452 "2x\0"
1453 "4x\0"
1454 "8x\0"))
1455 {
1456 static const int kSamples[] = {0, 2, 4, 8};
1457 GEngine->SetMsaaSamples(kSamples[sampleIdx]);
1458 }
1459
1460 float scale = GEngine->GetRenderScale();
1461 if (ImGui::SliderFloat("Render scale (SSAA)", &scale, 1.0f, 2.0f, "%.2f"))
1462 GEngine->SetRenderScale(scale);
1463 ImGui::SameLine();
1464 if (ImGui::Button("1x"))
1465 GEngine->SetRenderScale(1.0f);
1466 ImGui::SameLine();
1467 if (ImGui::Button("1.5x"))
1468 GEngine->SetRenderScale(1.5f);
1469 ImGui::SameLine();
1470 if (ImGui::Button("2x"))
1471 GEngine->SetRenderScale(2.0f);
1472
1473 bool a2c = GEngine->GetAlphaToCoverage();
1474 if (ImGui::Checkbox("Alpha-to-coverage (cutout AA; needs MSAA)", &a2c))
1475 GEngine->SetAlphaToCoverage(a2c);
1476
1477 bool flat = GEngine->GetDebugFlatColor();
1478 if (ImGui::Checkbox("Flat shading (objects -> solid red; shading-vs-geometry probe)", &flat))
1479 GEngine->SetDebugFlatColor(flat);
1480
1481 ImGui::Separator();
1482 ImGui::Text("window %d x %d", GEngine->Width(), GEngine->Height());
1483 ImGui::Text("target scale %.2fx, %dx MSAA", GEngine->GetRenderScale(), GEngine->GetMsaaSamples());
1484 ImGui::TextDisabled("settings are session-only; persist via graphics.cfg");
1485}
1486void DrawMouseTab()
1487{

Callers 1

DrawMainWindowFunction · 0.85

Calls 10

GetMsaaSamplesMethod · 0.45
SetMsaaSamplesMethod · 0.45
GetRenderScaleMethod · 0.45
SetRenderScaleMethod · 0.45
GetAlphaToCoverageMethod · 0.45
SetAlphaToCoverageMethod · 0.45
GetDebugFlatColorMethod · 0.45
SetDebugFlatColorMethod · 0.45
WidthMethod · 0.45
HeightMethod · 0.45

Tested by

no test coverage detected