2025-08-18 22:39:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
2025-09-13 14:49:59 +02:00
|
|
|
#include <cstddef>
|
2025-08-18 22:39:43 +00:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
#include "AppGLFW.hpp"
|
|
|
|
|
#include "imgui.h"
|
2025-09-13 14:49:59 +02:00
|
|
|
#include "rendering/RenderImageManager.hpp"
|
2025-08-18 22:39:43 +00:00
|
|
|
#include "resources/resource.hpp"
|
|
|
|
|
#include "utilities/ILog.hpp"
|
|
|
|
|
|
|
|
|
|
namespace pixelarium::ui
|
|
|
|
|
{
|
2025-09-26 21:09:51 +02:00
|
|
|
/// @brief Default implementation of AppGLFW.
|
|
|
|
|
/// This can either be used as is, as an example or as a base class
|
|
|
|
|
/// providing some defaults for a more custom implementation.
|
2025-09-22 23:13:28 +02:00
|
|
|
class DefaultApp : public application::AppGLFW
|
2025-08-18 22:39:43 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2025-09-22 23:13:28 +02:00
|
|
|
DefaultApp(const utils::log::ILog& log, pixelarium::resources::ImageResourcePool& pool)
|
2025-09-13 14:49:59 +02:00
|
|
|
: application::AppGLFW(log),
|
|
|
|
|
pool_(pool),
|
|
|
|
|
render_manager_(std::make_unique<render::RenderImageManager>(pool, log))
|
2025-08-18 22:39:43 +00:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void MenuBarOptionsColumn1() override;
|
|
|
|
|
void MenuBarOptionsColumn2() override;
|
|
|
|
|
void Run() override;
|
|
|
|
|
|
|
|
|
|
private:
|
2025-09-22 23:13:28 +02:00
|
|
|
void LoadImage();
|
2025-08-18 22:39:43 +00:00
|
|
|
void ImageGalleryRender();
|
2025-09-13 14:49:59 +02:00
|
|
|
void RenderImages();
|
2025-08-18 22:39:43 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
resources::ImageResourcePool& pool_;
|
2025-09-13 14:49:59 +02:00
|
|
|
std::unique_ptr<render::RenderImageManager> render_manager_;
|
|
|
|
|
bool image_listp_{true};
|
|
|
|
|
bool auto_show_selectd_image_{true};
|
2025-08-18 22:39:43 +00:00
|
|
|
bool demop_{false};
|
|
|
|
|
ImVec2 curr_dim_;
|
2025-09-13 14:49:59 +02:00
|
|
|
size_t selected_image_{0};
|
2025-08-18 22:39:43 +00:00
|
|
|
};
|
|
|
|
|
} // namespace pixelarium::ui
|