(add-static-text!
gui-env
"Hello World! This is the Irrlicht Software renderer!"
- '(10 10 260 22)
+ (make-rect 10 10 260 22)
#:border #t)
;; load a Quake2 model
(irrlicht dimension2d)
(irrlicht gui)
(irrlicht io)
+ (irrlicht rect)
(irrlicht scene)
(irrlicht video)))
(current-interface
#:use-module (system foreign)
#:use-module (irrlicht util))
-;; rect struct
-(define-public rect
- (list int32 int32 int32 int32))
-
;; vector2df struct
(define-public vector2df
(list float float float))
('opengl ffi-video:EDT_OPENGL)
('count ffi-video:EDT_COUNT))))
(let ((device (ffi:create-device driver
- (dimension2d-pointer window-size)
+ (dimension2d->pointer window-size)
bits
(bool->integer fullscreen)
(bool->integer stencilbuffer)
#:export (dimension2d
make-dimension2d
dimension2d?
- dimension2d-pointer
+ dimension2d->pointer
dimension2d-width
dimension2d-height))
(define-foreign-record-type dimension2d
(make-dimension2d width height)
dimension2d?
- dimension2d-pointer
+ dimension2d->pointer
(width uint32 dimension2d-width)
(height uint32 dimension2d-height))
#:use-module (system foreign)
#:use-module ((irrlicht bindings core) #:prefix ffi-core:)
#:use-module ((irrlicht bindings gui) #:prefix ffi-gui:)
+ #:use-module (irrlicht rect)
#:use-module (irrlicht util)
#:export (add-static-text!
gui-draw-all
(fill-background #f))
(ffi-gui:add-static-text gui-env
(string->pointer text)
- (make-c-struct ffi-core:rect rectangle)
+ (rect->pointer rectangle)
(bool->integer border)
(bool->integer word-wrap)
parent
--- /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 rect)
+ #:use-module (system foreign)
+ #:use-module (irrlicht util)
+ #:export (rect
+ make-rect
+ rect?
+ rect->pointer
+ rect-x
+ rect-y
+ rect-x2
+ rect-y2))
+
+;; rect struct
+(define-foreign-record-type rect
+ (make-rect x y x2 y2)
+ rect?
+ rect->pointer
+ (x int32 rect-x)
+ (y int32 rect-y)
+ (x2 int32 rect-x2)
+ (y2 int32 rect-y2))