Skip to content
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

Manually write binding for Surface.getCapabilities #7

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

PyryM
Copy link
Owner

@PyryM PyryM commented Jan 23, 2024

The C usage pattern for this function is idiosyncratic:
you're expected to create a WGPUSurfaceCapabilities, pass a pointer to it to wgpuSurfaceGetCapabilities(...),
which then sets internal pointers to arrays along with their element counts.

You do not own these arrays, instead when you're done you're expected to
free them with a separate function wgpuSurfaceCapabilitiesFreeMembers which takes the capabilities
struct by value and frees the internal pointers.

This is the only function in the API that works remotely like this so the binding has to be hand-written.

@PyryM PyryM merged commit ac58822 into main Jan 23, 2024
1 check passed
@PyryM PyryM deleted the fix/surfaceformats branch January 23, 2024 04:55
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.

1 participant