diff options
Diffstat (limited to 'bytepusher.scm')
-rw-r--r-- | bytepusher.scm | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/bytepusher.scm b/bytepusher.scm index d72aaf4..2a3eb67 100644 --- a/bytepusher.scm +++ b/bytepusher.scm @@ -89,15 +89,6 @@ ;; debug ---- -(define (get-pixels) - (let* ((initial (get-initial-pixel)) - (len (* width height)) - (base (make-bytevector len))) - (bytevector-copy! memory initial base 0 len) - (uint-list->bytevector - (map pixel->color-fast (bytevector->u8-list base)) - (endianness big) - 4))) (define (peek-memory start end) (for-each (lambda (i) (display "0x") @@ -126,6 +117,20 @@ ;; rendering ---- +(define (get-pixels) + (let* ((initial (get-initial-pixel)) + (len (* width height)) + (base (make-bytevector len)) + (final (make-bytevector (* 4 len)))) + (bytevector-copy! memory initial base 0 len) + (let loop ((i 0)) + (bytevector-u32-set! final + (* 4 i) + (pixel->color-fast (bytevector-u8-ref base i)) + (endianness big)) + (unless (= i (- len 1)) (loop (+ 1 i)))) + final)) + (define (make-display-texture renderer) (make-texture renderer 'argb8888 'streaming width height)) |