Adding missed compiler errors, some work on modules

This commit is contained in:
Krzosa Karol
2022-10-13 11:43:15 +02:00
parent de0d2181f5
commit 6e8acf7dc8
5 changed files with 44 additions and 5 deletions

View File

@@ -93,7 +93,12 @@ SetWindowPosition :: (window: HWND, style: DWORD, pos: Vec2I): void
AdjustWindowRect(window, style, &rect)
SetWindowPos(window, 0, rect.left, rect.top, 0, 0, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSIZE)
StartMultimedia :: (x: S64 = 1280, y: S64 = 720, title: String = "Hello people!", target_ms: F64 = 0.0166666)
StartMultimedia :: (
x: S64 = 1280, y: S64 = 720,
title: String = "Hello people!",
window_resizable: Bool = false,
target_ms: F64 = 0.0166666
)
Mu.time.delta = target_ms
if timeBeginPeriod(1) == TIMERR_NOERROR
Mu.os.good_scheduling = true
@@ -113,7 +118,7 @@ StartMultimedia :: (x: S64 = 1280, y: S64 = 720, title: String = "Hello people!"
}
Assert(RegisterClassW(&w) != 0)
style: DWORD = GetWindowStyle(false)
style: DWORD = GetWindowStyle(window_resizable)
Mu.os.window = CreateWindowExW(
dwExStyle = 0, hWndParent = 0, hMenu = 0, lpParam = 0,
X = CW_USEDEFAULT, Y = CW_USEDEFAULT, nWidth = x->int, nHeight = y->int,
@@ -132,9 +137,11 @@ StartMultimedia :: (x: S64 = 1280, y: S64 = 720, title: String = "Hello people!"
Mu.os.window_dc = GetDC(Mu.os.window)
Mu.os.bitmap = CreateBitmap(Mu.os.window_dc, size)
Mu.window.resizable = window_resizable
Mu.screen = Mu.os.bitmap.data
Mu.window.x = size.x
Mu.window.y = size.y
Mu.window.size = size
Mu.window.sizef.x = Mu.window.x->F32
Mu.window.sizef.y = Mu.window.y->F32
@@ -149,7 +156,7 @@ UpdateMultimedia :: (): Bool
size := GetWindowSize(Mu.os.window)
if size.x != Mu.window.x || size.y != Mu.window.y
DestroyBitmap(&Mu.os.bitmap)
CreateBitmap(Mu.os.window_dc, size)
Mu.os.bitmap = CreateBitmap(Mu.os.window_dc, size)
Mu.screen = Mu.os.bitmap.data
Mu.window.x = size.x