Created
September 26, 2010 15:33
-
-
Save podhmo/598026 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; draw pixels | |
(add-load-path "../") | |
(use gl.processing) | |
(use graphics.imlib2) | |
(use util.match) | |
(define *image-file* "a.jpg") | |
(define (load) | |
(let1 img (load-image *image-file*) | |
(values (image-width img) | |
(image-height img) | |
(image-data-gl-pixels img :alpha #t)))) | |
(define main | |
(receive (w h image) (load) | |
(setup$ | |
(lambda () | |
(gl-pixel-store GL_UNPACK_ALIGNMENT 1) | |
(window w h "example5" 100 100)) | |
:reshape 2d-elastic-reshape$ | |
:draw (draw-once$ | |
(cut gl-draw-pixels w h GL_RGBA GL_UNSIGNED_BYTE image))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:reshape の部分(2d-elastic-reshape$ 100 100)だった。これがあると画像のサイズにあわせてオブジェクトが拡大/縮小するようにしていた。
…つもりだったけれど、gl-draw-pixelsには効果がないみたい。