imguiBeginFrame

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.

void
imguiBeginFrame
(,,,,
dchar unicodeChar = 0
)

Parameters

cursorX int

The cursor's last X position.

cursorY int

The cursor's last Y position.

mouseButtons ubyte

The last mouse buttons pressed (a value or a combination of values of a MouseButton).

mouseScroll int

The last scroll value emitted by the mouse.

unicodeChar dchar

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).

Examples

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();

Meta