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
Replacing SDL1.2 with SDL2.0 #1246
Conversation
@@ -9,3 +9,4 @@ scripts/work/ | |||
/SDL.dll | |||
/freetype.dll | |||
/autoexec.cfg | |||
*~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here (;
Thanks for the pull request! Looks pretty good (: |
|
On Mac OS X is glu.h located at OpenGL/glu.h (sry forgot to mention the OS) Edit: |
I see some 'screen' stuff, does this implement some kind of support for multiple monitors? |
The About the wrong window boundaries: |
Woops, makes sense.
Does fullscreen work? |
Any news? Does it work now on Linux, Windows and Mac OSX? |
Tested on windows, looks good. |
This is probably ready to merge. |
On OS X I'm getting some errors like You are sometimes using '""' and sometimes '<>' for the includes of SDL, this should be unified... In src/engine/client/backend_sdl.cpp we need If all the things a mentioned are fixed, it compiles on OS X. When starting (in Fullscreen mode) after the game is loaded and we are in the menu, the curser is locked in the upper left corner. Once the console or the remote console has been opened (f1, f2), I can move the cursor. Aside from that, everything seems to work fine. I will do some more testing tomorrow. |
This is familiar :) |
you forgot one SDL2/SDL.h in src/engine/client/client.cpp |
The whole keyboard handling seems broken. It seemingly randomly registers keys which were not pressed. |
SDL2 is one of the solutions for asia players' communication issue (but only in Windows). SDL2 is fully compatible with Windows IME (but need to be modified to compatible with candidates feature). For linux, SDL2 doesn't support every input method for Chinese or Japanese or some other language (e.g. Fcitx can send chinese Unicode characters as a keycode which can type chinese in SDL1, but it is broken with SDL2. SDL2 can be compatible by IME, but it can not just compatible with IME.) SDL2 provided a function that draws candidates list on SDL2 surface. But can not used by OpenGL function in SDL2. I tried to combined two drawing engine, but it can not work as I thought. Still, there ARE full functions with Windows IME just modified the event part of SDL2. I haven't done this thing because I got problems on compiling SDL2 source code, and I'm waiting this pull for further modify in Teeworlds. |
Libsdl2 is also requirement for much easier porting onto ios. |
If someone wants to test it, a more up-to-date version of swick's code can be found here: heinrich5991/teeworlds/sdl2_test. Please report bugs in this thread! |
Bugs I have on Linux with xmonad window manager:
|
This branch contains minimal changes to replace SDL1.2 with SDL2.0. It should behave exactly like the older version except for internal changes in SDL2.
SDL touches many parts of the system and is important for a user therefor it should be tested thoroughly. Testing, comments and patches welcome.
Known Bugs:
mouse input lags: I didn't touch the mouse movement code at all, will investigate further