Permalink
Browse files

Resolved conflict.

  • Loading branch information...
2 parents 40bf03b + a1d424e commit 6e0a9b47c8fc5b1c21b755b41b9130b30035aecd @jtza8 jtza8 committed Apr 14, 2012
Showing with 53 additions and 39 deletions.
  1. +8 −5 src/glop.lisp
  2. +9 −3 src/osx/glop-osx.lisp
  3. +1 −1 src/osx/quartz.lisp
  4. +20 −15 src/utils.lisp
  5. +1 −1 src/win32/glop-win32.lisp
  6. +5 −5 src/win32/win32.lisp
  7. +9 −9 src/x11/glop-x11.lisp
View
@@ -156,15 +156,18 @@ Returns NIL if no match is found."
(defun toggle-fullscreen (window)
"Attempt to change display mode to the mode closest to geometry and
set window fullscreen state."
- (if (window-fullscreen window)
- (progn (set-fullscreen window nil)
- (set-video-mode (window-previous-video-mode window)))
- (progn (setf (window-previous-video-mode window) (current-video-mode))
+ (cond
+ ((and (window-previous-video-mode window) (window-fullscreen window))
+ (progn (set-fullscreen window nil)
+ (set-video-mode (window-previous-video-mode window))
+ (setf (window-previous-video-mode window) nil)))
+ ((not (window-fullscreen window))
+ (progn (setf (window-previous-video-mode window) (current-video-mode))
(set-video-mode (closest-video-mode (current-video-mode)
(list-video-modes)
(window-width window)
(window-height window)))
- (set-fullscreen window t))))
+ (set-fullscreen window t)))))
(defgeneric set-geometry (window x y width height)
(:documentation
View
@@ -282,15 +282,21 @@
(list-video-modes)
(window-width window)
(window-height window))))
- (set-video-mode fullscreen-mode)
+ (glop-bridge:capture-all-displays)
+ (glop-bridge:set-display-mode
+ (glop-bridge:main-display-id)
+ (video-mode-mode fullscreen-mode)
+ (cffi:null-pointer))
(glop-bridge:ns-opengl-context-clear-drawable gl-context)
(glop-bridge:ns-opengl-context-set-full-screen gl-context)
(setf (window-fullscreen window) t
*fullscreen-active* t)
(push-expose-event window))
(progn
- (set-video-mode *native-video-mode*)
- (release-displays)
+ (glop-bridge:set-display-mode
+ (glop-bridge:main-display-id)
+ (video-mode-mode *native-video-mode*)
+ (cffi:null-pointer))
(glop-bridge:ns-opengl-context-clear-drawable gl-context)
(glop-bridge:ns-opengl-context-set-view gl-context gl-view)
(setf (window-fullscreen window) nil
View
@@ -11,7 +11,7 @@
(declaim (inline display-to-video-mode))
(defun translate-to-video-mode (mode)
- (glop::make-osx-video-mode
+ (glop::make-video-mode
:width (mode-width mode)
:height (mode-height mode)
:rate (mode-rate mode)
View
@@ -1,10 +1,25 @@
(in-package #:glop)
-(defstruct video-mode
+#+(or win32 windows)
+(defstruct win32-video-mode
+ (rate 0 :type integer))
+
+#+(and unix (not darwin))
+(defstruct x11-video-mode
+ (rate 0 :type integer)
+ (index -1 :type integer))
+
+#+darwin
+(defstruct osx-video-mode
+ (rate 0 :type double-float)
+ mode)
+
+(defstruct (video-mode (:include #+(and unix (not darwin)) x11-video-mode
+ #+(and win32 windows) win32-video-mode
+ #+darwin osx-video-mode))
(width 0 :type integer)
(height 0 :type integer)
- (depth 0 :type integer)
- (rate 0 :type double-float))
+ (depth 0 :type integer))
;; platform specific windows
;; XXX: this may move to platform specific directories
@@ -17,9 +32,6 @@
(dc :accessor win32-window-dc)
(id :accessor win32-window-id)))
-#+(or win32 windows)
-(defstruct (win32-video-mode (:include video-mode)))
-
#+(and unix (not darwin))
(defclass x11-window ()
((display :initarg :display :accessor x11-window-display)
@@ -29,10 +41,6 @@
(fb-config :accessor x11-window-fb-config)
(cursor :accessor x11-window-cursor)))
-#+(and unix (not darwin))
-(defstruct (x11-video-mode (:include video-mode))
- (index -1 :type integer))
-
#+darwin
(defclass osx-window ()
((ns-window :initform nil
@@ -44,10 +52,6 @@
(invert-mouse-y :initform nil
:accessor invert-mouse-y)))
-#+darwin
-(defstruct (osx-video-mode (:include video-mode))
- mode)
-
;; base window structure
;; you may inherit your own window class from this
(defclass window (#+(and unix (not darwin)) x11-window
@@ -61,7 +65,8 @@
(gl-context :accessor window-gl-context)
(pushed-event :initform nil :accessor window-pushed-event)
(fullscreen :initform nil :accessor window-fullscreen)
- (previous-video-mode :accessor window-previous-video-mode)))
+ (previous-video-mode :accessor window-previous-video-mode
+ :initform nil)))
(defun %update-geometry (win x y width height)
(setf (slot-value win 'x) x
@@ -9,7 +9,7 @@
(defmethod list-video-modes ()
(glop-win32::list-video-modes))
-(defmethod set-video-mode ((mode win32-video-mode))
+(defmethod set-video-mode ((mode video-mode))
(glop-win32::set-video-mode mode))
(defmethod current-video-mode ()
View
@@ -395,7 +395,7 @@
dmode devmode)
(setf size (foreign-type-size 'devmode))
(enum-display-settings (cffi:null-pointer) -1 dmode)
- (glop::make-win32-video-mode :width pels-width
+ (glop::make-video-mode :width pels-width
:height pels-height
:depth bits-per-pixel
:rate display-frequency))))
@@ -409,10 +409,10 @@
for res = (enum-display-settings (cffi:null-pointer) mode-index dmode)
do (incf mode-index)
until (zerop res)
- collect (glop::make-win32-video-mode :width pels-width
- :height pels-height
- :depth bits-per-pixel
- :rate display-frequency)))))
+ collect (glop::make-video-mode :width pels-width
+ :height pels-height
+ :depth bits-per-pixel
+ :rate display-frequency)))))
(defun set-video-mode (mode)
(let ((width (glop::video-mode-width mode))
View
@@ -17,24 +17,24 @@
for rate = (third res)
for index = (fourth res)
do (loop for depth in depth-list
- do (push (make-x11-video-mode :width width
- :height height
- :depth depth
- :rate rate
- :index index)
+ do (push (make-video-mode :width width
+ :height height
+ :depth depth
+ :rate rate
+ :index index)
modes)))))
modes))
-(defmethod set-video-mode ((mode x11-video-mode))
+(defmethod set-video-mode ((mode video-mode))
(glop-xlib::with-current-display dpy
- (glop-xlib::set-mode dpy 0 (x11-video-mode-index mode)
- (x11-video-mode-rate mode))))
+ (glop-xlib::set-mode dpy 0 (video-mode-index mode)
+ (video-mode-rate mode))))
(defmethod current-video-mode ()
(glop-xlib::with-current-display dpy
(multiple-value-bind (width height depth rate index)
(glop-xlib::current-mode dpy 0)
- (make-x11-video-mode :width width :height height :depth depth
+ (make-video-mode :width width :height height :depth depth
:rate rate :index index))))
(defstruct glx-context

0 comments on commit 6e0a9b4

Please sign in to comment.