-
Notifications
You must be signed in to change notification settings - Fork 42
Add C language examples alongside C++ in Vulkan tutorials #202
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
- Include equivalent C code snippets for all Vulkan-related examples to enhance tutorial compatibility. - Annotate source blocks to specify programming languages for clarity (`[source,multilang,c++,c]`). - Improve cross-language consistency in method signatures, helper functions, and setup instructions.
|
NOTE: this is an in-progress work to test the site and to gradually migrate all code blocks to handle both C-API and current C++. Don't merge until all relevant code blocks have been addressed and the test site validates that this works as intended. |
|
For organizational purposes, I will keep track of chapters I am adjusting and their linked pull requests in this comment. All request changes are provided in this PR.
|
| // END c++ | ||
| // START c | ||
| VkBufferCreateInfo bufferInfo{}; |
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 use designated initializers, just like the code a few lines below.
| void createVertexBuffer() { | ||
| VkBufferCreateInfo bufferInfo = { | ||
| .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, | ||
| .pNext = NULL, |
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.
More of a general question: Do we want to always set all fields, or should we omit those that are not set/required? In this case pNext and flags is not used and zeroed out when using designated initializers.
[source,multilang,c++,c]).NOTE: Please do NOT merge until KhronosGroup/Vulkan-Site#141 is live. This depends upon that.