(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))
-(define* (create-device #:optional (device-type 'software))
+(define* (create-device #:optional
+ (device-type 'software)
+ (window-size '(640 480)))
(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)))
--- /dev/null
+;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
+;;; Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
+;;;
+;;; This file is part of guile-irrlicht.
+;;;
+;;; Guile-irrlicht is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU Lesser General Public License as
+;;; published by the Free Software Foundation; either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; Guile-irrlicht is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;; General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with guile-irrlicht. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+
+(define-module (irrlicht bindings core)
+ #:use-module (system foreign))
+
+;; dimension2d struct
+(define-public dimension2d
+ (list uint32 uint32))