| 9337 | //----------------------------------------------------------------------------- |
| 9338 | |
| 9339 | static void ShowExampleAppImageViewer(bool* p_open) |
| 9340 | { |
| 9341 | ImFontAtlas* atlas = ImGui::GetIO().Fonts; |
| 9342 | ImTextureRef tex_ref = atlas->TexRef; // We don't have access to other textures in this demo! |
| 9343 | int tex_w = atlas->TexData->Width; |
| 9344 | int tex_h = atlas->TexData->Height; |
| 9345 | if (ImGui::Begin("Example: Image Viewer", p_open)) |
| 9346 | { |
| 9347 | static ExampleImageViewerData image_viewer; |
| 9348 | ExampleImageViewer_DrawOptions(&image_viewer); |
| 9349 | ImVec2 canvas_size = ImGui::GetContentRegionAvail(); |
| 9350 | ImVec2 canvas_min_size = ImGui::IsWindowAppearing() ? ImVec2(3.0f * tex_w, 4.0f * tex_h) : ImVec2(1.0f, 1.0f); |
| 9351 | canvas_size = ImVec2(IM_MAX(canvas_size.x, canvas_min_size.x), IM_MAX(canvas_size.y, canvas_min_size.y)); |
| 9352 | ExampleImageViewer_DrawCanvas(&image_viewer, canvas_size, tex_ref, tex_w, tex_h); |
| 9353 | } |
| 9354 | ImGui::End(); |
| 9355 | } |
| 9356 | |
| 9357 | //----------------------------------------------------------------------------- |
| 9358 | // [SECTION] Example App: Debug Log / ShowExampleAppLog() |
no test coverage detected