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

32 bit windows does not compile #1188

Open
bluesillybeard opened this issue Apr 1, 2024 · 0 comments
Open

32 bit windows does not compile #1188

bluesillybeard opened this issue Apr 1, 2024 · 0 comments
Labels
feedback needs-triage Issues that need triaging

Comments

@bluesillybeard
Copy link

I am working on an application that will support 32 bit windows.

It fails to compile due to the calling convention of OpenGL functions changing. The workaround is simple though, in my application I can call the plain GLFW function:

    fn loadProc(context: void, function: [:0]const u8) ?gl.FunctionPointer {
        _ = context;
        // If we are on windows x86 32 bit, OpenGL functions use stdcall for some reason.
        // As such, we have to handle that case.
        if(builtin.os.tag == .windows and builtin.cpu.arch == .x86){
            // get the extern function
            const glfwc = struct {
                extern fn glfwGetProcAddress([*c]const u8) *anyopaque;
            };
            return @ptrCast(glfwc.glfwGetProcAddress(function.ptr));
        }
        return @ptrCast(glfw.getProcAddress(function));
    }

Once it is compiled, when run through wine it has an access violation. That seems to be a problem with wine, as the app works fine in regular Windows. (It fails to make a window due to it running in a virtual machine, but GLFW itself initializes just fine)

@bluesillybeard bluesillybeard added feedback needs-triage Issues that need triaging labels Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback needs-triage Issues that need triaging
Projects
None yet
Development

No branches or pull requests

1 participant