Skip to content

Commit c603ca6

Browse files
committed
Use the new app configuration with nested structures
- Rename the vsync configuration variable
1 parent e3702e1 commit c603ca6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/main.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ bool loadMap(MapFactory::Configuration &mapConfig, MapModel &mapModel, const cha
335335
MapModel mapModel;
336336
MapFactory::Configuration mapConfig;
337337
bool showInterface = true;
338-
bool withVSync = true;
338+
bool vsync = true;
339339
bool drawOverlay = true;
340340
}
341341

@@ -358,10 +358,10 @@ void MyEventHandler::onPreInit(nc::AppConfiguration &config)
358358
#endif
359359
#endif
360360

361-
config.windowTitle = "ncTiledViewer";
362-
config.windowIconFilename = "icon48.png";
363-
config.consoleLogLevel = nc::ILogger::LogLevel::INFO;
364-
withVSync = config.withVSync;
361+
config.logging.consoleLevel = nc::ILogger::LogLevel::INFO;
362+
config.window.title = "ncTiledViewer";
363+
config.window.iconFilename = "icon48.png";
364+
vsync = config.graphics.vsync;
365365
}
366366

367367
void MyEventHandler::onInit()
@@ -423,8 +423,8 @@ void MyEventHandler::onFrameStart()
423423
#ifdef __ANDROID__
424424
ImGui::Text("VSync: true");
425425
#else
426-
ImGui::Checkbox("VSync", &withVSync);
427-
nc::theApplication().gfxDevice().setSwapInterval(withVSync ? 1 : 0);
426+
ImGui::Checkbox("VSync", &vsync);
427+
nc::theApplication().gfxDevice().setSwapInterval(vsync ? 1 : 0);
428428
#endif
429429
ImGui::Text("FPS: %.2f (%.2f ms)", 1.0f / frameTime, frameTime * 1000.0f);
430430
ImGui::Separator();

0 commit comments

Comments
 (0)