(bind-func gl_render
;; put the path to any TrueType (.ttf) font file here
(let ((font (dtx_open_font "assets/fonts/Arial.ttf" 24)))
(if (null? font)
(printf "Error opening font.\n"))
(lambda ()
(glClear GL_COLOR_BUFFER_BIT)
(glLoadIdentity)
;; scale so we can see the text in the window
(glScaled 0.005 0.005 0.00)
(glRotated (* 360.0 (random)) (random) 0.0 1.0)
;; set the RGB color for the text
(glColor3d (random) (random) (random))
(dtx_string "Look Ma!\n\nI'm drawing text\nin OpenGL!"))))