From 4eb070c653598e6e89a531745c0743af568758b0 Mon Sep 17 00:00:00 2001 From: Andrea Odetti Date: Sat, 30 Oct 2021 14:10:14 +0100 Subject: [PATCH] Make ImGui the default SDL2 implementation. Signed-off-by: Andrea Odetti --- linux.md | 2 +- source/frontends/common2/programoptions.cpp | 4 ++-- source/frontends/common2/programoptions.h | 2 +- source/frontends/sdl/README.md | 12 ++++-------- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/linux.md b/linux.md index 2257ded9..2823de5e 100644 --- a/linux.md +++ b/linux.md @@ -42,7 +42,7 @@ Audio files can be read via the cassette interface (SDL Version). Just drop a `w This is your best choice, in particular the ImGui version. -TL;DR: ``sa2 --imgui`` +TL;DR: just run ``sa2`` See [sa2](source/frontends/sdl/README.md) for more details. diff --git a/source/frontends/common2/programoptions.cpp b/source/frontends/common2/programoptions.cpp index 96ea2b94..245e0a6e 100644 --- a/source/frontends/common2/programoptions.cpp +++ b/source/frontends/common2/programoptions.cpp @@ -105,7 +105,7 @@ namespace common2 sdlDesc.add_options() ("sdl-driver", po::value()->default_value(options.sdlDriver), "SDL driver") ("gl-swap", po::value()->default_value(options.glSwapInterval), "SDL_GL_SwapInterval") - ("imgui", "Render with Dear ImGui") + ("no-imgui", "Plain SDL2 renderer") ("geometry", po::value(), "WxH[+X+Y]") ; desc.add(sdlDesc); @@ -132,7 +132,7 @@ namespace common2 options.useQtIni = vm.count("qt-ini"); options.sdlDriver = vm["sdl-driver"].as(); options.glSwapInterval = vm["gl-swap"].as(); - options.imgui = vm.count("imgui"); + options.imgui = vm.count("no-imgui") == 0; if (vm.count("registry")) { diff --git a/source/frontends/common2/programoptions.h b/source/frontends/common2/programoptions.h index e5f9579b..2f6f75c7 100644 --- a/source/frontends/common2/programoptions.h +++ b/source/frontends/common2/programoptions.h @@ -46,7 +46,7 @@ namespace common2 bool fixedSpeed = false; // default adaptive int sdlDriver = -1; // default = -1 to let SDL choose - bool imgui = false; // use imgui renderer + bool imgui = true; // use imgui renderer Geometry geometry; // must be initialised with defaults int glSwapInterval = 1; // SDL_GL_SetSwapInterval diff --git a/source/frontends/sdl/README.md b/source/frontends/sdl/README.md index c00efb0d..4fc23ccd 100644 --- a/source/frontends/sdl/README.md +++ b/source/frontends/sdl/README.md @@ -2,27 +2,23 @@ This file only lists options not already described in ``-h``. -There are really 2 frontends here, with and without ``ImGui``, which will become the default in the future. +The default frontend uses SDL2 + ImGui and requires an OpenGL ES2.0 implementation. It is possible to use plain SDL2 and select the renderer (pass ``--no-imgui`` and look at ``-h``). ## Configuration -The configuration GUI only works with ``--imgui``: otherwise either manually edit the configuration file ``~/.applewin/applewin.conf`` or use ``qapple`` and run ``sa2 --qt-ini``. +The configuration GUI only works with ImGui: otherwise either manually edit the configuration file ``~/.applewin/applewin.conf`` or use ``qapple`` and run ``sa2 --qt-ini``. The format of the configuration file is the same as the Windows Registry of AppleWin. -*Drag & drop* works for floppy disks. With ``--imgui`` it is possible to select which drive they are dropped into (``D&D``). +*Drag & drop* works for floppy disks. With ImGui it is possible to select which drive they are dropped into (``D&D``). If the filename ends with `.yaml`, it will be loaded as a *State* file. Individual options can be passed via arguments too: ``-c Configuration.Printer_FileName=Printer.txt``. If you have a modern gamepad where the axes (``LEFTX`` and ``LEFTY``) move in a circle, the emulator will automatically map to a square: use ``--no-squaring`` to avoid this. -## Raspberry Pi - -On a Raspberry Pi, one needs the KMS (fake or not). Better performance has been observed with the ``opengles2`` driver (use ``sa2 --sdl-driver 1``). - ## Dear ImGui -With the flag ``--imgui``, the rendering is performed with [Dear ImGui](https://github.com/ocornut/imgui). In this case ``--sdl-driver`` is ignored and a OpenGL ES2.0 implementation is required. +The rendering is performed with [Dear ImGui](https://github.com/ocornut/imgui). On a Raspberry Pi, a KMS driver is mandatory and best results are obtained on a Pi4 with FullKMS (full screen via ``F6``).