Skip to content
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 OIS with SDL input (using OGRE14 + Bites component) #2983

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from

Commits on Sep 17, 2023

  1. Configuration menu
    Copy the full SHA
    4952340 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2023

  1. port to Ogre 13 (without RTSS)

    Joint effort by @ohlidalp, @tritonas00, @AnotherFoxGuy, @CuriousMike56
    
    ⬆️ Updated mygui, pagedgeometry and caelum
    🐛 Fixed missing MyGUI shaders
    🐛 Fixed MyGUI rendering issue
    🔧 Build OGRE with resourcemanager_strict=off
    updated rtshader media
    🐛 Fixed cmake not accepting `CMAKE_CONFIGURATION_TYPES`
    fixed odef lights scenenode
    🐛 Fixed Caelum not loading os files
    Caelum time slider: restored original code (it works with latest Ogre master branch)
    🐛 Fixed Imgui inverted colours on DirectX 9
    fixed survey map texture updating
    ⬆️ Update OGRE to 13.5
    updated rtshader media for Ogre 13.5
    🔧 Implement PSSM3 properly
    ⬆️ Update OGRE to 13.5.1
    Fixed crash on loading 2nd terrain w/envmap enabled
    ⬆️ Update OGRE to 13.5.3
    Fixed crash on 2nd map load (procedural road material conflict)
    Media: fix corrupted DDS texture crashing under D3D9
    ohlidalp committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    38dc6e7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    20b3d9e View commit details
    Browse the repository at this point in the history
  3. Replaced OIS with OgreBites input + SDL (not functional yet)

    Status: builds and runs OK, but there is no input.
    
    This is a brainless 1:1 replacement of OIS API and events with SDL API and OgreBites input events. I preserved our (very outdated) DearIMGUI integration. All our (quite convoluted) input processing stayed mostly intact. Only mouse/keyboard input is handled, joysticks + controllers + forcefeedback are temporarily disabled.
    ohlidalp committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    7eb031b View commit details
    Browse the repository at this point in the history
  4. Working SDL input (keyboard/mouse)

    Status: build and runs, keyboard+mouse working, window is somehow oversized but responsive.
    
    Codechanges:
    * creating render window via OgreBites::ApplicationContext instead of OGRE Root directly - needed to receive events
    * overriding OgreBites::ApplicationContext::createRoot() with our pre-existing setup code, to initialize `mRoot` as expected.
    * calling `OgreBites::ApplicationContext::addInputListener()` to receive events.
    ohlidalp committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    2988c25 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e966a53 View commit details
    Browse the repository at this point in the history
  6. Migrated to OGRE's built-in DearIMGUI

    STATUS:
    - ogre imgui port: keyboard/mouse input working!
    - ogre imgui port: FIXME: hacked Renderdash to build, but imgui will likely render into it - how to disable??
    - ogre imgui port: builds and runs with default font.
    - under Debug I get asserts about NewFrame()/EndFrame() mismatches, to be fixed later.
    
    CODECHANGES:
    * imgui deprecated - renamed ImGui::AlignFirstTextHeightToWidgets() to ImGui::AlignTextToFramePadding()
    * imgui deprecated - ImGui::GetContentRegionAvailWidth() -> use ImGui::GetContentRegionAvail().x
    * imgui deprecated -  GetWindowContentRegionWidth() function. -> 'GetWindowContentRegionMax().x
    * imgui deprecated - SetScrollHere() -> SetScrollHereX() + SetScollHereY()
    * imgui deprecated - ImGui::TreeAdvanceToLabelPos()      -> use ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetTreeNodeToLabelSpacing());
    * imgui deprecated - renamed SetNextTreeNodeOpen() to SetNextItemOpen().
    * imgui deprecated - renamed ListBoxHeader(const char* label, ImVec2 size) to BeginListBox().
    * imgui deprecated - removed BeginPopupContextWindow(const char*, int mouse_button, bool also_over_items) in favor of BeginPopupContextWindow(const char*, ImGuiPopupFlags flags) with ImGuiPopupFlags_NoOverItems.
    * imgui deprecated - removed CalcListClipping() function. Prefer using ImGuiListClipper which can return non-contiguous ranges.
    * imgui deprecated - ImGuiCol_ChildWindowBg              -> use ImGuiCol_ChildBg
    * imgui deprecated - style: renamed ImGuiCol_ModalWindowDarkening to ImGuiCol_ModalWindowDimBg
    * imgui deprecated - GetItemsLineHeightWithSpacing()     -> use GetFrameHeightWithSpacing()
    * imgui deprecated - InputText: Renamed  ImGuiTextEditCallbackData to ImGuiInputTextCallbackData
    * imgui deprecated - SetNextWindowContentWidth(float w)    ->    SetNextWindowContentSize(ImVec2(w, 0.0f))
    * imgui deprecated - SetNextWindowPosCenter(ImGuiCond c=0) { SetNextWindowPos(GetMainViewport()->GetCenter(), c, ImVec2(0.5f,0.5f));
    * ogre imgui port: use public `GetFont()/GetFontSize()` instead of internal `ImGuiContext->Font/FontSize`
    * VehicleAI panel: `Push/PopItemFlag(Disabled)` (imgui_internal) -> `Begin/EndDisabled()` (public BETA API)
    ohlidalp committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    cfb2cb7 View commit details
    Browse the repository at this point in the history
  7. OGRE13-SDL: Fixed window appearing on top left with titlebar outside …

    …of screen.
    
    Deleted the windows-specific code setting ["monitorIndex"]- apparently OGRE does it by itself in `ApplicationContextSDL::createWindow()`, see OgreApplicationContextSDL.cpp line 56.
    Original commit: 128a8e2 - "Attempt to fix the 'Rendering Device' setting" - Ulteq, 4 years ago (29.12.2018 13:53:57)
    
    Also deleted setting ["windowProc"] - doesn't seem to have any effect, perhaps an OIS leftover.
    ohlidalp committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    e739b3f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eb8a44e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    cded949 View commit details
    Browse the repository at this point in the history
  10. OGRE13 imgui: Re-added font

    ohlidalp committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    4751803 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. OGRE14 migration (WIP, build broken)

    Codechanges:
    * GUIUtils, InputEngine: `getModifierKeyName()` replaced OIS keycodes with OgreBites/SDL keycodes
    * ImGuiAngelscript: commented out some dead items, added (ImGuiKey) casts where needed, see ocornut/imgui#4921
    * GUI_VehicleButtons: build fix for `ImGui::ImageButton()` - added parameter ID-string.
    * GUI_RepositorySelector: updated thumbnail downloading to use new OGRE WorkQueue API, see https://github.com/OGRECave/ogre/blob/master/Docs/14-Notes.md#task-based-workqueue
    * Application.h, main.cpp: added ✉️ `MSG_NET_DOWNLOAD_REPOTHUMB_SUCCESS`, used instead of OGRE WorkQueue's `addMainThreadTask` for consistency across the various background threads in the codebase.
    * GodRaysManager: build fix - RENDER_QUEUE_9 was removed from OGRE, using 8.
    * RttManager: rendersystem-specific `getProjectionMatrixRS()` was removed from OGRE, using portable  `getProjectionMatrix()`
    ohlidalp committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    6e8f8cc View commit details
    Browse the repository at this point in the history