Linux - phase out SDL

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
FernetMenta Offline
Team-Kodi Developer
Posts: 3,656
Joined: Jul 2010
Reputation: 70
Location: Munich
Post: #1
Problem:
SDL_SetVideoMode does not work if screen was rotated left/right. It matches given width/height with non rotated video modes and refuses to set correct dimensions for rotated screen.

Solution:
Phase out SDL_SetVideoMode

SDL acually opens 3 windows, one for fullscreen, one for windowed mode, and the actual drawing window. Then creates an OpenGL context which we don't use in XBMC. I am no aware of any reason why we should follow this approach. A single window should do as well, then changing window attributes when changing between fullscreen and windowed mode. Do I miss something here?

Implication:
The SDL event system only works when the video system is used. This means WinEventsSDL has to be substituted as well. I have tried WinEventsLinux already but it does not find a sing input device on Ubuntu 12.04
- What I am doing wrong?
- How would this work in windowed mode if XBMC does not have focus?
find quote
davilla Offline
Retired-Team-XBMC Developer
Posts: 11,508
Joined: Feb 2008
Reputation: 64
Post: #2
WinEventsLinux is designed for embedded boxes when you own everything, it's going to be problematic under desktop where the window system (x11 or whatever) owns them.

What really needs to happen is to extract the code from SDL that handles events and windowing and implement it as a new WinEventsXXX and change WinSystemX11 for direct x11 communication. Then you can ditch sdl.


MediaInfo : http://mediainfo.sourceforge.net/
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
find quote
theuni Offline
Team-XBMC Communication Manager
Posts: 1,105
Joined: Oct 2007
Reputation: 2
Location: Atlanta, Ga, USA
Post: #3
I think for the desktop, an evdev manager (WinEventsEVdev) is probably the way to go, rather than messing with stuff at such a low level.
find quote
FernetMenta Offline
Team-Kodi Developer
Posts: 3,656
Joined: Jul 2010
Reputation: 70
Location: Munich
Post: #4
I have studied some code:

SDL makes use of XEvents and XutfLookupString. Then transforms the string to unicode and sends an event for each unicode. On the last one it sends keysym.
This sounds very reasonable to me. We only get the events targeted to our window. I would keep this strategy and put it in a WinEventsX11

On Linux (not Apple) we call SymFromScancode (WinEventsSDL) if SDL has not found a keysym.
This does not look right to me. Don't we want to map Xkeysyms to XBMCkeysyms? E.g. a user has mapped some key to XF86AudioLowerVolume we substitute this keysym with XBMCK_VOLUME_DOWN in order to get desired behavior. This would require a SubstKeySym for X11.

Joystick:
If possible I would keep SDL for Joysticks in this iteration.
find quote