Add Translate C to build.zig, remove @cImport from graphics.zig - #3039
Merged
Conversation
IntegratedQuantum
requested changes
May 6, 2026
IntegratedQuantum
requested changes
May 7, 2026
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
IntegratedQuantum
requested changes
May 7, 2026
| const game = main.game; | ||
| const graphics = main.graphics; | ||
| const c = graphics.c; | ||
| const c = @import("c"); |
Member
There was a problem hiding this comment.
Could you please reorder them to be in a new block? Each module import and subimports should be in its own block.
Contributor
Author
There was a problem hiding this comment.
I tried changing just Entity.zig. Is this how it should be?
| } | ||
|
|
||
| pub fn render() void { | ||
| const c = @import("c"); |
Member
There was a problem hiding this comment.
All module importants should be done at the top of the file, please apply this to the other files as well.
IntegratedQuantum
requested changes
May 8, 2026
| const models = @import("models.zig"); | ||
| const network = @import("network.zig"); | ||
| const settings = @import("settings.zig"); | ||
|
|
Member
There was a problem hiding this comment.
This is actually incorrect, these are not real imports, they are legacy code (see #2950) and will be converted to main. at some point, so please leave them like they were and just put c at the bottom.
| @cInclude("hb.h"); | ||
| @cInclude("hb-ft.h"); | ||
| }); | ||
| const c = @import("c"); |
Member
There was a problem hiding this comment.
Could you move the c at the bottom, always below main?
IntegratedQuantum
approved these changes
May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Progress towards #2930.
graphics.zig seemed the most complex so it's a good first file to discuss the move.
Mostly followed example from https://ziglang.org/download/0.16.0/release-notes.html#cImport-Moving-to-Build-System.
All C import consts in graphics.zig were renamed to c.
I don't have the knowledge to write better comments on the c.h file.
Builds, passes tests and plays fine on Windows x86. I have no way to test that that MACH preproc actually works on macOS.