Skip to content
8 changes: 5 additions & 3 deletions nimedit.nim
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ proc createSdlWindow(ed: Editor; maximize: range[0u32 .. 1u32]) =
let maximized = SDL_WINDOW_MAXIMIZED * maximize

ed.window = createWindow(windowTitle, 10, 30, ed.screenW, ed.screenH,
SDL_WINDOW_RESIZABLE or maximized)
SDL_WINDOW_RESIZABLE or maximized or SDL_WINDOW_ALLOW_HIGHDPI)
ed.window.getSize(ed.screenW, ed.screenH)
ed.renderer = createRenderer(ed.window, -1, Renderer_Software)

Expand Down Expand Up @@ -1220,8 +1220,10 @@ proc mainProc(ed: Editor) =
destroy ed



if sdl2.init(INIT_VIDEO) != SdlSuccess:
# no sdl2 hints defined? we'll just do them verbatim then
if setHint("SDL_WINDOWS_DPI_AWARENESS", "permonitorv2") != SdlSuccess:
echo "dpi failure"
elif sdl2.init(INIT_VIDEO) != SdlSuccess:
echo "SDL_Init"
elif ttfInit() != SdlSuccess:
echo "TTF_Init"
Expand Down