Navigation Menu

Skip to content

Commit

Permalink
libgui|Tests: DisplayMode init and shutdown done by GuiApp
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 1a53544 commit baba7b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions doomsday/libs/gui/src/displaymode.cpp
Expand Up @@ -197,6 +197,7 @@ static void assertDisplayModeHasBeenDeinitialized()

int DisplayMode_Init(void)
{
DE_ASSERT(!inited); // don't redo it
if (inited) return true;

captured = false;
Expand Down
3 changes: 3 additions & 0 deletions doomsday/libs/gui/src/guiapp.cpp
Expand Up @@ -23,6 +23,7 @@

#include <de/CommandLine>
#include <de/Config>
#include <de/DisplayMode>
#include <de/EventLoop>
#include <de/FileSystem>
#include <de/Log>
Expand Down Expand Up @@ -54,6 +55,7 @@ DE_PIMPL(GuiApp)

~Impl()
{
DisplayMode_Shutdown();
SDL_Quit();
}

Expand Down Expand Up @@ -191,6 +193,7 @@ void GuiApp::initSubsystems(SubsystemInitFlags subsystemInitFlags)
// Apply the overall UI scale factor.
d->dpiFactor *= config().getf("ui.scaleFactor", 1.f);

DisplayMode_Init();
scriptSystem().nativeModule("DisplayMode").set("DPI_FACTOR", d->dpiFactor);
}

Expand Down
4 changes: 0 additions & 4 deletions doomsday/tests/test_appfw/src/testapp.cpp
Expand Up @@ -19,7 +19,6 @@
#include "testapp.h"
#include "appwindowsystem.h"

#include <de/DisplayMode>
#include <de/FileSystem>
#include <de/ScriptSystem>

Expand All @@ -36,8 +35,6 @@ DE_PIMPL(TestApp)
{
// Windows will be closed; OpenGL context will be gone.
self().glDeinit();

DisplayMode_Shutdown();
}

void loadAllShaders()
Expand All @@ -63,7 +60,6 @@ TestApp::TestApp(const StringList &args)

void TestApp::initialize()
{
DisplayMode_Init();
addInitPackage("net.dengine.test.appfw");
initSubsystems(App::DisablePlugins);

Expand Down

0 comments on commit baba7b7

Please sign in to comment.