-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add support for SDL 2.0 #173
Comments
Updated original post to clarify the origin of this issue. |
Currrently Torque2D 3.0 does not even build in Linux although it's claimed that it works for Linux. |
Unfortunately I wasn't able to get a keybinding fix in place for the 3.0 release. The X11_KeyToUnicode function is only available in the older SDL 1.2 releases (even though it shouldn't have been used at all). SDL 1.3 is essentially the pre-release of 2.0, which has an entirely different interface. I believe @Syrup84 meant to say SDL 1.2. Let me know if you have any other problems. Extra details such as which compiler, architecture, kernel/distro version and graphics driver/card are also appreciated! |
So how do we build Torque in Linux? Sorry to hijack this bug report but it seems to be related. |
Build guide is available on the wiki: https://github.com/GarageGames/Torque2D/wiki/Linux-Development-Guide If anything in the guide is unclear, needs correcting, etc, please let me know either via the T2D forums or by opening up a new issue. |
Well that guide doesn't mention "X11_KeyToUnicode" issue. |
Could you provide more information about your environment? SDL 1.2 is the only supported version. I am currently linking against SDL 1.2.5. Here's the change in libSDL for the fix that was made two years ago: https://hg.libsdl.org/SDL/rev/900a0fae90ca |
I'm on Arch linux with SDL 1.2.15. SDL 1.2.5 is very old (2002-2003?) and on any modern linux distro, you EDIT: I've looked at 1.2.15 source (SDL_x11events.c to be exact) and I don't see that X11_KetToUnicode() is exported as a library function. EDIT2: Turns out that patch was commited after 1.2.15 release of SDL which is the latest official release. On 6 May 2014 02:25, "Cameron Porter" [email protected] wrote:
|
Same here. It seems Ubuntu people patched this themselves: Unless they mean Linux support only means Ubuntu, they should indeed either fix it or remove the claim. |
On a side note, why not get rid of all the platform specific code?
For the web, we can keep using emscripten. |
I've dusted off the SDL2 code that I have, most of the input code is working, window handling and rendering are working as well. Just have to rip out the remaining Xlib junk, then try to make the whole thing more intelligible and try to document what's going on as well. At the time of testing for T2D 3.0, we didn't have anyone on other distributions to test, so unfortunately the missing symbol was never noticed (except by the nag message built in with having used it). If you can't wait for SDL2 support, you have a few options:
If I make good progress this weekend, the PR could be up as well. |
Torque 3D also has Linux using SDL2, not sure if it is worth looking at any of their platform code: https://github.com/BeamNG/Torque3D/tree/dev_linux_opengl
The idea is good, I'm guessing the amount of work to get there has kept anyone from attempting this yet. |
@camporter Instead I've sent the patch to my distro's bugzilla and now it's fixed (https://bugs.archlinux.org/task/40292) @lilligreen I'm guessing once the switch is done from SDL-1.2 to 2.0 for linux, it shouldn't be that much work to make it run in other platforms. |
Here is my initial commit for SDL2: camporter@94ed1af Not that this is still being tested, and keyboard input is currently broken. Extra window shows up because I'm not yet saving a ref to the SDL_Window. That will be the next task. |
@camporter That's some work! I can't wait to see it finished. |
Any updates on when we can have SDL 2.0 support? |
The first release of Linux platform support introduced SDL 1.3 to the engine. While functional, it limits features and is "ugly" according to the author. Implementing SDL 2.0 would fix some issues and be far prettier. A question that popped up was whether SDL 2.0 should be implemented across all platforms. The author suggested it would be helpful, but not a high priority.
T2D Linux First Release Blog: http://www.garagegames.com/community/blog/view/22545/1
Comment on SDL 2.0: http://www.garagegames.com/community/blogs/view/22545/1#comment-195505
The text was updated successfully, but these errors were encountered: