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

Support statically-linked libEGL? (On Windows) #997

Closed
SimonSapin opened this issue Mar 4, 2018 · 3 comments
Closed

Support statically-linked libEGL? (On Windows) #997

SimonSapin opened this issue Mar 4, 2018 · 3 comments

Comments

@SimonSapin
Copy link
Contributor

SimonSapin commented Mar 4, 2018

https://github.com/servo/mozangle compiles ANGLE, on Windows with an EGL implementation. To avoid the complication of shipping .dll files separately, it is linked as a static library.

Glutin supports EGL on Windows, but loads it from a dynamic library like libEGL.dll. What do you think of adding support for statically-linked EGL?

Conditionally having something like extern { fn eglGetProcAddress(…) } directly in Glutin would require a compile-time flag, which isn’t great. So maybe that function could be (optionally) provided by users:

impl<'a> ContextBuilder<'a> {
    pub fn with_egl_get_proc_address<F>(mut self, get_proc_address: F) -> Self
        where F: Fn(&str) -> *const c_void
    {
        self.egl_get_proc_address = Some(Box::new(get_proc_address))
        self
    }
}

Since this is only relevant on Windows, maybe it should be in a glutin::os::windows::ContextBuilderExt trait.

Or maybe something more automagic could be made with weak symbols, but those don’t seem to be available in Stable Rust.

Thoughts?

@jdm
Copy link
Contributor

jdm commented May 31, 2019

The original motivating example of https://github.com/servo/mozangle/ is no longer relevant. We have since modified the build to generate a libEGL.dll on Windows if desired.

@SimonSapin
Copy link
Contributor Author

@jdm Does this involve a build system around Cargo copying the dll file to the right place?

@jdm
Copy link
Contributor

jdm commented Jun 1, 2019

It does, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants