Skip to content

Commit

Permalink
Use actual viewport size
Browse files Browse the repository at this point in the history
  • Loading branch information
borodust committed Jul 5, 2019
1 parent 2a451f6 commit 2113462
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions appkit/appkit.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@
(with-slots (framebuffer-size) app
(setf (ge.host:viewport-title) viewport-title
(ge.host:fullscreen-viewport-p) fullscreen-p
(ge.host:viewport-title) viewport-title
(ge.host:viewport-size) (vec2 viewport-width viewport-height))
(let ((pixel-ratio (viewport-pixel-ratio)))
(setf framebuffer-size (vec2 (* viewport-width pixel-ratio)
(* viewport-height pixel-ratio))))))
(ge.host:with-viewport-dimensions (actual-width actual-height)
(let ((pixel-ratio (viewport-pixel-ratio)))
(setf framebuffer-size (vec2 (* actual-width pixel-ratio)
(* actual-height pixel-ratio))))
(values actual-width actual-height))))


(defun update-frame-queue (app draw-rate act-rate)
Expand Down Expand Up @@ -138,16 +139,16 @@
(height (or viewport-height *default-viewport-height*)))
(>> (ge.host:for-host ()
(log/debug "Updating appkit host configuration")
(when fullscreen-p
(ge.host:with-viewport-dimensions (actual-width actual-height)
(setf width actual-width
height actual-height)))
(update-viewport app
(or viewport-title *default-viewport-title*)
width height fullscreen-p))
(ge.gx:for-graphics ()
(multiple-value-bind (actual-width actual-height)
(update-viewport app
(or viewport-title *default-viewport-title*)
width height fullscreen-p)
(list actual-width actual-height)))
(ge.gx:for-graphics ((actual-width actual-height))
(log/debug "Updating appkit graphics configuration")
(update-graphics app width height canvas-width canvas-height panel-classes))
(update-graphics app actual-width actual-height
canvas-width canvas-height
panel-classes))
(instantly ()
(log/debug "Updating framerate")
(ge.host:swap-buffers)
Expand Down Expand Up @@ -361,7 +362,7 @@
(defmethod enabling-flow list ((this appkit-system))
(>> (ge.host:for-host ()
(log/debug "Configuring host for appkit")
(* (viewport-pixel-ratio) (ge.host:viewport-scale)))
(ge.host:viewport-scale))
(ge.gx:for-graphics (pixel-ratio)
(log/debug "Configuring graphics for appkit")
(%initialize-graphics this pixel-ratio))
Expand Down

0 comments on commit 2113462

Please sign in to comment.