Code cleanup, rename ui overlay property
This commit is contained in:
parent
9a8710a57c
commit
fb881ab76f
8 changed files with 69 additions and 69 deletions
|
|
@ -4,7 +4,7 @@
|
|||
* This sample renders a basic text overlay on top of a 3D scene that can be used e.g. for debug purposes
|
||||
* For a more complete GUI sample see the ImGui sample
|
||||
*
|
||||
* Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de
|
||||
* Copyright (C) 2016-2024 by Sascha Willems - www.saschawillems.de
|
||||
*
|
||||
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
|
||||
*/
|
||||
|
|
@ -535,23 +535,23 @@ public:
|
|||
|
||||
textOverlay->beginTextUpdate();
|
||||
|
||||
textOverlay->addText(title, 5.0f * UIOverlay.scale, 5.0f * UIOverlay.scale, TextOverlay::alignLeft);
|
||||
textOverlay->addText(title, 5.0f * ui.scale, 5.0f * ui.scale, TextOverlay::alignLeft);
|
||||
|
||||
std::stringstream ss;
|
||||
ss << std::fixed << std::setprecision(2) << (frameTimer * 1000.0f) << "ms (" << lastFPS << " fps)";
|
||||
textOverlay->addText(ss.str(), 5.0f * UIOverlay.scale, 25.0f * UIOverlay.scale, TextOverlay::alignLeft);
|
||||
textOverlay->addText(ss.str(), 5.0f * ui.scale, 25.0f * ui.scale, TextOverlay::alignLeft);
|
||||
|
||||
textOverlay->addText(deviceProperties.deviceName, 5.0f * UIOverlay.scale, 45.0f * UIOverlay.scale, TextOverlay::alignLeft);
|
||||
textOverlay->addText(deviceProperties.deviceName, 5.0f * ui.scale, 45.0f * ui.scale, TextOverlay::alignLeft);
|
||||
|
||||
// Display current model view matrix
|
||||
textOverlay->addText("model view matrix", (float)width - 5.0f * UIOverlay.scale, 5.0f * UIOverlay.scale, TextOverlay::alignRight);
|
||||
textOverlay->addText("model view matrix", (float)width - 5.0f * ui.scale, 5.0f * ui.scale, TextOverlay::alignRight);
|
||||
|
||||
for (uint32_t i = 0; i < 4; i++)
|
||||
{
|
||||
ss.str("");
|
||||
ss << std::fixed << std::setprecision(2) << std::showpos;
|
||||
ss << uniformData.modelView[0][i] << " " << uniformData.modelView[1][i] << " " << uniformData.modelView[2][i] << " " << uniformData.modelView[3][i];
|
||||
textOverlay->addText(ss.str(), (float)width - 5.0f * UIOverlay.scale, (25.0f + (float)i * 20.0f) * UIOverlay.scale, TextOverlay::alignRight);
|
||||
textOverlay->addText(ss.str(), (float)width - 5.0f * ui.scale, (25.0f + (float)i * 20.0f) * ui.scale, TextOverlay::alignRight);
|
||||
}
|
||||
|
||||
glm::vec3 projected = glm::project(glm::vec3(0.0f), uniformData.modelView, uniformData.projection, glm::vec4(0, 0, (float)width, (float)height));
|
||||
|
|
@ -559,8 +559,8 @@ public:
|
|||
|
||||
#if defined(__ANDROID__)
|
||||
#else
|
||||
textOverlay->addText("Press \"space\" to toggle text overlay", 5.0f * UIOverlay.scale, 65.0f * UIOverlay.scale, TextOverlay::alignLeft);
|
||||
textOverlay->addText("Hold middle mouse button and drag to move", 5.0f * UIOverlay.scale, 85.0f * UIOverlay.scale, TextOverlay::alignLeft);
|
||||
textOverlay->addText("Press \"space\" to toggle text overlay", 5.0f * ui.scale, 65.0f * ui.scale, TextOverlay::alignLeft);
|
||||
textOverlay->addText("Hold middle mouse button and drag to move", 5.0f * ui.scale, 85.0f * ui.scale, TextOverlay::alignLeft);
|
||||
#endif
|
||||
textOverlay->endTextUpdate();
|
||||
|
||||
|
|
@ -666,7 +666,7 @@ public:
|
|||
renderPass,
|
||||
&width,
|
||||
&height,
|
||||
UIOverlay.scale,
|
||||
ui.scale,
|
||||
shaderStages
|
||||
);
|
||||
updateTextOverlay();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue