summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-13 21:54:39 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-13 21:54:39 +0300
commit86b19d64c2692665aba33e44ee5db6cbf36b6342 (patch)
tree93d91c84258f9b76ab29ab51119bbc0044d729a4 /src/gui/widgets/tabs
parenta45303dc06c74735389607e5b281bb69543547ed (diff)
downloadmanaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.gz
manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.bz2
manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.tar.xz
manaverse-86b19d64c2692665aba33e44ee5db6cbf36b6342.zip
Add option to select any existing SDL renderer drivers for SDL2 default mode.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/setup_perfomance.cpp28
-rw-r--r--src/gui/widgets/tabs/setup_perfomance.h3
2 files changed, 30 insertions, 1 deletions
diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp
index d28b82680..664183276 100644
--- a/src/gui/widgets/tabs/setup_perfomance.cpp
+++ b/src/gui/widgets/tabs/setup_perfomance.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/tabs/setup_perfomance.h"
+#include "configuration.h"
+
#include "gui/models/namesmodel.h"
#include "gui/widgets/containerplacer.h"
@@ -31,6 +33,9 @@
#include "utils/delete2.h"
#include "utils/gettext.h"
+#ifdef USE_SDL2
+#include "utils/sdlhelper.h"
+#endif // USE_SDL2
#include "debug.h"
@@ -48,7 +53,8 @@ static const char *const texturesList[] =
Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) :
SetupTabScroll(widget),
- mTexturesList(new NamesModel)
+ mTexturesList(new NamesModel),
+ mSdlDriversList(new NamesModel)
{
// TRANSLATORS: settings tab name
setName(_("Performance"));
@@ -58,6 +64,15 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) :
ContainerPlacer place = h.getPlacer(0, 0);
place(0, 0, mScroll, 10, 10);
+#ifdef USE_SDL2
+ StringVect sdlDriversList;
+ SDL::getRenderers(sdlDriversList,
+ config.getStringValue("sdlDriver"));
+ sdlDriversList.insert(sdlDriversList.begin(),
+ // TRANSLATORS: sdl driver name
+ N_("default"));
+#endif // USE_SDL2
+
// TRANSLATORS: settings option
new SetupItemLabel(_("Better performance (enable for better performance)"),
"", this);
@@ -138,6 +153,14 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) :
new SetupItemLabel(_("Different options (enable or disable can "
"improve performance)"), "", this);
+#ifdef USE_SDL2
+ mSdlDriversList->fillFromVector(sdlDriversList);
+ new SetupItemDropDownStr(
+ // TRANSLATORS: settings option
+ _("Try first sdl driver (only for SDL2 default mode)"),
+ "", "sdlDriver", this, "sdlDriverEvent", mSdlDriversList, 100);
+#endif // USE_SDL2
+
mTexturesList->fillFromArray(&texturesList[0], texturesListSize);
// TRANSLATORS: settings option
new SetupItemDropDown(_("Enable texture compression (OpenGL)"), "",
@@ -179,4 +202,7 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) :
Setup_Perfomance::~Setup_Perfomance()
{
delete2(mTexturesList);
+#ifdef USE_SDL2
+ delete2(mSdlDriversList);
+#endif // USE_SDL2
}
diff --git a/src/gui/widgets/tabs/setup_perfomance.h b/src/gui/widgets/tabs/setup_perfomance.h
index 6e933c0fc..a4043ab4e 100644
--- a/src/gui/widgets/tabs/setup_perfomance.h
+++ b/src/gui/widgets/tabs/setup_perfomance.h
@@ -38,6 +38,9 @@ class Setup_Perfomance final : public SetupTabScroll
private:
NamesModel *mTexturesList;
+#ifdef USE_SDL2
+ NamesModel *mSdlDriversList;
+#endif // USE_SDL2
};
#endif // GUI_WIDGETS_TABS_SETUP_PERFOMANCE_H