Skip to content

SDL 2.0 and Platform Rework

Jeff Makey edited this page Aug 13, 2013 · 1 revision

SDL 2.0

SDL 2.0 has been released and we should look into using it. At the same time it would be good to split up platform into more granular chunks such as Video, Audio, Input, Joystick, and Web so that we can componentize. Probably also want to add a new Threading platform lib that we can tie to SDL if we need.

By breaking it up we can have everyone use SDL for at least video and get multi-head, and windows and other other platforms do joystick and stuff for force feedback.

Video

Make the platform support multiple displays and the rendering system take options for each display

  • Camera offset (position and rotation)
  • Flag for if the display shows the radar or not ( secondary screens can allow fullscreen radar)

Audio

Move the 3d audio processing out of client and into platform, BZFlagAudioSDL can then do what we used to do and we can make a new platform class based on OpenAL that does the 3d math in the lib/hardware.

Input

This is basic mouse and keyboard stuff, map it right into SDL.

Joystick

Sticks are fancy so give them there own platform API. the client uses the provided methods to pick what input to use at game time. The API also should expose the force feedback stuff.

Web

This just does DNS and HTTP stuff, it's a separate lib so that it can be used by the server. It is a platform lib so that we can provide use native libs on OSs that provide them (windows, OSX) and remove the need for curl and ares from src/other

#Threading We need to do more with threading and SDL 2.0 provides a threading component, so we should wrap that up. Platforms can provide a native implementation if they need (like if windows goes mixed mode)

Clone this wiki locally