Permalink
Browse files

Added mode to OSX-VIDEO-MODE struct.

  • Loading branch information...
1 parent 64dc7ea commit 2fa089a4c0229f8560c75a533db69df0eee6a971 @jtza8 jtza8 committed with patzy Sep 8, 2011
Showing with 11 additions and 6 deletions.
  1. +6 −4 src/osx/bridge.lisp
  2. BIN src/osx/bridge/bridge.dylib
  3. +2 −0 src/osx/bridge/bridge.m
  4. +3 −2 src/utils.lisp
View
10 src/osx/bridge.lisp
@@ -23,7 +23,8 @@
(width :int)
(height :int)
(refresh :double)
- (depth :int))
+ (depth :int)
+ (mode :pointer))
(defcfun ("getDisplayModeInfoArray" get-display-mode-info-array) :pointer
(size :pointer))
(defcfun ("makeAutoreleasePool" make-autorelease-pool) :pointer)
@@ -45,12 +46,13 @@
(unwind-protect
(loop for i below (mem-ref array-size :long)
collect (with-foreign-slots
- ((width height refresh depth)
+ ((width height refresh depth mode)
(mem-aref modes 'display-mode-info i)
display-mode-info)
(glop::make-osx-video-mode
:width width
:height height
- :rate (truncate refresh)
- :depth depth)))
+ :rate refresh
+ :depth depth
+ :mode mode)))
(foreign-free modes)))))
View
BIN src/osx/bridge/bridge.dylib
Binary file not shown.
View
2 src/osx/bridge/bridge.m
@@ -9,6 +9,7 @@
int height;
double refresh;
int depth;
+ CGDisplayModeRef mode;
} DisplayModeInfo;
typedef struct iterator {
@@ -39,6 +40,7 @@ void setDisplayInfo (const void *value, void *context)
info->height = CGDisplayModeGetHeight(mode);
info->refresh = CGDisplayModeGetRefreshRate(mode);
info->depth = displayModeGetDepth(mode);
+ info->mode = mode;
((Iterator *)context)->pointer += sizeof(DisplayModeInfo);
}
View
5 src/utils.lisp
@@ -4,7 +4,7 @@
(width 0 :type integer)
(height 0 :type integer)
(depth 0 :type integer)
- (rate 0 :type integer))
+ (rate 0 :type double-float))
;; platform specific windows
;; XXX: this may move to platform specific directories
@@ -34,7 +34,8 @@
(index -1 :type integer))
#+darwin
-(defstruct (osx-video-mode (:include video-mode)))
+(defstruct (osx-video-mode (:include video-mode))
+ mode)
;; base window structure
;; you may inherit your own window class from this

0 comments on commit 2fa089a

Please sign in to comment.