RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
995 stars 175 forks source link

Replacing OIS with SDL input (using OGRE14 + Bites component) #2983

Open ohlidalp opened 1 year ago

ohlidalp commented 1 year ago

This is a first step in migrating from self-shipped OIS library to standard SDL2 and OGRE's builtin DearIMGUI integration. I've based it on our (pretty mature already) OGRE13 port to get the latest tech and support.

Only mouse+keyboard are working, controllers and joysticks (+ force feedback) are temporarily disabled.

OGRE provides Bites component with generic ApplicationContext that runs on many platforms and powers OGRE SampleBrowser. It includes DearIMGUI integration, RTSS setup, window creation and generic input API for all devices. I tried replacing our OIS events + API calls 1:1 with Bites events and SDL API calls and it turns out to work just fine. I had to also replace the function which opens render window, as SDL input events don't work otherwise. Everything else remains unchanged. Also our (very outdated) DearIMGUI integration remains in place, with only updated input processing (based on OgreBites code, anyway).

ohlidalp commented 1 year ago

I tried replacing our DearIMGUI integration (v 1.75 - very outdated) with OGRE's builtin DearImguiOverlay component. UPDATE: It's a success, just some finishing touches are needed, see below.

Status: