Drawing to screen using multimedia
This commit is contained in:
@@ -133,15 +133,25 @@ StartMultimedia :: (x: S64 = 1280, y: S64 = 720, title: String = "Hello people!"
|
||||
Mu.os.bitmap = W32.CreateBitmap(Mu.os.window_dc, size)
|
||||
|
||||
Mu.scrn = Mu.os.bitmap.data
|
||||
Mu.x = Mu.os.bitmap.size.x
|
||||
Mu.y = Mu.os.bitmap.size.y
|
||||
Mu.x = size.x
|
||||
Mu.y = size.y
|
||||
|
||||
UpdateMultimedia :: (): Bool
|
||||
DrawBitmapInCompatibleDC(&Mu.os.bitmap)
|
||||
|
||||
msg: MSG
|
||||
for PeekMessageW(&msg, Mu.os.window, 0, 0, PM_REMOVE) == 1
|
||||
TranslateMessage(&msg)
|
||||
DispatchMessageW(&msg)
|
||||
|
||||
size := GetWindowSize(Mu.os.window)
|
||||
if size.x != Mu.x || size.y != Mu.y
|
||||
DestroyBitmap(&Mu.os.bitmap)
|
||||
CreateBitmap(Mu.os.window_dc, size)
|
||||
|
||||
Mu.x = size.x
|
||||
Mu.y = size.y
|
||||
|
||||
Mu.frame_count += 1
|
||||
frame_time := Time() - Mu.time.frame_start
|
||||
Mu.time.total += frame_time
|
||||
|
||||
Reference in New Issue
Block a user