Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.
/ trial Public archive

Commit 7442f7a

Browse files
committed
Minor
1 parent 7da66da commit 7442f7a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

resources/framebuffer.lisp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@
5252
(with-gl-binding (:framebuffer (gl-name framebuffer))
5353
(dolist (attachment attachments)
5454
(destructuring-bind (attachment texture &key (level 0) layer &allow-other-keys) attachment
55-
(setf (width framebuffer) (width texture))
56-
(setf (height framebuffer) (height texture))
5755
(if layer
5856
(%gl:framebuffer-texture-layer :framebuffer attachment (gl-name texture) level layer)
5957
(%gl:framebuffer-texture :framebuffer attachment (gl-name texture) level))))
@@ -108,11 +106,12 @@
108106

109107
(defmethod (setf attachments) :before (attachments (framebuffer framebuffer))
110108
(when (and (allocated-p framebuffer) (not (equal attachments (attachments framebuffer))))
111-
(when attachments
112-
(setf (width framebuffer) NIL)
113-
(setf (height framebuffer) NIL))
114109
(with-cleanup-on-failure (bind-framebuffer-attachments framebuffer (attachments framebuffer))
115-
(%bind-framebuffer-attachments framebuffer attachments))))
110+
(%bind-framebuffer-attachments framebuffer attachments)
111+
(when attachments
112+
(let ((texture (second (first attachments))))
113+
(setf (width framebuffer) (width texture))
114+
(setf (height framebuffer) (height texture)))))))
116115

117116
(defmethod allocate ((framebuffer framebuffer))
118117
(let ((fbo (gl:gen-framebuffer)))

0 commit comments

Comments
 (0)