-
Notifications
You must be signed in to change notification settings - Fork 9
add bindings necessary for creating windows and opengl contexts #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
.{ | ||
.name = .zwindows, | ||
.fingerprint = 0x263908d4bb75c6c4, | ||
.fingerprint = 0x263908d417b0d996, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to put this in the pull request, but I couldn't figure out how to do that, I mainly did this because of reading somewhere that this was necessary for forks of a repository. This is purely for the sake of my own fork existing without conflicts. Sorry about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to change this. For forks created for the purpose of authoring pull requests, it's not worth changing. It should be changed in the case of a proper fork that you want to differentiate from the original repo, in which case you can also keep an upstream-contrib branch with the commit that changes it deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Windows API bindings necessary for creating windows and OpenGL contexts that were missing from the original repository. It significantly expands the available bindings to enable complete window and OpenGL context management without requiring additional user-defined bindings.
- Adds essential window management functions (ShowWindow, IsWindow, SetWindowPos)
- Introduces OpenGL context creation and management functions (wglCreateContext, wglDeleteContext, wglMakeCurrent, wglGetProcAddress)
- Adds pixel format functions and PIXELFORMATDESCRIPTOR structure for OpenGL initialization
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
src/bindings/windows.zig | Adds window management functions, OpenGL bindings, window/class style constants, and PIXELFORMATDESCRIPTOR structure |
build.zig.zon | Updates fingerprint to reflect code changes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
the original repo seemed to have been missing bindings for some functions that are necessary for creating, using and modifying windows as well as opengl contexts.
those functions including
ShowWindow
IsWindow
SetWindowPos
DescribePixelFormat
ChoosePixelFormat
SetPixelFormat
SwapBuffers
wglCreateContext
wglDeleteContext
wglMakeCurrent
wglGetProcAddress
it also adds comptime_int values that weren't there before, like the class styles, whatever was left of the window styles, and stuff related to PIXELFORMATDESCRIPTOR(which was also added as this is necessary for opengl to work).
it should now be possible to successfully create a window and an opengl context using what's provided without needing to define more bindings on the user end.