sorry to ressurect old topic,
i am having exactly the same problem.
window with IME candidates in not showing for me.
This is my simple sample code, mostly taken from https://wiki.libsdl.org/Tutorials/TextInput
int main(int argc, char* argv[])
{
auto utf8_decode = [](const std::string &str) -> std::wstring
{
if (str.empty()) return std::wstring();
int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
std::wstring wstrTo(size_needed, 0);
MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], size_needed);
return wstrTo;
};
SDL_bool done = SDL_FALSE;
SDL_Window* window = SDL_CreateWindow( "hello_sdl2", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN );
SDL_Rect r;
r.x = 0;
r.y = 0;
SDL_SetTextInputRect(&r);
SDL_StartTextInput();
while (!done) {
SDL_Event event;
if (SDL_PollEvent(&event)) {
case SDL_QUIT:
/* Quit */
done = SDL_TRUE;
break;
case SDL_TEXTINPUT:
{
/* Add new text onto the end of our text */
std::string utf8str(event.text.text);
std::wstring utf16str = utf8_decode(utf8str);
OutputDebugStringW(utf16str.c_str());
break;
}
case SDL_TEXTEDITING:
break;
}
}
}
SDL_StopTextInput();
SDL_Quit();
return 0;
}
I also tested setting different positions for SDL_SetTextInputRect() but none of them worked for me.
I am using SDL 2.0.9
I am using SDL 2.0.9 on Windows10 x64 with VS2017.
The traditional desktop IME works well with SDL 2.0.9.
But some new IME,such as some Windows10 built-in IME,doesn’t show the candidates or even no response.
I’m using SDL2.0.10 on windows 10 and I have the same issue that input candidates don’t show up. I have tried building the library by myself but no luck.