mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
The example now prints OpenGL version
This commit is contained in:
parent
67349d717a
commit
66f6b003d0
|
@ -11,11 +11,20 @@ fn main() {
|
|||
|
||||
gl::load_with(|symbol| window.get_proc_address(symbol) as *const libc::c_void);
|
||||
|
||||
let version = {
|
||||
use std::c_str::CString;
|
||||
unsafe { CString::new(gl::GetString(gl::VERSION) as *const i8, false) }
|
||||
};
|
||||
|
||||
println!("OpenGL version {}", version.as_str().unwrap());
|
||||
|
||||
gl::ClearColor(0.0, 1.0, 0.0, 1.0);
|
||||
|
||||
while !window.should_close() {
|
||||
println!("{}", window.wait_events());
|
||||
|
||||
println!("pos: {}", window.get_position());
|
||||
|
||||
gl::Clear(gl::COLOR_BUFFER_BIT);
|
||||
|
||||
window.swap_buffers();
|
||||
|
|
Loading…
Reference in a new issue