-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
SDL3 Support #182
Comments
It is definitely planned once SDL3 is released, but I'm not sure if I can keep it supported during its development. Edit: It looks like many functions have already been renamed, so I guess the biggest changes that affect TGUI have already been done. I'll try to have a look soon for making the code compatible with both SDL2 and SDL3.
This will be tricky for me to solve, because I don't have access to any Apple devices myself. |
Sounds great.
It seems to be an Issue with SDL2. I had the same problem with my Mac.
But that isn't working for iOS. Edit: |
The SDL touch event provides values between 0 and 1, and TGUI is multiplying this with the window size. Since the logical and physical window size are different on high-DPI screens, I'm probably just multiplying with the wrong number. I'm currently multiplying While that would explain the wrong scaling of touch events, I don't understand how your fix for macOS would work, so maybe the issue is still more complex than this. |
I can try to adjust that in BackendGuiSDL, but I think using SDL_GetWindowSize is correct. SDL_GetWindowSize should return points instead of pixels. |
Okay it works correctly (even without SDL_RenderSetLogicalSize mentioned in #182 (comment)) if I change SDL_GetWindowSize to SDL_GetWindowSizeInPixels in BackendGuiSDL.cpp:
Edit: |
Great, I'll update the code with a similar change later today so that the touch events will work out of the box on iOS. If you are willing to help figure out why the macOS workaround is needed, I have a few more questions:
|
Sure
The drawing is correct - just the mouse hit and mouse hover is incorrect.
Yes
there is no difference
on macOS I found: on iOS I found: Edit: Edit2: |
I didn't realize earlier that on macOS you would be using mouse events instead of touch events, that is the difference between the macOS and iOS issues. The mouse positions apparently need to be scaled. I didn't understand why it would be different on macOS and Windows, so I booted up my Windows, messed with the scaling, and found that the mouse positions where broken there as well. I've committed a change (1b24db4) that should fix the touch events on iOS and fixes the mouse positions on my Windows with high-DPI. So you should check if it also fixes the issue on macOS. |
Okay now it works without the workaround! Thanks alot! |
… choose the version if both SDL2 and SDL3 exist) (#182)
Hey,
thanks for this great Library.
Is there Support for SDL3 planned?
I have some trouble to get the high dpi setup correctly for iOS (touch points are offset).
The text was updated successfully, but these errors were encountered: