diff --git a/core/sys/windows/dwmapi.odin b/core/sys/windows/dwmapi.odin index 468b5bb87..9b5916ab1 100644 --- a/core/sys/windows/dwmapi.odin +++ b/core/sys/windows/dwmapi.odin @@ -3,7 +3,45 @@ package sys_windows foreign import dwmapi "system:Dwmapi.lib" +DWMWINDOWATTRIBUTE :: enum { + DWMWA_NCRENDERING_ENABLED, + DWMWA_NCRENDERING_POLICY, + DWMWA_TRANSITIONS_FORCEDISABLED, + DWMWA_ALLOW_NCPAINT, + DWMWA_CAPTION_BUTTON_BOUNDS, + DWMWA_NONCLIENT_RTL_LAYOUT, + DWMWA_FORCE_ICONIC_REPRESENTATION, + DWMWA_FLIP3D_POLICY, + DWMWA_EXTENDED_FRAME_BOUNDS, + DWMWA_HAS_ICONIC_BITMAP, + DWMWA_DISALLOW_PEEK, + DWMWA_EXCLUDED_FROM_PEEK, + DWMWA_CLOAK, + DWMWA_CLOAKED, + DWMWA_FREEZE_REPRESENTATION, + DWMWA_PASSIVE_UPDATE_MODE, + DWMWA_USE_HOSTBACKDROPBRUSH, + DWMWA_USE_IMMERSIVE_DARK_MODE = 20, + DWMWA_WINDOW_CORNER_PREFERENCE = 33, + DWMWA_BORDER_COLOR, + DWMWA_CAPTION_COLOR, + DWMWA_TEXT_COLOR, + DWMWA_VISIBLE_FRAME_BORDER_THICKNESS, + DWMWA_SYSTEMBACKDROP_TYPE, + DWMWA_LAST, +} + +DWMNCRENDERINGPOLICY :: enum { + DWMNCRP_USEWINDOWSTYLE, + DWMNCRP_DISABLED, + DWMNCRP_ENABLED, + DWMNCRP_LAST, +} + @(default_calling_convention="stdcall") foreign dwmapi { DwmFlush :: proc() -> HRESULT --- + DwmIsCompositionEnabled :: proc(pfEnabled: ^BOOL) -> HRESULT --- + DwmExtendFrameIntoClientArea :: proc(hWnd: HWND, pMarInset: PMARGINS) -> HRESULT --- + DwmSetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: LPCVOID, cbAttribute: DWORD) -> HRESULT --- } diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin index d83d2aa6c..9e2294c71 100644 --- a/core/sys/windows/gdi32.odin +++ b/core/sys/windows/gdi32.odin @@ -79,6 +79,8 @@ foreign gdi32 { TextOutW :: proc(hdc: HDC, x, y: c_int, lpString: LPCWSTR, c: c_int) -> BOOL --- GetTextExtentPoint32W :: proc(hdc: HDC, lpString: LPCWSTR, c: c_int, psizl: LPSIZE) -> BOOL --- GetTextMetricsW :: proc(hdc: HDC, lptm: LPTEXTMETRICW) -> BOOL --- + + CreateSolidBrush :: proc(color: COLORREF) -> HBRUSH --- } RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF { diff --git a/core/sys/windows/shell32.odin b/core/sys/windows/shell32.odin index 28da58a50..2ac84fbba 100644 --- a/core/sys/windows/shell32.odin +++ b/core/sys/windows/shell32.odin @@ -22,4 +22,37 @@ foreign shell32 { ) -> c_int --- SHFileOperationW :: proc(lpFileOp: LPSHFILEOPSTRUCTW) -> c_int --- SHGetFolderPathW :: proc(hwnd: HWND, csidl: c_int, hToken: HANDLE, dwFlags: DWORD, pszPath: LPWSTR) -> HRESULT --- + SHAppBarMessage :: proc(dwMessage: DWORD, pData: PAPPBARDATA) -> UINT_PTR --- } + +APPBARDATA :: struct { + cbSize: DWORD, + hWnd: HWND, + uCallbackMessage: UINT, + uEdge: UINT, + rc: RECT, + lParam: LPARAM, +} +PAPPBARDATA :: ^APPBARDATA + +ABM_NEW :: 0x00000000 +ABM_REMOVE :: 0x00000001 +ABM_QUERYPOS :: 0x00000002 +ABM_SETPOS :: 0x00000003 +ABM_GETSTATE :: 0x00000004 +ABM_GETTASKBARPOS :: 0x00000005 +ABM_ACTIVATE :: 0x00000006 +ABM_GETAUTOHIDEBAR :: 0x00000007 +ABM_SETAUTOHIDEBAR :: 0x00000008 +ABM_WINDOWPOSCHANGED :: 0x0000009 +ABM_SETSTATE :: 0x0000000a +ABN_STATECHANGE :: 0x0000000 +ABN_POSCHANGED :: 0x0000001 +ABN_FULLSCREENAPP :: 0x0000002 +ABN_WINDOWARRANGE :: 0x0000003 +ABS_AUTOHIDE :: 0x0000001 +ABS_ALWAYSONTOP :: 0x0000002 +ABE_LEFT :: 0 +ABE_TOP :: 1 +ABE_RIGHT :: 2 +ABE_BOTTOM :: 3 diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin index 210c39aaa..1d5bdaf04 100644 --- a/core/sys/windows/types.odin +++ b/core/sys/windows/types.odin @@ -38,6 +38,7 @@ HHOOK :: distinct HANDLE HKEY :: distinct HANDLE HDESK :: distinct HANDLE HFONT :: distinct HANDLE +HRGN :: distinct HANDLE BOOL :: distinct b32 BYTE :: distinct u8 BOOLEAN :: distinct b8 diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index 56de9ce4d..f59bdf9e3 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -205,6 +205,17 @@ foreign user32 { GetRawInputDeviceList :: proc(pRawInputDeviceList: PRAWINPUTDEVICELIST, puiNumDevices: PUINT, cbSize: UINT) -> UINT --- GetRegisteredRawInputDevices :: proc(pRawInputDevices: PRAWINPUTDEVICE, puiNumDevices: PUINT, cbSize: UINT) -> UINT --- RegisterRawInputDevices :: proc(pRawInputDevices: PCRAWINPUTDEVICE, uiNumDevices: UINT, cbSize: UINT) -> BOOL --- + + SetLayeredWindowAttributes :: proc(hWnd: HWND, crKey: COLORREF, bAlpha: BYTE, dwFlags: DWORD) -> BOOL --- + + FillRect :: proc(hDC: HDC, lprc: ^RECT, hbr: HBRUSH) -> int --- + EqualRect :: proc(lprc1: ^RECT, lprc2: ^RECT) -> BOOL --- + + GetWindowInfo :: proc(hwnd: HWND, pwi: PWINDOWINFO) -> BOOL --- + GetWindowPlacement :: proc(hWnd: HWND, lpwndpl: ^WINDOWPLACEMENT) -> BOOL --- + SetWindowRgn :: proc(hWnd: HWND, hRgn: HRGN, bRedraw: BOOL) -> int --- + CreateRectRgnIndirect :: proc(lprect: ^RECT) -> HRGN --- + GetSystemMetricsForDpi :: proc(nIndex: int, dpi: UINT) -> int --- } CreateWindowW :: #force_inline proc "stdcall" ( @@ -435,3 +446,27 @@ RI_MOUSE_BUTTON_5_DOWN :: 0x0100 RI_MOUSE_BUTTON_5_UP :: 0x0200 RI_MOUSE_WHEEL :: 0x0400 RI_MOUSE_HWHEEL :: 0x0800 + +WINDOWPLACEMENT :: struct { + length: UINT, + flags: UINT, + showCmd: UINT, + ptMinPosition: POINT, + ptMaxPosition: POINT, + rcNormalPosition: RECT, + rcDevice: RECT, +} + +WINDOWINFO :: struct { + cbSize: DWORD, + rcWindow: RECT, + rcClient: RECT, + dwStyle: DWORD, + dwExStyle: DWORD, + dwWindowStatus: DWORD, + cxWindowBorders: UINT, + cyWindowBorders: UINT, + atomWindowType: ATOM, + wCreatorVersion: WORD, +} +PWINDOWINFO :: ^WINDOWINFO \ No newline at end of file diff --git a/core/sys/windows/ux_theme.odin b/core/sys/windows/ux_theme.odin new file mode 100644 index 000000000..39b489bc0 --- /dev/null +++ b/core/sys/windows/ux_theme.odin @@ -0,0 +1,12 @@ +// +build windows +package sys_windows + +foreign import uxtheme "system:UxTheme.lib" + +MARGINS :: distinct [4]int +PMARGINS :: ^MARGINS + +@(default_calling_convention="stdcall") +foreign uxtheme { + IsThemeActive :: proc() -> BOOL --- +} diff --git a/vendor/cgltf/lib/cgltf.lib b/vendor/cgltf/lib/cgltf.lib new file mode 100644 index 000000000..0d7ea6f9b Binary files /dev/null and b/vendor/cgltf/lib/cgltf.lib differ