std.os.windows additions and fixes #17705
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses issues I have found with
std.os.windows
while using it.std.os.windows
PROC
typeHRESULT_CODE
macrostd.os.windows.opengl32 (new)
wglCreateContext
from gdi32wglMakeCurrent
from gdi32wglCreateContext
using incorrect typeswglMakeCurrent
using incorrect typeswglCreateContext
wglMakeCurrent
wglDeleteContext
+ zig wrapperwglGetProcAddress
std.os.windows.dwmapi (new)
DwmFlush
+ zig wrapperstd.os.windows.gdi32
PIXELFORMATDESCRIPTOR
SetPixelFormat
using incorrect typesSetPixelFormat
ChoosePixelFormat
using incorrect typesChoosePixelFormat
DescribePixelFormat
+ zig wrapperwglCreateContext
andwglMakeCurrent
to opengl32SwapBuffers
using incorrect typesSwapBuffers
std.os.windows.kernel32
GetFileAttributesW
using incorrect types ([*]const WCHAR
instead of[*:0]const WCHAR
)GetProcAddress
using incorrect types ([*]const u8
instead of[*:0]const u8
)std.os.windows.user32
WaitMessage
+ zig wrapperMsgWaitForMultipleObjects
+ zig wrapperGetQueueStatus
QS_*
constantsMINMAXINFO
structSetPropA
+ zig wrapperSetPropW
+ zig wrapperGetPropA
GetPropW
GetClientRect
+ zig wrapperGetWindowRect
+ zig wrapperSetWindowPos
+ zig wrapperSWP_*
constantsHWND_*
constantsLoadCursorA
+ zig wrapperLoadCursorW
+ zig wrapperIDC_*
cursor constantsGetSystemMetrics
GetSystemMetricsForDpi
+ zig wrapperSM_*
constantsARW_*
constantsNID_*
constantsI am unsure about the names for opengl32 zig wrappers. The convention seems to be using lowercase, but wgl* functions are already lowercase, so I added a "Z" at the end for now. Perhaps removing the wgl prefix and using lowercase is the way to go?
I am also unsure about the
IDC_
constants. In C they are casted into the correct type (LPCSTR, LPCWSTR) depending on the defined character set. Currently passing them to LoadCursor* requires@ptrFromInt(IDC_*)
.Note that I am an on-and-off unexperienced Zig user, and a first time contributor, so I hope I didn't butcher any of the syntax.