summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-05-03 21:59:00 -0400
committerDavid Thompson <dthompson2@worcester.edu>2017-05-03 21:59:00 -0400
commit5b734df51ee6fd3882a9b6c90562d4a7bafc12e2 (patch)
tree17284c5081bfad4372d26a644bc4c03280014f87
parent4fa48196fbf633253e8a8272192df41468537d8e (diff)
buffer: Add docstrings to procedures.
* chickadee/buffer.scm: Add docstrings.
-rw-r--r--chickadee/buffer.scm7
1 files changed, 7 insertions, 0 deletions
diff --git a/chickadee/buffer.scm b/chickadee/buffer.scm
index 793215d..a7a22fc 100644
--- a/chickadee/buffer.scm
+++ b/chickadee/buffer.scm
@@ -118,6 +118,7 @@
(define *buffers* '())
(define (current-buffer)
+ "Return the current buffer."
(and (not (null? *buffers*))
(car *buffers*)))
@@ -144,11 +145,14 @@
(set! (buffer-started? new) #t)))))
(define (push-buffer! buffer)
+ "Pause the current buffer and switch to BUFFER."
(let ((old (current-buffer)))
(set! *buffers* (cons buffer *buffers*))
(switch-buffers old buffer)))
(define (pop-buffer!)
+ "Stop the current buffer and switch back to the previously active
+buffer, or terminate the game loop if the buffer stack is empty."
(let ((old (current-buffer)))
(set! *buffers* (cdr *buffers*))
(if (null? *buffers*)
@@ -158,11 +162,14 @@
(switch-buffers old (current-buffer) #t))))
(define (replace-buffer! buffer)
+ "Stop the current buffer and switch to BUFFER."
(let ((old (current-buffer)))
(set! *buffers* (cons buffer (cdr *buffers*)))
(switch-buffers old buffer #t)))
(define (use-buffers! initial-buffer)
+ "Install buffers into the game engine and set the current buffer to
+INITIAL-BUFFER."
(add-hook! load-hook
(lambda ()
(push-buffer! initial-buffer)))