Added conditional compilation and Const namespace with OS name
This commit is contained in:
@@ -100,37 +100,6 @@ Raymarcher_Update :: ()
|
||||
#import "USER32.core"
|
||||
#import "WINMM.core"
|
||||
|
||||
Windows_Bitmap :: struct
|
||||
size: Vec2I
|
||||
data: *U32
|
||||
hdc: HDC
|
||||
dib: HBITMAP
|
||||
|
||||
CreateBitmap :: (size: Vec2I, bottom_up: Bool = true): Windows_Bitmap
|
||||
result: Windows_Bitmap = {size = size}
|
||||
if bottom_up == false
|
||||
result.size.y = -result.size.y
|
||||
|
||||
header_size: U32 = SizeOf(BITMAPINFOHEADER)
|
||||
Assert(header_size == 40)
|
||||
bminfo := BITMAPINFO{
|
||||
BITMAPINFOHEADER{
|
||||
biSize = header_size,
|
||||
biWidth = size.x->LONG,
|
||||
biHeight = size.y->LONG,
|
||||
biPlanes = 1,
|
||||
biBitCount = 32,
|
||||
biCompression = BI_RGB,
|
||||
biXPelsPerMeter = 1,
|
||||
biYPelsPerMeter = 1,
|
||||
}
|
||||
}
|
||||
|
||||
hdc := GetDC(0)
|
||||
result.dib = CreateDIBSection(hdc, &bminfo, DIB_RGB_COLORS, (&result.data)->**void, 0, 0)
|
||||
result.hdc = CreateCompatibleDC(hdc)
|
||||
return result
|
||||
|
||||
|
||||
AppIsRunning := true
|
||||
WindowProc :: (hwnd: HWND, msg: UINT, wparam: WPARAM, lparam: LPARAM): LRESULT
|
||||
@@ -206,4 +175,36 @@ WinMain :: (hInstance: HINSTANCE, hPrevInstance: HINSTANCE, lpCmdLine: LPSTR, nS
|
||||
|
||||
if CStringCompare(lpCmdLine, "testing")
|
||||
return 0
|
||||
return 0
|
||||
return 0
|
||||
|
||||
|
||||
Windows_Bitmap :: struct
|
||||
size: Vec2I
|
||||
data: *U32
|
||||
hdc: HDC
|
||||
dib: HBITMAP
|
||||
|
||||
CreateBitmap :: (size: Vec2I, bottom_up: Bool = true): Windows_Bitmap
|
||||
result: Windows_Bitmap = {size = size}
|
||||
if bottom_up == false
|
||||
result.size.y = -result.size.y
|
||||
|
||||
header_size: U32 = SizeOf(BITMAPINFOHEADER)
|
||||
Assert(header_size == 40)
|
||||
bminfo := BITMAPINFO{
|
||||
BITMAPINFOHEADER{
|
||||
biSize = header_size,
|
||||
biWidth = size.x->LONG,
|
||||
biHeight = size.y->LONG,
|
||||
biPlanes = 1,
|
||||
biBitCount = 32,
|
||||
biCompression = BI_RGB,
|
||||
biXPelsPerMeter = 1,
|
||||
biYPelsPerMeter = 1,
|
||||
}
|
||||
}
|
||||
|
||||
hdc := GetDC(0)
|
||||
result.dib = CreateDIBSection(hdc, &bminfo, DIB_RGB_COLORS, (&result.data)->**void, 0, 0)
|
||||
result.hdc = CreateCompatibleDC(hdc)
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user