# HG changeset patch # User Sam # Date 1674143352 -25200 # Node ID 4c3891eb9ef9e17ce52e56d959fad177f73b1cf9 # Parent 5ab7fb4d9ee9038d55a3db6e2a24625712221d28 add: improve build on windows diff -r 5ab7fb4d9ee9 -r 4c3891eb9ef9 config.nims --- a/config.nims Thu Jan 19 17:39:32 2023 +0700 +++ b/config.nims Thu Jan 19 22:49:12 2023 +0700 @@ -108,6 +108,15 @@ task publish, "publish all build": exec("rsync -rv build/ basx.dev:/var/www/public.basx.dev/semicongine") + for file in listFiles("build/debug/linux"): + exec(&"scp {file} sam@mail.basx.dev:/var/www/public.basx.dev/semicongine/debug/linux/") + for file in listFiles("build/release/linux"): + exec(&"scp {file} sam@mail.basx.dev:/var/www/public.basx.dev/semicongine/release/linux/") + for file in listFiles("build/debug/windows"): + exec(&"scp {file} sam@mail.basx.dev:/var/www/public.basx.dev/semicongine/debug/windows/") + for file in listFiles("build/release/windows"): + exec(&"scp {file} sam@mail.basx.dev:/var/www/public.basx.dev/semicongine/release/windows/") + task glslangValidator, "Download glslangValidator (required for linux compilation)": let dirname="/tmp/glslang_download" exec &"mkdir -p {dirname}" diff -r 5ab7fb4d9ee9 -r 4c3891eb9ef9 src/semicongine/platform/windows/win32.nim --- a/src/semicongine/platform/windows/win32.nim Thu Jan 19 17:39:32 2023 +0700 +++ b/src/semicongine/platform/windows/win32.nim Thu Jan 19 22:49:12 2023 +0700 @@ -75,7 +75,7 @@ DWORD(0), windowClassName, windowName, - DWORD(WS_OVERLAPPEDWINDOW), + DWORD(WS_POPUP or WS_THICKFRAME or WS_SYSMENU or WS_MAXIMIZEBOX or WS_MINIMIZEBOX), CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HMENU(0), HINSTANCE(0), @@ -100,5 +100,6 @@ var msg: MSG # fill queue while PeekMessage(addr(msg), window.hwnd, 0, 0, PM_REMOVE): + TranslateMessage(addr(msg)) DispatchMessage(addr(msg)) return currentEvents diff -r 5ab7fb4d9ee9 -r 4c3891eb9ef9 src/semicongine/shader.nim --- a/src/semicongine/shader.nim Thu Jan 19 17:39:32 2023 +0700 +++ b/src/semicongine/shader.nim Thu Jan 19 22:49:12 2023 +0700 @@ -45,8 +45,12 @@ let (output, exitCode_glsl) = gorgeEx(command=fmt"{projectPath}/glslangValidator --entry-point {entrypoint} -V --stdin -S {stagename} -o {shaderfile}", input=shaderSource) if exitCode_glsl != 0: raise newException(Exception, output) - let shaderbinary = staticRead shaderfile - # removeFile(shaderfile) TODO: remove file at compile time? + + when defined(mingw): # required for crosscompilation, path separators get messed up + let shaderbinary = staticRead shaderfile.replace("\\", "/") + else: + let shaderbinary = staticRead shaderfile + # removeFile(shaderfile) TODO: remove file at compile time? how to do in cross-platform consistent way? var i = 0 while i < shaderbinary.len: