Removed Microsoft IME handler in examples, too confusing. Moved to imgui.cpp instruction block.

This commit is contained in:
ocornut
2014-11-30 15:54:58 +00:00
parent a5a84a9b69
commit 0f29cd7a14
4 changed files with 29 additions and 60 deletions

View File

@ -1,5 +1,4 @@
#include <windows.h>
#include <imm.h>
#define STB_IMAGE_IMPLEMENTATION
#include "../shared/stb_image.h" // for .png loading
#include "../../imgui.h"
@ -344,19 +343,6 @@ LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(hWnd, msg, wParam, lParam);
}
// Notify OS Input Method Editor of text input position (e.g. when using Japanese/Chinese inputs, otherwise this isn't needed)
static void ImImpl_ImeSetInputScreenPosFn(int x, int y)
{
if (HIMC himc = ImmGetContext(hWnd))
{
COMPOSITIONFORM cf;
cf.ptCurrentPos.x = x;
cf.ptCurrentPos.y = y;
cf.dwStyle = CFS_FORCE_POSITION;
ImmSetCompositionWindow(himc, &cf);
}
}
void InitImGui()
{
RECT rect;
@ -385,7 +371,6 @@ void InitImGui()
io.KeyMap[ImGuiKey_Z] = 'Z';
io.RenderDrawListsFn = ImImpl_RenderDrawLists;
io.ImeSetInputScreenPosFn = ImImpl_ImeSetInputScreenPosFn;
// Create the vertex buffer
{