diff --git a/Sources/Voxelotl/Application.swift b/Sources/Voxelotl/Application.swift index e530bc4..76c7c82 100644 --- a/Sources/Voxelotl/Application.swift +++ b/Sources/Voxelotl/Application.swift @@ -23,10 +23,13 @@ public class Application { } // Create SDL window - var windowFlags = SDL_WindowFlags(SDL_WINDOW_HIGH_PIXEL_DENSITY) + var windowFlags = SDL_WindowFlags(0) if (cfg.flags.contains(.resizable)) { windowFlags |= SDL_WindowFlags(SDL_WINDOW_RESIZABLE) } + if (cfg.flags.contains(.highDPI)) { + windowFlags |= SDL_WindowFlags(SDL_WINDOW_HIGH_PIXEL_DENSITY) + } window = SDL_CreateWindow(cfg.title, cfg.width, cfg.height, windowFlags) guard window != nil else { print("SDL_CreateWindow() error: \(String(cString: SDL_GetError()))", to: &stderr) @@ -134,6 +137,7 @@ public struct ApplicationConfiguration { } static let resizable = Flags(rawValue: 1 << 0) + static let highDPI = Flags(rawValue: 1 << 1) } public enum VSyncMode { diff --git a/Sources/Voxelotl/main.swift b/Sources/Voxelotl/main.swift index 5a7b502..20d4cd8 100644 --- a/Sources/Voxelotl/main.swift +++ b/Sources/Voxelotl/main.swift @@ -5,7 +5,7 @@ let app = Application( width: 1280, height: 720, title: "Voxelotl Demo", - flags: .resizable, + flags: [ .resizable, .highDPI ], vsyncMode: .on(interval: 1))) exit(app.run())