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).
1 int cursorX, cursorY; 2 ubyte mouseButtons; 3 int mouseScroll; 4 5 /// start a new batch of commands for this frame (the batched commands) 6 imguiBeginFrame(cursorX, cursorY, mouseButtons, mouseScroll); 7 8 /// define your UI elements here 9 imguiLabel("some text here"); 10 11 /// end the frame (this just resets the input control state, e.g. mouse button states) 12 imguiEndFrame(); 13 14 /// now render the batched commands 15 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.