Advertisement
bjz

Untitled

bjz
Sep 12th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. struct GLFWvidmode {
  2. width : int,
  3. height : int,
  4. redBits : int,
  5. blueBits : int,
  6. greenBits : int
  7. }
  8.  
  9. extern mod glfw3 {
  10. fn glfwGetVideoModes(count: &mut c_int) -> *GLFWvidmode;
  11. fn glfwGetDesktopMode(mode: &mut GLFWvidmode);
  12. }
  13.  
  14. fn glfwGetVideoModes() -> ~[GLFWvidmode] {
  15. let mut count = 0;
  16. let mut mode_ptr: *GLFWvidmode;
  17. let mut modes: ~[GLFWvidmode];
  18. unsafe {
  19. mode_ptr = glfw3::glfwGetVideoModes(&mut count);
  20. modes = vec::unsafe::from_buf(mode_ptr, count as uint);
  21. }
  22. return modes;
  23. }
  24.  
  25. fn glfwGetDesktopMode() -> GLFWvidmode {
  26. let mut mode = GLFWvidmode { width: 0, height : 0, redBits: 0, blueBits: 0, greenBits: 0 };
  27. unsafe { glfw3::glfwGetDesktopMode(&mut mode); }
  28. return mode;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement