Commit 894ed5e6 authored by John Croisant's avatar John Croisant

Updated tests and demos to work with CHICKEN 5.

But demos/opengl.scm does not currently work because it depends on
several eggs which have not been ported to CHICKEN 5 yet.
parent a7cd39b1
......@@ -25,8 +25,17 @@
;;; - Escape, Q, or close button: Quit
(use (prefix sdl2 sdl2:)
miscmacros)
(cond-expand
(chicken-4
(use (prefix sdl2 sdl2:)
miscmacros))
(chicken-5
(import (chicken condition)
(chicken format)
(rename (chicken random)
(pseudo-random-integer random))
(prefix sdl2 sdl2:)
miscmacros)))
;;; Initialize the parts of SDL that we need.
......
......@@ -12,11 +12,22 @@
;;; - Click the close button to quit
(use (prefix sdl2 sdl2:)
(prefix opengl-glew gl:)
(prefix gl-utils gl-utils:)
(prefix gl-math gl-math:)
miscmacros)
(cond-expand
(chicken-4
(use (prefix sdl2 sdl2:)
(prefix opengl-glew gl:)
(prefix gl-utils gl-utils:)
(prefix gl-math gl-math:)
miscmacros))
(chicken-5
;; NOTE: This will fail until the OpenGL eggs are ported to CHICKEN 5.
(import (chicken condition)
(chicken format)
(prefix sdl2 sdl2:)
(prefix opengl-glew gl:)
(prefix gl-utils gl-utils:)
(prefix gl-math gl-math:)
miscmacros)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......
......@@ -26,8 +26,17 @@
;;; sdl2:rwops.
(use (prefix sdl2 sdl2:)
srfi-4 lolevel miscmacros)
(cond-expand
(chicken-4
(use (prefix sdl2 sdl2:)
srfi-4 lolevel miscmacros))
(chicken-5
(import (chicken condition)
(chicken memory)
(prefix sdl2 sdl2:)
(srfi 4)
miscmacros
object-evict)))
;; Initialize SDL
......
......@@ -37,8 +37,17 @@
;;; Creator: John Croisant
(use (prefix sdl2 sdl2:)
miscmacros)
(cond-expand
(chicken-4
(use (prefix sdl2 sdl2:)
miscmacros))
(chicken-5
(import (chicken condition)
(rename (chicken random)
(pseudo-random-integer random))
(srfi 1)
(prefix sdl2 sdl2:)
miscmacros)))
;;; Convenience aliases.
(define C sdl2:make-color)
......@@ -225,7 +234,7 @@
(let ((i (smoothstep (distance-sq x y center center)
edge0-sq edge1-sq)))
(set! (sdl2:surface-ref surf x y)
(sdl2:color-lerp fg bg i)))))
(sdl2:color-lerp fg bg (exact->inexact i))))))
(sdl2:unlock-surface! surf)
surf)))
......
;;; chicken-sdl2 test suite entry point.
(use (prefix sdl2 sdl2:)
(prefix sdl2-internals SDL:)
test)
(cond-expand
(chicken-4
(use (prefix sdl2 sdl2:)
(prefix sdl2-internals SDL:)
test))
(chicken-5
(import (chicken bitwise)
(chicken format)
(chicken locative)
(chicken memory)
(prefix sdl2 sdl2:)
(prefix sdl2-internals SDL:)
test)))
(include "test-helpers.scm")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment