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

Fixing core to work with win32 #1257 #1258

Merged
merged 1 commit into from
Aug 25, 2024
Merged

Conversation

hordurj
Copy link
Contributor

@hordurj hordurj commented Aug 25, 2024

Use core.state()
Moved dispatch call from a system to its own function.
Set a default vsync mode in win32. There are some stability issues when free running.

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

@@ -348,6 +348,10 @@ pub fn start(core: *Mod) !void {
}
}

fn dispatch(stack_space: []u8) void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason this intermediate function call is needed? Or, what error do you get without this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the error I get is

src\module\module.zig:325:27: error: unable to resolve inferred error set
            try m.dispatch(stack_space, .{

without digging much deeper my assumption was might be occurring because it was being called from a "system" which is analyzed when creating the .Mod.

I saw platform_update_callback did not have this issue. That is why I created a function dispatch that would catch the error and not propagate the error thus breaking the loop when the compiler is determining the error set.

@@ -130,6 +130,7 @@ pub fn init(
self.border = options.border;
self.headless = options.headless;
self.refresh_rate = 60; // TODO (win32) get monitor refresh rate
self.vsync_mode = .triple;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed #1259

@slimsag slimsag merged commit 13e53e7 into hexops:main Aug 25, 2024
2 of 3 checks passed
@hordurj hordurj deleted the core_1257 branch August 25, 2024 19:26
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