Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct GLFWvidmode {
- width : int,
- height : int,
- redBits : int,
- blueBits : int,
- greenBits : int
- }
- extern mod glfw3 {
- fn glfwGetVideoModes(count: &mut c_int) -> *GLFWvidmode;
- fn glfwGetDesktopMode(mode: &mut GLFWvidmode);
- }
- fn glfwGetVideoModes() -> ~[GLFWvidmode] {
- let mut count = 0;
- let mut mode_ptr: *GLFWvidmode;
- let mut modes: ~[GLFWvidmode];
- unsafe {
- mode_ptr = glfw3::glfwGetVideoModes(&mut count);
- modes = vec::unsafe::from_buf(mode_ptr, count as uint);
- }
- return modes;
- }
- fn glfwGetDesktopMode() -> GLFWvidmode {
- let mut mode = GLFWvidmode { width: 0, height : 0, redBits: 0, blueBits: 0, greenBits: 0 };
- unsafe { glfw3::glfwGetDesktopMode(&mut mode); }
- return mode;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement