(define-module (irrlicht device)
- #:use-module (ice-9 match)
- #:use-module (system foreign)
- #:use-module ((irrlicht bindings) #:prefix ffi:)
- #:use-module ((irrlicht bindings core) #:prefix ffi-core:)
- #:use-module ((irrlicht bindings video) #:prefix ffi-video:)
- #:use-module (irrlicht util)
#:export (create-device
- get-cursor-control
- get-file-system
get-video-driver
- get-gui-environment
- get-scene-manager
- is-window-active?
- set-window-caption!
- device-run?
- device-drop!))
+ set-window-caption!))
+(load-extension "libguile-irrlicht" "init_guile_irrlicht")
+
+(define irrlicht-create-device create-device)
(define* (create-device #:key
(device-type 'software)
(window-size '(640 480))
(bits 16)
(fullscreen #f)
(stencilbuffer #f)
- (vsync #f))
- (let ((driver (match device-type
- ('null ffi-video:EDT_NULL)
- ('software ffi-video:EDT_SOFTWARE)
- ('burnings ffi-video:EDT_BURNINGSVIDEO)
- ('direct3d8 ffi-video:EDT_DIRECT3D8)
- ('direct3d9 ffi-video:EDT_DIRECT3D9)
- ('opengl ffi-video:EDT_OPENGL)
- ('count ffi-video:EDT_COUNT))))
- (let ((device (ffi:create-device driver
- (ffi-core:dimension2d->pointer window-size)
- bits
- (bool->integer fullscreen)
- (bool->integer stencilbuffer)
- (bool->integer vsync))))
- (if (null-pointer? device) #f device))))
-
-(define (get-cursor-control device)
- (ffi:get-cursor-control device))
-
-(define (get-file-system device)
- (ffi:get-file-system device))
-
-(define (get-video-driver device)
- (ffi:get-video-driver device))
-
-(define (get-gui-environment device)
- (ffi:get-gui-environment device))
-
-(define (get-scene-manager device)
- (ffi:get-scene-manager device))
-
-(define (is-window-active? device)
- (integer->bool (ffi:is-window-active device)))
-
-(define (set-window-caption! device text)
- (ffi:set-window-caption device (string->pointer text)))
-
-(define (device-run? device)
- (integer->bool (ffi:run device)))
-
-(define (device-drop! device)
- (integer->bool (ffi:drop device)))
+ (vsync #f)
+ (receiver 0))
+ (irrlicht-create-device device-type
+ window-size
+ bits
+ fullscreen
+ stencilbuffer
+ vsync
+ receiver))