Skip to content

Conversation

sonicjason255
Copy link

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.

.{
.name = .zwindows,
.fingerprint = 0x263908d4bb75c6c4,
.fingerprint = 0x263908d417b0d996,
Copy link
Member

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

Copy link
Author

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.

Copy link
Member

@hazeycode hazeycode Sep 14, 2025

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.

@hazeycode hazeycode requested a review from Copilot September 7, 2025 11:10
Copy link

@Copilot Copilot AI left a 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>
@hazeycode hazeycode requested a review from Copilot September 14, 2025 01:17
Copilot

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants