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

Can't create a legacy OpenGL context #1443

Closed
cdecompilador opened this issue Aug 21, 2022 · 1 comment
Closed

Can't create a legacy OpenGL context #1443

cdecompilador opened this issue Aug 21, 2022 · 1 comment

Comments

@cdecompilador
Copy link

Specs

OS: Windows 11
A decent GPU

How to repro

fn main() {
        // Create the window and the event loop
        let event_loop = EventLoop::new();
        let window_builder = WindowBuilder::new();

        // Create the opengl context, make it the current one (selected) and 
        // load its functions from the graphics device into the current process
        let context = glutin::ContextBuilder::new()
            .with_gl(GlRequest::Specific(Api::OpenGl, (2, 1))) // <- the version
            .build_windowed(window_builder, &event_loop)
            .unwrap();
        let context = unsafe { context.make_current().unwrap() };
        if !context.is_current() {
            panic!("Couldn't make the context the currnt");
        }
        gl::load_with(|s| context.get_proc_address(s).cast());
        let version = unsafe {
            std::ffi::CStr::from_ptr(gl::GetString(gl::VERSION) as *const _)
                .to_str().unwrap_or("NOT LOADED")
        };
        println!("OpenGL version: {}", version);
}

Goes back to the latest version (4.6.0 in my case), it lets me use the 3.x versions without issue, 1.x, 2.x impossible

@kchibisov
Copy link
Member

kchibisov commented Sep 3, 2022

Fixed in #1435. If, not reopen an issue.

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

2 participants