test2   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/drawing.xtm

Implementation

;; draw animated circles to an opengl context
(bind-func test2
  (let ((surface (cairo_image_surface_create CAIRO_FORMAT_RGB24 900 600))
  (image (cairo_image_surface_create_from_png "/path/to/image.png"))
  (cr (cairo_create surface))
  (i 0.0)
  (width 0.0)
  (height 0.0))
    (lambda (t:double)
      ;; scale image to fullscreen background
      (set! width (i32tod (cairo_image_surface_get_width image)))
      (set! height (i32tod (cairo_image_surface_get_height image)))
      (cairo_draw_image cr image 0.0 0.0 width height 0.0 0.0 900.0 600.0)


Back to Index

Similar Entries