Skip to content
Permalink
Browse files

Fix fullscreenable from causing global C inits.

  • Loading branch information...
Shinmera committed Jul 20, 2019
1 parent a133cff commit bcacc138d601ef99c92258148e87a40c2dc628d6
Showing with 14 additions and 13 deletions.
  1. +0 −2 deploy.lisp
  2. +14 −11 fullscreenable.lisp
@@ -16,12 +16,10 @@
(setf *standalone* T))

(deploy:define-hook (:build trial) ()
(cl-monitors:deinit)
(v:remove-global-controller))

(deploy:define-hook (:boot trial) ()
(v:restart-global-controller)
(cl-monitors:init)
(setf *random-state* (make-random-state T)))

(deploy:define-library cl-opengl-bindings::opengl
@@ -8,19 +8,24 @@

(defclass fullscreenable (display)
((original-mode :initform NIL :accessor original-mode)
(resolution :accessor resolution)
(fullscreen :accessor fullscreen))
(resolution :initarg :resolution :accessor resolution)
(fullscreen :initarg :fullscreen :accessor fullscreen))
(:default-initargs
:resolution (list 800 600)
:fullscreen NIL))

(defmethod initialize-instance :after ((fullscreenable fullscreenable) &key resolution fullscreen)
(setf (original-mode fullscreenable) (cl-monitors:mode
(dolist (monitor (cl-monitors:detect))
(when (cl-monitors:primary-p monitor)
(return monitor)))))
(setf (resolution fullscreenable) resolution)
(setf (fullscreen fullscreenable) fullscreen))
(defmethod start :after ((fullscreenable fullscreenable))
(cl-monitors:init)
(setf (original-mode fullscreenable)
(cl-monitors:mode
(dolist (monitor (cl-monitors:detect))
(when (cl-monitors:primary-p monitor)
(return monitor)))))
(setf (resolution fullscreenable) (resolution fullscreenable))
(setf (fullscreen fullscreenable) (fullscreen fullscreenable)))

(defmethod stop :after ((fullscreenable fullscreenable))
(cl-monitors:deinit))

(defmethod finalize :after ((fullscreenable fullscreenable))
(setf (resolution fullscreenable) NIL))
@@ -41,5 +46,3 @@

(defmethod (setf fullscreen) :before (fullscreen (fullscreenable fullscreenable))
(show (context fullscreenable) :fullscreen fullscreen))

(cl-monitors:init)

0 comments on commit bcacc13

Please sign in to comment.
You can’t perform that action at this time.