// Statically allocated font atlas. This is merely a maneuver to keep its definition at the bottom of the .H file.
// Because we cannot new() at this point (before users may define IO.MemAllocFn)
// Statically allocated font atlas. This is merely a maneuver to keep ImFontAtlas definition at the bottom of the .h file (otherwise it'd be inside ImGuiIO)
// Also we wouldn't be able to new() one at this point, before users may define IO.MemAllocFn.
staticImFontAtlasGDefaultFontAtlas;
ImGuiIO::ImGuiIO()
@ -564,7 +565,7 @@ ImGuiIO::ImGuiIO()
// Pass in translated ASCII characters for text input.
// - with glfw you can get those from the callback set in glfwSetCharCallback()
// - on Windows you can get those using ToAscii+keyboard state, or via the VM_CHAR message
// - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message
voidImGuiIO::AddInputCharacter(ImWcharc)
{
constsize_tn=ImStrlenW(InputCharacters);
@ -590,7 +591,7 @@ const float PI = 3.14159265358979323846f;
#define IM_INT_MAX 2147483647
#endif
// Play it nice with Windows users. Notepad in 2014 still doesn't display text data with Unix-style \n.
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
io.ImeSetInputScreenPosFn((int)cursor_pos.x-1,(int)(cursor_pos.y-window->FontSize()));// -1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.
// Optional: access OS clipboard (default to use native Win32 clipboard on Windows, otherwise use a ImGui private clipboard)
// Override to access OS clipboard on other architectures.
// Optional: access OS clipboard
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
constchar*(*GetClipboardTextFn)();
void(*SetClipboardTextFn)(constchar*text);
@ -565,7 +565,7 @@ struct ImGuiIO
void*(*MemAllocFn)(size_tsz);
void(*MemFreeFn)(void*ptr);
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese inputs in Windows)
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows)
ImVec2MousePos;// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
boolMouseDown[5];// Mouse buttons. ImGui itself only uses button 0 (left button) but you can use others as storage for convenience.
boolMouseDown[5];// Mouse buttons. ImGui itself only uses button 0 (left button). Others buttons allows to track if mouse is being used by your application + available to user as a convenience via IsMouse** API.
floatMouseWheel;// Mouse wheel: 1 unit scrolls about 5 lines text.
boolMouseDrawCursor;// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
boolKeyCtrl;// Keyboard modifier pressed: Control
boolKeyShift;// Keyboard modifier pressed: Shift
boolKeysDown[512];// Keyboard keys that are pressed (in whatever order user naturally has access to keyboard data)
boolKeysDown[512];// Keyboard keys that are pressed (in whatever storage order you naturally have access to keyboard data)
ImWcharInputCharacters[16+1];// List of characters input (translated by user from keypress+keyboard state). Fill using AddInputCharacter() helper.
// Function
@ -596,7 +596,7 @@ struct ImGuiIO
// [Internal] ImGui will maintain those fields for you
// Typically, 1 command = 1 gpu draw call (unless command is a callback)
structImDrawCmd
{
unsignedintvtx_count;// Number of vertices (multiple of 3) to be drawn as triangles. The vertices are stored in the callee ImDrawList's vtx_buffer[] array.