Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_SetTextInputArea (in ImGui 1.90.9) no longer available >>> SDL_SetTextInputRect #7775

Closed
NostraMagister opened this issue Jul 7, 2024 · 3 comments
Labels

Comments

@NostraMagister
Copy link

NostraMagister commented Jul 7, 2024

Version/Branch of Dear ImGui:

Version 1.90.9 master

Back-ends:

imgui_impl_SDL3.cpp + imgui_impl_Vulkan.cpp

Compiler, OS:

Windows 11 MSVC, Linux GNU

Full config/build information:

Occurred with C/C++ MSVC 2022 (last update) and SDL version 3.1.2 (github master)

Details:

The SDL_SetTextInputArea() function that should be in SDL_keyboard.h (according https://wiki.libsdl.org/SDL3/SDL_SetTextInputArea) seems no longer to be there.

error C3861: 'SDL_SetTextInputArea': identifier not found

Occurs in ImGui_ImplSDL3_PlatformSetImeData() function, line 143: SDL_SetTextInputArea(window, &r, 0);
file: imgui_impl_sdl3.cpp

All other SDL functions compile.

I think this is an SDL ABI break (wanted, not by error).
The closest I could find to a replacement is SDL_SetTextInputRect(window, &r); (see https://wiki.libsdl.org/SDL3/SDL_SetTextInputRect)

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

Easily reproducible because the error is consistently there at the same line.
For confirmation, just remark the above mentioned line and everything builds fine.

@NostraMagister NostraMagister changed the title SDL_SetTextInputArea no longer available. SDL_SetTextInputRect SDL_SetTextInputArea (in ImGui 1.90.9) no longer available >>> SDL_SetTextInputRect Jul 7, 2024
@ocornut
Copy link
Owner

ocornut commented Jul 7, 2024

Hello,
This is already fixed in latest:
ccf3ee6

@NostraMagister
Copy link
Author

Changelog says: 2024-07-01: Update for SDL3 api changes: SDL_SetTextInputRect() changed to SDL_SetTextInputArea().

IMO, it should be the reverse: SDL_SetTextInputArea changed to SDL_SetTextInputRect()

I checked the code again (JULY 11) and it still uses SDL_SetTextInputArea() in the current master and docking branch of 1.90.9.

If its me that do not understand it, just leave it because as I said in OP i changed it myself to SDL_SetTextInputRect() in the SDL3 backend and it all works.

grtz

@ocornut
Copy link
Owner

ocornut commented Jul 11, 2024

The function in SDL3 latest is called SDL_SetTextInputArea() and the code in imgui latest calls SDL_SetTextInputArea().

https://github.com/ocornut/imgui/blob/master/backends/imgui_impl_sdl3.cpp

There is no SDL_SetTextInputRect() currently in SDL3.
SDL3 is a fast moving and instable target, if you use it you must use latest.

https://github.com/libsdl-org/SDL/blob/875c4f0a4ce2003ee64db6218526664fb718d618/docs/README-migration.md?plain=1#L922
* SDL_SetTextInputRect() - replaced with SDL_SetTextInputArea()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants