10#ifndef EASY3D_TUTORIAL_VIEWER_IMGUI_H
11#define EASY3D_TUTORIAL_VIEWER_IMGUI_H
14#include <easy3d/viewer/viewer.h>
52 const std::string& title =
"Easy3D ViewerImGui",
56 bool full_screen =
false,
57 bool resizable =
true,
An Easy3D viewer with ImGui GUI support for custom rendering and input.
Definition viewer_imgui.h:33
void init() override
Initializes ImGui and binds it to the OpenGL and GLFW context.
bool callback_event_character(unsigned int codepoint) override
Handles character input events.
float widget_scaling()
Calculates the widget scaling factor.
Definition viewer_imgui.h:152
void pre_draw() override
Called before rendering the scene.
float pixel_ratio()
Computes the pixel ratio between framebuffer and window size.
void post_resize(int w, int h) override
Handles window resize events.
static ImGuiContext * context_
Global ImGui context shared across all viewer instances.
Definition viewer_imgui.h:169
bool callback_event_cursor_pos(double x, double y) override
Handles mouse movement.
ViewerImGui(const std::string &title="Easy3D ViewerImGui", int samples=4, int gl_major=3, int gl_minor=2, bool full_screen=false, bool resizable=true, int depth_bits=24, int stencil_bits=8, int width=800, int height=600)
Constructor for ViewerImGui.
bool callback_event_scroll(double dx, double dy) override
Handles mouse scroll events.
void draw_menu_file()
Draws the "File" menu in the main menu bar.
bool callback_event_keyboard(int key, int action, int modifiers) override
Handles keyboard key events.
void post_draw() override
Called after rendering the scene.
void reload_font(int font_size=16)
Reloads the ImGui font at a given font size.
void draw_menu_view()
Draws the "View" menu in the main menu bar.
float menu_height_
Height of the menu bar, used for adjusting overlay positions.
Definition viewer_imgui.h:173
~ViewerImGui() override
Destructor. Cleans up ImGui and OpenGL resources.
bool callback_event_mouse_button(int button, int action, int modifiers) override
Handles mouse button events.
Namespace for Easy3D rendering and geometry types.