19 #define IMGUI_DEFINE_MATH_OPERATORS
72 void init(
const string& configPath)
override;
90 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 ImGui Handlers.
void loadFonts(SLfloat fontPropDots, SLfloat fontFixedDots)
Loads the proportional and fixed size font depending on the passed DPI.
void printCompileErrors(SLint shaderHandle, const SLchar *src)
Prints the compile errors in case of a GLSL compile failure.
void onInitNewFrame(SLScene *s, SLSceneView *sv) override
Inits a new frame for the ImGui system.
void onMouseDown(SLMouseButton button, SLint x, SLint y) override
Callback on mouse button down event.
static SLfloat fontFixedDots
Default font size of fixed size font.
void onPaint(const SLRecti &viewport) override
Callback for main rendering for the ImGui GUI system.
SLint _attribLocProjMtx
OpenGL attribute location for ???
static SLfloat fontPropDots
Default font size of proportional font.
void init(const string &configPath) override
Initializes OpenGL handles to zero and sets the ImGui key map.
SLint _attribLocUV
OpenGL attribute location for texture coords.
void onClose() override
Callback on closing the application.
SLuint _elementsHandle
OpenGL handle for vertex indexes.
void onCharInput(SLuint c) override
Callback on character input.
void renderExtraFrame(SLScene *s, SLSceneView *sv, SLint mouseX, SLint mouseY) override
Renders an extra frame with the current mouse position.
SLint _progHandle
OpenGL handle for shader program.
SLIOBuffer _fontDataProp
Raw data of proportional font file.
SLuint _vboHandle
OpenGL handle for vertex buffer object.
SLVec2f _mousePosPX
Mouse cursor position.
SLfloat _fontFixedDots
Active font size of fixed size font.
void onMouseWheel(SLfloat yoffset) override
Callback for the mouse scroll movement.
SLIOBuffer _fontDataFixed
Raw data of fixed size font file.
void onResize(const SLRecti &viewportRect) override
Callback if window got resized.
SLint _attribLocPosition
OpenGL attribute location for vertex pos.
SLint _fragHandle
OpenGL handle for fragment shader.
SLbool _mousePressed[3]
Mouse button press state.
SLstring _configPath
Path to config files.
void onMouseMove(SLint xPos, SLint yPos) override
Updates the mouse cursor position.
SLint _vertHandle
OpenGL handle for vertex shader.
void drawMouseCursor(bool doDraw) override
Turns on or off the mouse cursor drawing.
void onKeyRelease(SLKey key, SLKey mod) override
Callback on key release event.
SLfloat _mouseWheel
Mouse wheel position.
bool doNotDispatchMouse() override
inform if user mouse input was consumed by the ui
SLfloat _fontPropDots
Active font size of proportional font.
void onMouseUp(SLMouseButton button, SLint x, SLint y) override
Callback on mouse button up event.
SLint _attribLocColor
OpenGL attribute location for color.
cbOnImGuiSaveConfig _saveConfig
bool doNotDispatchKeyboard() override
inform if user keyboard input was consumed by the ui
SLfloat _timeSec
Time in seconds.
void deleteOpenGLObjects()
Deletes all OpenGL objects for drawing the imGui.
void onKeyPress(SLKey key, SLKey mod) override
Callback on key press event.
void createOpenGLObjects()
Creates all OpenGL objects for drawing the imGui.
SLGLImGui(cbOnImGuiBuild buildCB, cbOnImGuiLoadConfig loadConfigCB, cbOnImGuiSaveConfig saveConfigCB, int dpi, SLIOBuffer fontDataProp, SLIOBuffer fontDataFixed)
SLint _attribLocTex
OpenGL attribute location for texture.
SLuint _vaoHandle
OpenGL vertex array object handle.
SLuint _fontTexture
OpenGL texture id for font.
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.