Skip to content

Commit

Permalink
Using std::format also in examples, fmt::format no longer
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesugb committed Dec 1, 2023
1 parent 2591d43 commit d0b27ec
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ int main() // <== Starting point ==

for (auto* app : apps) {
bool isEnabled = app->is_enabled();
std::string name = fmt::format("Disable/Enable Invokee [{}]", app->name());
std::string name = std::format("Disable/Enable Invokee [{}]", app->name());
ImGui::Checkbox(name.c_str(), &isEnabled);
if (isEnabled != app->is_enabled())
{
Expand Down
8 changes: 4 additions & 4 deletions examples/orca_loader/source/orca_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,12 @@ class orca_loader_app : public avk::invokee
startPart = avk::context().get_time();

for (auto& t : times) {
LOG_INFO(fmt::format("{} took {}", std::get<0>(t), std::get<1>(t)));
LOG_INFO(std::format("{} took {}", std::get<0>(t), std::get<1>(t)));
}

auto end = avk::context().get_time();
auto diff = end - start;
LOG_INFO(fmt::format("load_orca_scene took {} in total", diff));
LOG_INFO(std::format("load_orca_scene took {} in total", diff));


auto swapChainFormat = avk::context().main_window()->swap_chain_image_format();
Expand Down Expand Up @@ -360,12 +360,12 @@ class orca_loader_app : public avk::invokee
startPart = avk::context().get_time();

for (auto& t : times) {
LOG_INFO(fmt::format("{} took {}", std::get<0>(t), std::get<1>(t)));
LOG_INFO(std::format("{} took {}", std::get<0>(t), std::get<1>(t)));
}

auto end = avk::context().get_time();
auto diff = end - start;
LOG_INFO(fmt::format("load_orca_scene_cached took {} in total", diff));
LOG_INFO(std::format("load_orca_scene_cached took {} in total", diff));

auto swapChainFormat = avk::context().main_window()->swap_chain_image_format();
// Create our rasterization graphics pipeline with the required configuration:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class ray_query_in_ray_tracing_shaders_invokee : public avk::invokee
if (avk::input().key_pressed(avk::key_code::space)) {
// Print the current camera position
auto pos = mQuakeCam.translation();
LOG_INFO(fmt::format("Current camera position: {}", avk::to_string(pos)));
LOG_INFO(std::format("Current camera position: {}", avk::to_string(pos)));
}
if (avk::input().key_pressed(avk::key_code::escape) || avk::context().main_window()->should_be_closed()) {
// Stop the current composition:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ class ray_tracing_custom_intersection_app : public avk::invokee
ImGui::Separator();
ImGui::TextColored(ImVec4(0.f, 0.8f, 0.6f, 1.f), "Modify Bottom Level Acceleration Structures:");
for (int i=0; i < mAabbs.size(); ++i) {
ImGui::DragFloat3(fmt::format("AABB[{}].min", i).c_str(), *reinterpret_cast<float(*)[3]>(&mAabbs[i].minX), 0.01f);
ImGui::DragFloat3(fmt::format("AABB[{}].max", i).c_str(), *reinterpret_cast<float(*)[3]>(&mAabbs[i].maxX), 0.01f);
ImGui::DragFloat3(std::format("AABB[{}].min", i).c_str(), *reinterpret_cast<float(*)[3]>(&mAabbs[i].minX), 0.01f);
ImGui::DragFloat3(std::format("AABB[{}].max", i).c_str(), *reinterpret_cast<float(*)[3]>(&mAabbs[i].maxX), 0.01f);
}
ImGui::DragFloat3("Pyramid Spire", *reinterpret_cast<float(*)[3]>(&mPyramidVertices[0].mPosition), 0.01f);

ImGui::Separator();
ImGui::TextColored(ImVec4(0.8f, 0.0f, 0.6f, 1.f), "Modify Top Level Acceleration Structures:");
for (int i=0; i < mTranslations.size(); ++i) {
ImGui::DragFloat3(fmt::format("Instance[{}].translation", i).c_str(), *reinterpret_cast<float(*)[3]>(&mTranslations[i]), 0.01f);
ImGui::DragFloat3(std::format("Instance[{}].translation", i).c_str(), *reinterpret_cast<float(*)[3]>(&mTranslations[i]), 0.01f);
}

ImGui::Separator();
Expand Down Expand Up @@ -311,7 +311,7 @@ class ray_tracing_custom_intersection_app : public avk::invokee
if (avk::input().key_pressed(avk::key_code::space)) {
// Print the current camera position
auto pos = mQuakeCam.translation();
LOG_INFO(fmt::format("Current camera position: {}", avk::to_string(pos)));
LOG_INFO(std::format("Current camera position: {}", avk::to_string(pos)));
}
if (avk::input().key_pressed(avk::key_code::escape) || avk::context().main_window()->should_be_closed()) {
// Stop the current composition:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class ray_tracing_with_shadows_and_ao_invokee : public avk::invokee
if (avk::input().key_pressed(avk::key_code::space)) {
// Print the current camera position
auto pos = mQuakeCam.translation();
LOG_INFO(fmt::format("Current camera position: {}", avk::to_string(pos)));
LOG_INFO(std::format("Current camera position: {}", avk::to_string(pos)));
}
if (avk::input().key_pressed(avk::key_code::escape) || avk::context().main_window()->should_be_closed()) {
// Stop the current composition:
Expand Down

0 comments on commit d0b27ec

Please sign in to comment.