18 #define IMGUI_DEFINE_MATH_OPERATORS
71 void init(
const string& configPath)
override;
88 void drawMouseCursor(
bool doDraw)
override { ImGui::GetIO().MouseDrawCursor = doDraw; }
static SLint mouseX
Last mouse position x in pixels.
static SLint mouseY
Last mouse position y in pixels.
static SLint dpi
Dot per inch resolution of screen.
SLMouseButton
Mouse button codes.
SLKey
Keyboard key codes enumeration.
void(SL_STDCALL * cbOnImGuiSaveConfig)()
Callback function typedef for ImGui save config function.
void(SL_STDCALL * cbOnImGuiLoadConfig)(int dpi)
Callback function typedef for ImGui load config function.
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
ImGui Interface class for forwarding all events to the original ImGui Handlers.
void onKeyRelease(SLKey key, SLKey mod) override
Callback on key release event.
bool doNotDispatchKeyboard() override
inform if user keyboard input was consumed by the ui
void onMouseDown(SLMouseButton button, SLint x, SLint y) override
Callback on mouse button down event.
void deleteOpenGLObjects()
SLIOBuffer _fontDataFixed
Raw data of fixed size font file.
void loadFonts(SLfloat fontPropDots, SLfloat fontFixedDots)
Loads the proportional and fixed size font depending on the passed DPI.
void onMouseWheel(SLfloat yoffset) override
Callback for the mouse scroll movement.
static SLfloat fontPropDots
Default font size of proportional font.
SLfloat _timeSec
Time in seconds.
void onPaint(const SLRecti &viewport) override
Callback for main rendering for the ImGui GUI system.
SLbool _mousePressed[3]
Mouse button press state.
void onCharInput(SLuint c) override
Callback on character input.
void onMouseUp(SLMouseButton button, SLint x, SLint y) override
Callback on mouse button up event.
void printCompileErrors(SLint shaderHandle, const SLchar *src)
Prints the compile errors in case of a GLSL compile failure.
void onMouseMove(SLint xPos, SLint yPos) override
Updates the mouse cursor position.
bool doNotDispatchMouse() override
inform if user mouse input was consumed by the ui
void onKeyPress(SLKey key, SLKey mod) override
Callback on key press event.
SLfloat _fontFixedDots
Active font size of fixed size font.
SLfloat _mouseWheel
Mouse wheel position.
SLstring _configPath
Path to config files.
void createOpenGLObjects()
void init(const string &configPath) override
Initializes OpenGL handles to zero and sets the ImGui key map.
void onClose() override
Callback on closing the application.
void onResize(const SLRecti &viewport) override
Callback if window got resized.
void drawMouseCursor(bool doDraw) override
Turns on or off the mouse cursor drawing.
SLfloat _fontPropDots
Active font size of proportional font.
SLIOBuffer _fontDataProp
Raw data of proportional font file.
SLVec2f _mousePosPX
Mouse cursor position.
static SLfloat fontFixedDots
Default font size of fixed size font.
void onInitNewFrame(SLScene *s, SLSceneView *sv) override
Inits a new frame for the ImGui system.
void renderExtraFrame(SLScene *s, SLSceneView *sv, SLint mouseX, SLint mouseY) override
Renders an extra frame with the current mouse position.
cbOnImGuiSaveConfig _saveConfig
SLImGui(cbOnImGuiBuild buildCB, cbOnImGuiLoadConfig loadConfigCB, cbOnImGuiSaveConfig saveConfigCB, int dpi, SLIOBuffer fontDataProp, SLIOBuffer fontDataFixed)
The SLScene class represents the top level instance holding the scene structure.
SceneView class represents a dynamic real time 3D view onto the scene.
Interface for ui integration in SLSceneView.
Utility struct that holds a pointer and its length.