How to get the width and the height in glium?

660 Views Asked by At

I'm using glium in Rust. I want to get the width and the height.

I can't write and understand English well, because I'm Japanese. Maybe my English has some problems so I'm sorry.

1

There are 1 best solutions below

0
On BEST ANSWER

As I mentioned in the comments section, there's a Display::get_framebuffer_dimensions, so if you have the glium::Display object around, you can extract the dimensions of the OpenGL context using it.

pub fn get_framebuffer_dimensions(&self) -> (u32, u32)

Calls get_framebuffer_dimensions on the backend object stored by this context.