(define-module (irrlicht)
#: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:)
- #:export (create-device))
+ #:export (create-device
+ get-video-driver))
-(define* (create-device #:optional (device-type 'software))
+(define* (create-device #:optional
+ (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)
('direct3d8 ffi-video:EDT_DIRECT3D8)
('direct3d9 ffi-video:EDT_DIRECT3D9)
('opengl ffi-video:EDT_OPENGL)
- ('count ffi-video:EDT_COUNT))))
- (ffi:create-device driver)))
+ ('count ffi-video:EDT_COUNT)))
+ (wsize (make-c-struct ffi-core:dimension2d window-size)))
+ (ffi:create-device driver wsize bits
+ (if fullscreen 1 0)
+ (if stencilbuffer 1 0)
+ (if vsync 1 0))))
+
+(define (get-video-driver device)
+ (ffi:get-video-driver device))