Skip to content

Windows dpi awareness #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
8 changes: 5 additions & 3 deletions nimedit.nim
Original file line number Diff line number Diff line change
@@ -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)

@@ -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"