/usr/share/doc/gauche-gl/examples/glbook/example4-1.scm is in gauche-gl 0.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ;; Example 4-1 Drawing a Smooth-Shaded Triangle
(use gl)
(use gl.glut)
(define (init)
(gl-clear-color 0.0 0.0 0.0 0.0)
(gl-shade-model GL_SMOOTH))
(define (triangle)
(gl-begin GL_TRIANGLES)
(gl-color '#f32(1.0 0.0 0.0))
(gl-vertex '#f32(5.0 5.0))
(gl-color '#f32(0.0 1.0 0.0))
(gl-vertex '#f32(25.0 5.0))
(gl-color '#f32(0.0 0.0 1.0))
(gl-vertex '#f32(5.0 25.0))
(gl-end))
(define (disp)
(gl-clear GL_COLOR_BUFFER_BIT)
(triangle)
(gl-flush)
)
(define (reshape w h)
(gl-viewport 0 0 w h)
(gl-matrix-mode GL_PROJECTION)
(gl-load-identity)
(if (<= w h)
(glu-ortho-2d 0.0 30.0 0.0 (* 30.0 (/ h w)))
(glu-ortho-2d 0.0 (* 30.0 (/ w h)) 0.0 30.0))
(gl-matrix-mode GL_MODELVIEW)
)
(define (keyboard key x y)
(when (= key 27) (exit 0)))
(define (main args)
(glut-init args)
(glut-init-display-mode (logior GLUT_SINGLE GLUT_RGB))
(glut-init-window-size 500 500)
(glut-init-window-position 100 100)
(glut-create-window *program-name*)
(init)
(glut-display-func disp)
(glut-reshape-func reshape)
(glut-keyboard-func keyboard)
(glut-main-loop)
0)
|