mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 12:08:47 +02:00
Removed Microsoft IME handler in examples, too confusing. Moved to imgui.cpp instruction block.
This commit is contained in:
@ -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
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include <windows.h>
|
||||
#include <imm.h>
|
||||
#include "../../imgui.h"
|
||||
|
||||
// DirectX
|
||||
@ -175,19 +174,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;
|
||||
@ -216,7 +202,6 @@ void InitImGui()
|
||||
io.KeyMap[ImGuiKey_Z] = 'Z';
|
||||
|
||||
io.RenderDrawListsFn = ImImpl_RenderDrawLists;
|
||||
io.ImeSetInputScreenPosFn = ImImpl_ImeSetInputScreenPosFn;
|
||||
|
||||
// Create the vertex buffer
|
||||
if (g_pd3dDevice->CreateVertexBuffer(10000 * sizeof(CUSTOMVERTEX), D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, D3DFVF_CUSTOMVERTEX, D3DPOOL_DEFAULT, &g_pVB, NULL) < 0)
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
|
||||
#include <Windows.h>
|
||||
#include <Imm.h>
|
||||
#endif
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
#include "../shared/stb_image.h" // for .png loading
|
||||
@ -100,22 +99,6 @@ static void ImImpl_SetClipboardTextFn(const char* text)
|
||||
glfwSetClipboardString(window, text);
|
||||
}
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// 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)
|
||||
{
|
||||
HWND hwnd = glfwGetWin32Window(window);
|
||||
if (HIMC himc = ImmGetContext(hwnd))
|
||||
{
|
||||
COMPOSITIONFORM cf;
|
||||
cf.ptCurrentPos.x = x;
|
||||
cf.ptCurrentPos.y = y;
|
||||
cf.dwStyle = CFS_FORCE_POSITION;
|
||||
ImmSetCompositionWindow(himc, &cf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// GLFW callbacks to get events
|
||||
static void glfw_error_callback(int error, const char* description)
|
||||
{
|
||||
@ -204,9 +187,6 @@ void InitImGui()
|
||||
io.RenderDrawListsFn = ImImpl_RenderDrawLists;
|
||||
io.SetClipboardTextFn = ImImpl_SetClipboardTextFn;
|
||||
io.GetClipboardTextFn = ImImpl_GetClipboardTextFn;
|
||||
#ifdef _MSC_VER
|
||||
io.ImeSetInputScreenPosFn = ImImpl_ImeSetInputScreenPosFn;
|
||||
#endif
|
||||
|
||||
// Load font texture
|
||||
glGenTextures(1, &fontTex);
|
||||
|
Reference in New Issue
Block a user