changeset 90:01ba9f715b7e

fix: some windows issues
author Sam <sam@bax.dev>
date Sat, 25 Feb 2023 18:56:42 +0700
parents d911cacce29e
children 2e9823f9193f
files src/semicongine/platform/windows/win32.nim src/semicongine/shader.nim
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/semicongine/platform/windows/win32.nim	Sat Feb 25 01:21:29 2023 +0700
+++ b/src/semicongine/platform/windows/win32.nim	Sat Feb 25 18:56:42 2023 +0700
@@ -15,7 +15,7 @@
 
 template checkWin32Result*(call: untyped) =
   let value = call
-  if value != 0:
+  if value == 0:
     raise newException(Exception, "Win32 error: " & astToStr(call) & " returned " & $value)
 
 
@@ -77,7 +77,7 @@
       DWORD(0),
       windowClassName,
       windowName,
-      DWORD(WS_POPUP or WS_THICKFRAME or WS_SYSMENU or WS_MAXIMIZEBOX or WS_MINIMIZEBOX),
+      DWORD(WS_OVERLAPPEDWINDOW),
       CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
       HMENU(0),
       HINSTANCE(0),
--- a/src/semicongine/shader.nim	Sat Feb 25 01:21:29 2023 +0700
+++ b/src/semicongine/shader.nim	Sat Feb 25 18:56:42 2023 +0700
@@ -27,7 +27,7 @@
       command = command,
       input = input)
   if exitcode != 0:
-    raise newException(Exception, output)
+    raise newException(Exception, &"Running '{command}' produced exit code: {exitcode}" & output)
   return output
 
 
@@ -65,7 +65,7 @@
   when defined(linux):
     discard staticExecChecked(command = fmt"rm {shaderfile}")
   elif defined(windows):
-    discard staticExecChecked(command = fmt"del {shaderfile}")
+    discard staticExecChecked(command = fmt"cmd.exe /c del {shaderfile}")
   else:
     raise newException(Exception, "Unsupported operating system")