From f32c421b04753e857d2f311843f5f50fda513a2f Mon Sep 17 00:00:00 2001 From: William Robinson Date: Tue, 16 Oct 2007 18:58:30 +0100 Subject: [PATCH] Added listmodes example and fixed some bugs it brought up. --- examples/listmodes.lisp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 examples/listmodes.lisp diff --git a/examples/listmodes.lisp b/examples/listmodes.lisp new file mode 100644 index 0000000..8bd3bb2 --- /dev/null +++ b/examples/listmodes.lisp @@ -0,0 +1,15 @@ +(require '#:asdf) +(asdf:oos 'asdf:load-op '#:cl-glfw) + +(glfw:init) + +(destructuring-bind (width height redbits greenbits bluebits) (glfw:get-desktop-mode) + (format t "Desktop mode: ~d x ~d x ~d~%" width height (+ redbits greenbits bluebits))) + +(format t "Available modes:~%") +(loop for i from 0 + for mode in (glfw:get-video-modes 400) + do (destructuring-bind (width height redbits greenbits bluebits) mode + (format t "~3d: ~d x ~d x ~d~%" i width height (+ redbits greenbits bluebits)))) + +(glfw:terminate) -- 2.11.4.GIT