Skip to content

Commit 1cd2263

Browse files
feat(shell): vsync/console in config
1 parent 6287648 commit 1cd2263

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/shell/config.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ void config::read_config() {
3333
config::current = std::make_unique<config>();
3434
}
3535
}
36+
37+
if (config::current->context_menu.debug_console) {
38+
ShowWindow(GetConsoleWindow(), SW_SHOW);
39+
} else {
40+
ShowWindow(GetConsoleWindow(), SW_HIDE);
41+
}
3642
}
3743

3844
std::filesystem::path config::data_directory() {

src/shell/contextmenu/menu_render.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ menu_render menu_render::create(int x, int y, menu menu) {
3030
rt->capture_all_input = true;
3131
rt->decorated = false;
3232
rt->topmost = true;
33+
rt->vsync = config::current->context_menu.vsync;
3334

3435
if (auto res = rt->init(); !res) {
3536
MessageBoxW(NULL, L"Failed to initialize render target", L"Error",

src/shell/entry.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <chrono>
1818
#include <codecvt>
1919
#include <condition_variable>
20+
#include <consoleapi3.h>
2021
#include <filesystem>
2122
#include <functional>
2223
#include <future>
@@ -42,6 +43,7 @@ void main() {
4243
freopen("CONOUT$", "w", stdout);
4344
freopen("CONOUT$", "w", stderr);
4445
freopen("CONIN$", "r", stdin);
46+
ShowWindow(GetConsoleWindow(), SW_HIDE);
4547
config::run_config_loader();
4648

4749
std::thread([]() {

0 commit comments

Comments
 (0)