The cursor's last X position.
The cursor's last Y position.
The last mouse buttons pressed (a value or a combination of values of a MouseButton).
The last scroll value emitted by the mouse.
Unicode text input from the keyboard (usually the unicode result of last keypress). '0' means 'no text input'. Note that for text input to work, even Enter and backspace must be passed (encoded as 0x0D and 0x08, respectively), which may not be automatically handled by your input library's text input functionality (e.g. GLFW's getUnicode() does not do this).
int cursorX, cursorY; ubyte mouseButtons; int mouseScroll; /// start a new batch of commands for this frame (the batched commands) imguiBeginFrame(cursorX, cursorY, mouseButtons, mouseScroll); /// define your UI elements here imguiLabel("some text here"); /// end the frame (this just resets the input control state, e.g. mouse button states) imguiEndFrame(); /// now render the batched commands imguiRender();
Begin a new frame. All batched commands after the call to imguiBeginFrame will be rendered as a single frame once imguiRender is called.
Note: You should call imguiEndFrame after batching all commands to reset the input handling for the next frame.