From d392bfc335713faab44275624d8fd78139880975 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 24 Apr 2021 20:15:53 +0200 Subject: [PATCH] Use SWIG for wrapping C++ --- .gitignore | 4 + Makefile.am | 118 +----- Swig/common.scm | 70 ++++ configure.ac | 25 +- irrlicht.i | 40 ++ irrlicht.scm | 150 -------- irrlicht/base.scm | 35 -- irrlicht/core.scm | 43 --- irrlicht/device.scm | 108 ------ irrlicht/foreign.scm | 65 ---- irrlicht/gui.scm | 264 ------------- irrlicht/io.scm | 57 --- irrlicht/irr.scm | 92 ----- irrlicht/scene.scm | 289 -------------- irrlicht/video.scm | 152 -------- src/animated-mesh-md2.cpp | 126 ------ src/animated-mesh-md2.h | 31 -- src/animated-mesh-scene-node.cpp | 70 ---- src/animated-mesh-scene-node.h | 28 -- src/animated-mesh.cpp | 43 --- src/animated-mesh.h | 28 -- src/box3d.cpp | 60 --- src/box3d.h | 28 -- src/color.cpp | 45 --- src/color.h | 34 -- src/cursor-control.cpp | 62 --- src/cursor-control.h | 28 -- src/device.cpp | 175 --------- src/device.h | 28 -- src/dimension2d.cpp | 34 -- src/dimension2d.h | 31 -- src/driver-types.cpp | 66 ---- src/driver-types.h | 31 -- src/event-receiver.cpp | 272 ------------- src/event-receiver.h | 37 -- src/file-archive.cpp | 74 ---- src/file-archive.h | 31 -- src/file-system.cpp | 67 ---- src/file-system.h | 28 -- src/gsubr.h | 31 -- src/gui-element.cpp | 50 --- src/gui-element.h | 31 -- src/gui-environment.cpp | 276 ------------- src/gui-environment.h | 28 -- src/gui-file-open-dialog.cpp | 42 -- src/gui-file-open-dialog.h | 28 -- src/gui-in-out-fader.cpp | 53 --- src/gui-in-out-fader.h | 28 -- src/gui-listbox.cpp | 55 --- src/gui-listbox.h | 28 -- src/gui-scrollbar.cpp | 59 --- src/gui-scrollbar.h | 28 -- src/gui-skin.cpp | 230 ----------- src/gui-skin.h | 37 -- src/gui-static-text.cpp | 44 --- src/gui-static-text.h | 31 -- src/gui-toolbar.cpp | 62 --- src/gui-toolbar.h | 28 -- src/guile-irrlicht.cpp | 79 ---- src/guile-irrlicht.h | 30 -- src/keycodes.cpp | 637 ------------------------------- src/keycodes.h | 31 -- src/material-flags.cpp | 121 ------ src/material-flags.h | 31 -- src/material-types.cpp | 138 ------- src/material-types.h | 31 -- src/material.cpp | 383 ------------------- src/material.h | 49 --- src/matrix4.cpp | 75 ---- src/matrix4.h | 34 -- src/position2d.cpp | 49 --- src/position2d.h | 39 -- src/primitive-types.cpp | 86 ----- src/primitive-types.h | 31 -- src/rect.cpp | 36 -- src/rect.h | 31 -- src/reference-counted.cpp | 43 --- src/reference-counted.h | 28 -- src/scene-manager.cpp | 367 ------------------ src/scene-manager.h | 28 -- src/scene-node.cpp | 160 -------- src/scene-node.h | 28 -- src/timer.cpp | 40 -- src/timer.h | 28 -- src/vector2d.cpp | 34 -- src/vector2d.h | 31 -- src/vector3d.cpp | 43 --- src/vector3d.h | 34 -- src/vertex3d.cpp | 86 ----- src/vertex3d.h | 34 -- src/video-driver.cpp | 212 ---------- src/video-driver.h | 34 -- src/wrapped.cpp | 44 --- src/wrapped.h | 36 -- 94 files changed, 150 insertions(+), 7209 deletions(-) create mode 100644 Swig/common.scm create mode 100644 irrlicht.i delete mode 100644 irrlicht.scm delete mode 100644 irrlicht/base.scm delete mode 100644 irrlicht/core.scm delete mode 100644 irrlicht/device.scm delete mode 100644 irrlicht/foreign.scm delete mode 100644 irrlicht/gui.scm delete mode 100644 irrlicht/io.scm delete mode 100644 irrlicht/irr.scm delete mode 100644 irrlicht/scene.scm delete mode 100644 irrlicht/video.scm delete mode 100644 src/animated-mesh-md2.cpp delete mode 100644 src/animated-mesh-md2.h delete mode 100644 src/animated-mesh-scene-node.cpp delete mode 100644 src/animated-mesh-scene-node.h delete mode 100644 src/animated-mesh.cpp delete mode 100644 src/animated-mesh.h delete mode 100644 src/box3d.cpp delete mode 100644 src/box3d.h delete mode 100644 src/color.cpp delete mode 100644 src/color.h delete mode 100644 src/cursor-control.cpp delete mode 100644 src/cursor-control.h delete mode 100644 src/device.cpp delete mode 100644 src/device.h delete mode 100644 src/dimension2d.cpp delete mode 100644 src/dimension2d.h delete mode 100644 src/driver-types.cpp delete mode 100644 src/driver-types.h delete mode 100644 src/event-receiver.cpp delete mode 100644 src/event-receiver.h delete mode 100644 src/file-archive.cpp delete mode 100644 src/file-archive.h delete mode 100644 src/file-system.cpp delete mode 100644 src/file-system.h delete mode 100644 src/gsubr.h delete mode 100644 src/gui-element.cpp delete mode 100644 src/gui-element.h delete mode 100644 src/gui-environment.cpp delete mode 100644 src/gui-environment.h delete mode 100644 src/gui-file-open-dialog.cpp delete mode 100644 src/gui-file-open-dialog.h delete mode 100644 src/gui-in-out-fader.cpp delete mode 100644 src/gui-in-out-fader.h delete mode 100644 src/gui-listbox.cpp delete mode 100644 src/gui-listbox.h delete mode 100644 src/gui-scrollbar.cpp delete mode 100644 src/gui-scrollbar.h delete mode 100644 src/gui-skin.cpp delete mode 100644 src/gui-skin.h delete mode 100644 src/gui-static-text.cpp delete mode 100644 src/gui-static-text.h delete mode 100644 src/gui-toolbar.cpp delete mode 100644 src/gui-toolbar.h delete mode 100644 src/guile-irrlicht.cpp delete mode 100644 src/guile-irrlicht.h delete mode 100644 src/keycodes.cpp delete mode 100644 src/keycodes.h delete mode 100644 src/material-flags.cpp delete mode 100644 src/material-flags.h delete mode 100644 src/material-types.cpp delete mode 100644 src/material-types.h delete mode 100644 src/material.cpp delete mode 100644 src/material.h delete mode 100644 src/matrix4.cpp delete mode 100644 src/matrix4.h delete mode 100644 src/position2d.cpp delete mode 100644 src/position2d.h delete mode 100644 src/primitive-types.cpp delete mode 100644 src/primitive-types.h delete mode 100644 src/rect.cpp delete mode 100644 src/rect.h delete mode 100644 src/reference-counted.cpp delete mode 100644 src/reference-counted.h delete mode 100644 src/scene-manager.cpp delete mode 100644 src/scene-manager.h delete mode 100644 src/scene-node.cpp delete mode 100644 src/scene-node.h delete mode 100644 src/timer.cpp delete mode 100644 src/timer.h delete mode 100644 src/vector2d.cpp delete mode 100644 src/vector2d.h delete mode 100644 src/vector3d.cpp delete mode 100644 src/vector3d.h delete mode 100644 src/vertex3d.cpp delete mode 100644 src/vertex3d.h delete mode 100644 src/video-driver.cpp delete mode 100644 src/video-driver.h delete mode 100644 src/wrapped.cpp delete mode 100644 src/wrapped.h diff --git a/.gitignore b/.gitignore index 9f70868..1877fbc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.lo *.log *.o +.deps/ .libs/ Makefile Makefile.in @@ -16,9 +17,12 @@ config.status config.sub configure depcomp +.dirstamp doc/.dirstamp doc/*.info install-sh +irrlicht*.cxx +irrlicht*.scm libtool ltmain.sh m4/ diff --git a/Makefile.am b/Makefile.am index 1ad9622..8e66093 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # guile-irrlicht --- GNU Guile bindings for Irrlicht Engine # -# Copyright (C) 2020 Javier Sancho +# Copyright (C) 2021 Javier Sancho # # This file is part of guile-irrlicht. # @@ -21,98 +21,18 @@ ACLOCAL_AMFLAGS = -I m4 -# C++ code +# Swig wrapper lib_LTLIBRARIES = libguile-irrlicht.la -libguile_irrlicht_la_SOURCES = \ - src/animated-mesh.cpp \ - src/animated-mesh-md2.cpp \ - src/animated-mesh-scene-node.cpp \ - src/box3d.cpp \ - src/color.cpp \ - src/cursor-control.cpp \ - src/device.cpp \ - src/dimension2d.cpp \ - src/driver-types.cpp \ - src/event-receiver.cpp \ - src/file-archive.cpp \ - src/file-system.cpp \ - src/gui-element.cpp \ - src/gui-environment.cpp \ - src/gui-file-open-dialog.cpp \ - src/gui-in-out-fader.cpp \ - src/gui-listbox.cpp \ - src/gui-scrollbar.cpp \ - src/gui-skin.cpp \ - src/gui-static-text.cpp \ - src/gui-toolbar.cpp \ - src/guile-irrlicht.cpp \ - src/keycodes.cpp \ - src/material.cpp \ - src/material-flags.cpp \ - src/material-types.cpp \ - src/matrix4.cpp \ - src/position2d.cpp \ - src/primitive-types.cpp \ - src/rect.cpp \ - src/reference-counted.cpp \ - src/scene-manager.cpp \ - src/scene-node.cpp \ - src/timer.cpp \ - src/vector2d.cpp \ - src/vector3d.cpp \ - src/vertex3d.cpp \ - src/video-driver.cpp \ - src/wrapped.cpp - +BUILT_SOURCES = $(builddir)/irrlicht_wrap.cxx +SWIG_FLAGS = -guile -scmstub -Linkage passive -proxy -emitslotaccessors +$(builddir)/irrlicht_wrap.cxx: irrlicht.i + $(SWIG) $(SWIG_FLAGS) $(IRRLICHT_CFLAGS) -o $@ $< +libguile_irrlicht_la_SOURCES = $(builddir)/irrlicht_wrap.cxx irrlicht.i libguile_irrlicht_la_CPPFLAGS = @GUILE_CFLAGS@ libguile_irrlicht_la_LDFLAGS = -version-info 0:1 @GUILE_LIBS@ -nobase_include_HEADERS = \ - src/animated-mesh.h \ - src/animated-mesh-md2.h \ - src/animated-mesh-scene-node.h \ - src/box3d.h \ - src/color.h \ - src/cursor-control.h \ - src/device.h \ - src/dimension2d.h \ - src/driver-types.h \ - src/event-receiver.h \ - src/file-archive.h \ - src/file-system.h \ - src/gsubr.h \ - src/gui-element.h \ - src/gui-environment.h \ - src/gui-file-open-dialog.h \ - src/gui-in-out-fader.h \ - src/guile-irrlicht.h \ - src/gui-listbox.h \ - src/gui-scrollbar.h \ - src/gui-skin.h \ - src/gui-static-text.h \ - src/gui-toolbar.h \ - src/keycodes.h \ - src/material-flags.h \ - src/material.h \ - src/material-types.h \ - src/matrix4.h \ - src/position2d.h \ - src/primitive-types.h \ - src/rect.h \ - src/reference-counted.h \ - src/scene-manager.h \ - src/scene-node.h \ - src/timer.h \ - src/vector2d.h \ - src/vector3d.h \ - src/vertex3d.h \ - src/video-driver.h \ - src/wrapped.h - -nodist_noinst_SCRIPTS = pre-inst-env - # Guile code GOBJECTS = $(SOURCES:%.scm=%.go) @@ -134,22 +54,16 @@ SUFFIXES = .scm .go moddir = @GUILE_SITE@ godir = @GUILE_SITE_CCACHE@ -SOURCES = \ - irrlicht.scm \ - irrlicht/base.scm \ - irrlicht/core.scm \ - irrlicht/device.scm \ - irrlicht/foreign.scm \ - irrlicht/gui.scm \ - irrlicht/io.scm \ - irrlicht/irr.scm \ - irrlicht/scene.scm \ - irrlicht/video.scm +SOURCES = irrlicht.scm \ + irrlicht-primitive.scm \ + Swig/common.scm + +nodist_noinst_SCRIPTS = pre-inst-env # Documentation -info_TEXINFOS = doc/irrlicht.texi +# info_TEXINFOS = doc/irrlicht.texi -doc_guile_irrlicht_TEXINFOS = \ - doc/fdl.texi \ - doc/irrlicht.texi +# doc_guile_irrlicht_TEXINFOS = \ +# doc/fdl.texi \ +# doc/irrlicht.texi diff --git a/Swig/common.scm b/Swig/common.scm new file mode 100644 index 0000000..a647f42 --- /dev/null +++ b/Swig/common.scm @@ -0,0 +1,70 @@ +;;;************************************************************************ +;;;*common.scm +;;;* +;;;* This file contains generic SWIG GOOPS classes for generated +;;;* GOOPS file support +;;;************************************************************************ + +(define-module (Swig swigrun)) + +(define-module (Swig common) + #:use-module (oop goops) + #:use-module (Swig swigrun)) + +(define-class () + (new-function #:init-value #f)) + +(define-method (initialize (class ) initargs) + (next-method) + (slot-set! class 'new-function (get-keyword #:new-function initargs #f))) + +(define-class () + (swig-smob #:init-value #f) + #:metaclass +) + +(define-method (initialize (obj ) initargs) + (next-method) + (slot-set! obj 'swig-smob + (let ((arg (get-keyword #:init-smob initargs #f))) + (if arg + arg + (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) + ;; if the class is registered with runtime environment, + ;; new-Function will return a goops class. In that case, extract the smob + ;; from that goops class and set it as the current smob. + (if (slot-exists? ret 'swig-smob) + (slot-ref ret 'swig-smob) + ret)))))) + +(define (display-address o file) + (display (number->string (object-address o) 16) file)) + +(define (display-pointer-address o file) + ;; Don't fail if the function SWIG-PointerAddress is not present. + (let ((address (false-if-exception (SWIG-PointerAddress o)))) + (if address + (begin + (display " @ " file) + (display (number->string address 16) file))))) + +(define-method (write (o ) file) + ;; We display _two_ addresses to show the object's identity: + ;; * first the address of the GOOPS proxy object, + ;; * second the pointer address. + ;; The reason is that proxy objects are created and discarded on the + ;; fly, so different proxy objects for the same C object will appear. + (let ((class (class-of o))) + (if (slot-bound? class 'name) + (begin + (display "#<" file) + (display (class-name class) file) + (display #\space file) + (display-address o file) + (display-pointer-address o file) + (display ">" file)) + (next-method)))) + +(export ) + +;;; common.scm ends here diff --git a/configure.ac b/configure.ac index afdd3c3..708657b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ define(GUILE_IRRLICHT_CONFIGURE_COPYRIGHT, [[ guile-irrlicht --- GNU Guile bindings for Irrlicht Engine -Copyright (C) 2020-2021 Javier Sancho +Copyright (C) 2021 Javier Sancho This file is part of guile-irrlicht. @@ -27,10 +27,9 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_COPYRIGHT(GUILE_IRRLICHT_CONFIGURE_COPYRIGHT) -AM_INIT_AUTOMAKE([color-tests subdir-objects -Wall -Wno-portability foreign]) -AM_SILENT_RULES([yes]) -AM_PROG_AR +AM_INIT_AUTOMAKE([subdir-objects -Wall -Wno-portability foreign]) AC_PROG_CXX +AC_LANG([C++]) LT_INIT # Check for 'guile' @@ -44,8 +43,24 @@ AC_CHECK_LIB( [Irrlicht], [createDevice], [], - AC_MSG_ERROR([Missing Irrlicht lib. Try option --with-irrlicht-lib]) + AC_MSG_ERROR([Irrlicht is required to build.]) ) +AC_CHECK_HEADERS( + [irrlicht/irrlicht.h], + [ + IRRLICHT_CFLAGS=-I/usr/include/irrlicht + AC_SUBST([IRRLICHT_CFLAGS]) + ], + AC_MSG_ERROR([Irrlicht header files are required to build.]) +) + +# Find swig executable +# http://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html +AX_PKG_SWIG([], [], [ AC_MSG_ERROR([SWIG is required to build.]) ]) + +# Enable SWIG C++ support +# https://www.gnu.org/software/autoconf-archive/ax_swig_enable_cxx.html +AX_SWIG_ENABLE_CXX AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) diff --git a/irrlicht.i b/irrlicht.i new file mode 100644 index 0000000..fad8138 --- /dev/null +++ b/irrlicht.i @@ -0,0 +1,40 @@ +%module irrlicht +%{ +#include +using namespace irr; +using namespace core; +using namespace scene; +using namespace video; +using namespace io; +using namespace gui; +%} + +typedef int s32; +typedef unsigned int u32; +typedef float f32; +typedef double f64; + +%rename(add) operator+; +%rename(substract) operator-; +%rename(product) operator*; +%rename(divide) operator/; +%rename(equal) operator==; +%ignore operator+=; +%ignore operator-=; +%ignore operator*=; +%ignore operator/=; +%ignore operator!=; + +%include dimension2d.h +%template(dimension2df) irr::core::dimension2d; +%template(dimension2ds) irr::core::dimension2d; +%template(dimension2du) irr::core::dimension2d; + +%rename("%(undercase)s", %$not %$isconstant, %$not %$isenumitem) ""; +%feature("constasvar"); + +%include EDriverTypes.h +%include IrrCompileConfig.h +%include irrlicht.h + +%scheme %{ (load-extension "libguile-irrlicht" "scm_init_irrlicht_module") %} diff --git a/irrlicht.scm b/irrlicht.scm deleted file mode 100644 index 283e33d..0000000 --- a/irrlicht.scm +++ /dev/null @@ -1,150 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht) - #:use-module (oop goops) - #:use-module (irrlicht base) - #:use-module (irrlicht core) - #:use-module (irrlicht device) - #:use-module (irrlicht gui) - #:use-module (irrlicht io) - #:use-module (irrlicht irr) - #:use-module (irrlicht scene) - #:use-module (irrlicht video) - #:duplicates (merge-generics) - #:re-export (;; classes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;; methods - add-animated-mesh-scene-node! - add-animator! - add-button! - add-camera-scene-node! - add-camera-scene-node-fps! - add-cube-scene-node! - add-custom-scene-node! - add-editbox! - add-file-archive! - add-file-open-dialog! - add-image! - add-internal-point! - add-item! - add-listbox! - add-octree-scene-node! - add-scrollbar! - add-sphere-scene-node! - add-static-text! - add-window! - begin-scene - close-device - create-device - create-fly-circle-animator - create-fly-straight-animator - create-rotation-animator - draw-vertex-primitive-list - drop! - end-scene - get-absolute-transformation - get-built-in-font - get-color - get-cursor-control - get-event-gui-caller - get-event-gui-type - get-event-key - get-event-key-pressed - get-event-type - get-file-name - get-file-system - get-font - get-fps - get-gui-environment - get-id - get-mesh - get-name - get-root-scene-node - get-scene-manager - get-skin - get-texture - get-time - get-timer - get-video-driver - is-window-active? - make-box3d - make-event-receiver - make-material - make-vertex3d - reset-box3d! - run - set-animation-speed! - set-color! - set-event-receiver! - set-font! - set-frame-loop! - set-material! - set-material-flag! - set-material-texture! - set-max! - set-md2-animation! - set-override-color! - set-resizable! - set-rotation! - set-scale! - set-transform! - set-visible! - set-window-caption! - yield-device)) - -;; Merged methods have to be exported apart -(re-export draw-all - get-position - set-position!) diff --git a/irrlicht/base.scm b/irrlicht/base.scm deleted file mode 100644 index 76a7a6b..0000000 --- a/irrlicht/base.scm +++ /dev/null @@ -1,35 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht base) - #:use-module (oop goops) - #:use-module (system foreign) - #:export ( - irr-class - irr-pointer)) - -(define-class () - (irr-class #:init-value "") - (irr-pointer #:init-value %null-pointer #:getter irr-pointer #:init-keyword #:irr-pointer)) - -;; irr-class getter is defined in this way to avoid problems with multiple getters -;; in multiple inherited classes -(define-method (irr-class (obj )) - (slot-ref obj 'irr-class)) diff --git a/irrlicht/core.scm b/irrlicht/core.scm deleted file mode 100644 index ab2d070..0000000 --- a/irrlicht/core.scm +++ /dev/null @@ -1,43 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht core) - #:use-module (oop goops) - #:use-module (irrlicht base) - #:use-module (irrlicht foreign)) - - -;; aabbox3d -(define-class () - (irr-class #:init-value "aabbox3d")) - -(define-method (add-internal-point! (box3d ) point) - (let ((addInternalPoint (get-irrlicht-proc "aabbox3d_addInternalPoint"))) - (addInternalPoint box3d point))) - -(define (make-box3d) - (let ((aabbox3d_make (get-irrlicht-proc "aabbox3d_make"))) - (aabbox3d_make))) - -(define-method (reset-box3d! (box3d ) init-value) - (let ((reset (get-irrlicht-proc "aabbox3d_reset"))) - (reset box3d init-value))) - -(export add-internal-point! make-box3d reset-box3d!) diff --git a/irrlicht/device.scm b/irrlicht/device.scm deleted file mode 100644 index 0fdeed7..0000000 --- a/irrlicht/device.scm +++ /dev/null @@ -1,108 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht device) - #:use-module (oop goops) - #:use-module (irrlicht base) - #:use-module (irrlicht foreign) - #:use-module ((irrlicht irr) #:select ( ))) - - -;; IrrlichtDevice -(define-class () - (irr-class #:init-value "IrrlichtDevice")) - -(define-method (close-device (device )) - (let ((closeDevice (get-irrlicht-proc "closeDevice" device))) - (closeDevice device))) - -(define* (create-device #:key - (device-type 'software) - (window-size '(640 480)) - (bits 16) - (fullscreen #f) - (stencilbuffer #f) - (vsync #f) - (receiver (make ))) - (if (not (is-a? receiver )) - (error - "In procedure create-device: Wrong type argument (expecting ):" - receiver)) - - (let* ((createDevice (get-irrlicht-proc "createDevice")) - (device (createDevice device-type window-size bits fullscreen stencilbuffer - vsync receiver))) - (if (null-object? device) - (error "In procedure create-device: Device cannot be created") - device))) - -(define-method (get-cursor-control (device )) - (let ((getCursorControl (get-irrlicht-proc "getCursorControl" device))) - (getCursorControl device))) - -(define-method (get-file-system (device )) - (let ((getFileSystem (get-irrlicht-proc "getFileSystem" device))) - (getFileSystem device))) - -(define-method (get-gui-environment (device )) - (let ((getGUIEnvironment (get-irrlicht-proc "getGUIEnvironment" device))) - (getGUIEnvironment device))) - -(define-method (get-scene-manager (device )) - (let ((getSceneManager (get-irrlicht-proc "getSceneManager" device))) - (getSceneManager device))) - -(define-method (get-timer (device )) - (let ((getTimer (get-irrlicht-proc "getTimer" device))) - (getTimer device))) - -(define-method (get-video-driver (device )) - (let* ((getVideoDriver (get-irrlicht-proc "getVideoDriver" device)) - (driver (getVideoDriver device))) - (if (null-object? driver) - (error "In procedure get-video-driver: Driver unavailable") - driver))) - -(define-method (is-window-active? (device )) - (let ((isWindowActive (get-irrlicht-proc "isWindowActive" device))) - (isWindowActive device))) - -(define-method (run (device )) - ((get-irrlicht-proc "run" device) device)) - -(define-method (set-event-receiver! (device ) (receiver )) - (let ((setEventReceiver (get-irrlicht-proc "setEventReceiver" device receiver))) - (setEventReceiver device receiver))) - -(define-method (set-resizable! (device ) resize) - (let ((setResizable (get-irrlicht-proc "setResizable" device))) - (setResizable device resize))) - -(define-method (set-window-caption! (device ) text) - ((get-irrlicht-proc "setWindowCaption" device) - device text)) - -(define-method (yield-device (device )) - (let ((yield (get-irrlicht-proc "yield" device))) - (yield device))) - -(export close-device create-device get-cursor-control get-file-system - get-gui-environment get-scene-manager get-timer get-video-driver is-window-active? run - set-event-receiver! set-resizable! set-window-caption! yield-device) diff --git a/irrlicht/foreign.scm b/irrlicht/foreign.scm deleted file mode 100644 index 96cec83..0000000 --- a/irrlicht/foreign.scm +++ /dev/null @@ -1,65 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht foreign) - #:use-module (system foreign) - #:use-module (irrlicht base) - #:export (get-irrlicht-proc - null-object? - remember-wrapped - mem-wrapped)) - -;; We use a hash table to store foreign irrlicht methods related with their -;; classes -;; This is needed because we need to "simulate" C++ inheritance -(define remote-proc-table (make-hash-table)) - -(define (get-irrlicht-proc proc-name . objects) - (let* ((name (if (null? objects) - proc-name - (let ((classes (map irr-class objects))) - (string-join (cons (car classes) (cons proc-name (cdr classes))) "_")))) - (proc (hash-ref remote-proc-table name))) - (cond ((not proc) - (load-extension "libguile-irrlicht" "init_guile_irrlicht") - (let ((new-proc (eval-string name))) - (hash-set! remote-proc-table name new-proc) - new-proc)) - (else - proc)))) - -(define (null-object? object) - (null-pointer? (irr-pointer object))) - -;; Table for storing foreign irrlicht wrapped objects by its pointer address -;; We can recover them later, when we have an address without knowing its type, like in -;; events case -(define wrapped-obj-table (make-hash-table)) - -(define (remember-wrapped object) - (or (hash-ref wrapped-obj-table - (pointer-address (irr-pointer object))) - object)) - -(define (mem-wrapped object) - (hash-set! wrapped-obj-table - (pointer-address (irr-pointer object)) - object) - object) diff --git a/irrlicht/gui.scm b/irrlicht/gui.scm deleted file mode 100644 index 3430e4d..0000000 --- a/irrlicht/gui.scm +++ /dev/null @@ -1,264 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht gui) - #:use-module (oop goops) - #:use-module (ice-9 optargs) - #:use-module (irrlicht base) - #:use-module (irrlicht foreign) - #:use-module ((irrlicht io) #:select ()) - #:use-module ((irrlicht irr) #:select ( ))) - - -;; ICursorControl -(define-class () - (irr-class #:init-value "ICursorControl")) - -(define-method (set-visible! (cursor-control ) visible) - (let ((setVisible (get-irrlicht-proc "setVisible" cursor-control))) - (setVisible cursor-control visible))) - -(export set-visible!) - - -;; IGUIElement -(define-class ( ) - (irr-class #:init-value "IGUIElement")) - -(define-method (get-id (element )) - (let ((getID (get-irrlicht-proc "getID" element))) - (getID element))) - -(export get-id) - - -;; IGUIEnvironment -(define-class () - (irr-class #:init-value "IGUIEnvironment")) - -(define-method (add-button! (gui-environment ) rectangle . rest) - (let-keywords rest #f - ((parent (make )) - (id -1) - (text "") - (tooltiptext "")) - (let* ((addButton (get-irrlicht-proc "addButton" gui-environment parent)) - (button (addButton gui-environment rectangle parent id text tooltiptext))) - (mem-wrapped button)))) - -(define-method (add-editbox! (gui-environment ) text rectangle . rest) - (let-keywords rest #f - ((border #t) - (parent (make )) - (id -1)) - (let* ((addEditBox (get-irrlicht-proc "addEditBox" gui-environment parent)) - (editbox (addEditBox gui-environment text rectangle border parent id))) - (mem-wrapped editbox)))) - -(define-method (add-file-open-dialog! (gui-environment ) . rest) - (let-keywords rest #f - ((title "") - (modal #t) - (parent (make )) - (id -1) - (restore-cwd #f) - (start-dir "")) - (let* ((addFileOpenDialog (get-irrlicht-proc "addFileOpenDialog" gui-environment parent)) - (dialog (addFileOpenDialog gui-environment title modal parent id restore-cwd start-dir))) - (mem-wrapped dialog)))) - -(define-method (add-image! (gui-environment ) image pos . rest) - (let-keywords rest #f - ((use-alpha-channel #t) - (parent (make )) - (id -1) - (text "")) - (let* ((addImage (get-irrlicht-proc "addImage" gui-environment parent)) - (img (addImage gui-environment image pos use-alpha-channel parent id text))) - (mem-wrapped img)))) - -(define-method (add-listbox! (gui-environment ) rectangle . rest) - (let-keywords rest #f - ((parent (make )) - (id -1) - (draw-background #f)) - (let* ((addListBox (get-irrlicht-proc "addListBox" gui-environment parent)) - (listbox (addListBox gui-environment rectangle parent id draw-background))) - (mem-wrapped listbox)))) - -(define-method (add-scrollbar! (gui-environment ) horizontal rectangle . rest) - (let-keywords rest #f - ((parent (make )) - (id -1)) - (let* ((addScrollBar (get-irrlicht-proc "addScrollBar" gui-environment parent)) - (scrollbar (addScrollBar gui-environment horizontal rectangle parent id))) - (mem-wrapped scrollbar)))) - -(define-method (add-static-text! (gui-environment ) text rectangle . rest) - (let-keywords rest #f - ((border #f) - (word-wrap #t) - (parent (make )) - (id -1) - (fill-background #f)) - (let* ((addStaticText (get-irrlicht-proc "addStaticText" gui-environment parent)) - (static-text (addStaticText gui-environment text rectangle border word-wrap parent - id fill-background))) - (mem-wrapped static-text)))) - -(define-method (add-window! (gui-environment ) rectangle . rest) - (let-keywords rest #f - ((modal #f) - (text "") - (parent (make )) - (id -1)) - (let* ((addWindow (get-irrlicht-proc "addWindow" gui-environment parent)) - (window (addWindow gui-environment rectangle modal text parent id))) - (mem-wrapped window)))) - -(define-method (draw-all (gui-environment )) - ((get-irrlicht-proc "drawAll" gui-environment) - gui-environment)) - -(define-method (get-built-in-font (gui-environment )) - (let ((getBuiltInFont (get-irrlicht-proc "getBuiltInFont" gui-environment))) - (getBuiltInFont gui-environment))) - -(define-method (get-font (gui-environment ) filename) - (let* ((getFont (get-irrlicht-proc "getFont" gui-environment)) - (font (getFont gui-environment filename))) - (if (null-object? font) - (error "In procedure get-font: Font unavailable") - font))) - -(define-method (get-skin (gui-environment )) - (let ((getSkin (get-irrlicht-proc "getSkin" gui-environment))) - (getSkin gui-environment))) - -(export add-button! add-editbox! add-file-open-dialog! add-image! add-listbox! - add-scrollbar! add-static-text! add-window! draw-all get-built-in-font get-font get-skin) - - -;; IGUIStaticText -(define-class () - (irr-class #:init-value "IGUIStaticText")) - -(define-method (set-override-color! (static-text ) color) - (let ((setOverrideColor (get-irrlicht-proc "setOverrideColor" static-text))) - (setOverrideColor static-text color))) - -(export set-override-color!) - - -;; IGUIImage -(define-class () - (irr-class #:init-value "IGUIImage")) - -(export ) - - -;; IGUISkin -(define-class () - (irr-class #:init-value "IGUISkin")) - -(define-method (get-color (skin ) color) - (let ((getColor (get-irrlicht-proc "getColor" skin))) - (getColor skin color))) - -(define-method (set-font! (skin ) font . rest) - (let-keywords rest #f - ((which 'default)) - (let ((setFont (get-irrlicht-proc "setFont" skin))) - (setFont skin font which)))) - -(define-method (set-color! (skin ) which new-color) - (let ((setColor (get-irrlicht-proc "setColor" skin))) - (setColor skin which new-color))) - -(export get-color set-font! set-color!) - - -;; IGUIFont -(define-class () - (irr-class #:init-value "IGUIFont")) - -(export ) - - -;; IGUIButton -(define-class () - (irr-class #:init-value "IGUIButton")) - -(export ) - - -;; IGUIScrollBar -(define-class () - (irr-class #:init-value "IGUIScrollBar")) - -(define-method (get-position (scrollbar )) - (let ((getPos (get-irrlicht-proc "getPos" scrollbar))) - (getPos scrollbar))) - -(define-method (set-max! (scrollbar ) max) - (let ((setMax (get-irrlicht-proc "setMax" scrollbar))) - (setMax scrollbar max))) - -(define-method (set-position! (scrollbar ) pos) - (let ((setPos (get-irrlicht-proc "setPos" scrollbar))) - (setPos scrollbar pos))) - -(export get-position set-max! set-position!) - - -;; IGUIListBox -(define-class () - (irr-class #:init-value "IGUIListBox")) - -(define-method (add-item! (listbox ) text) - (let ((addItem (get-irrlicht-proc "addItem" listbox))) - (addItem listbox text))) - -(export add-item!) - - -;; IGUIEditBox -(define-class () - (irr-class #:init-value "IGUIEditBox")) - -(export ) - - -;; IGUIWindow -(define-class () - (irr-class #:init-value "IGUIWindow")) - -(export ) - - -;; IGUIFileOpenDialog -(define-class () - (irr-class #:init-value "IGUIFileOpenDialog")) - -(define-method (get-file-name (dialog )) - (let ((getFileName (get-irrlicht-proc "getFileName" dialog))) - (getFileName dialog))) - -(export get-file-name) diff --git a/irrlicht/io.scm b/irrlicht/io.scm deleted file mode 100644 index e062e73..0000000 --- a/irrlicht/io.scm +++ /dev/null @@ -1,57 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht io) - #:use-module (oop goops) - #:use-module (ice-9 optargs) - #:use-module (irrlicht foreign) - #:use-module ((irrlicht irr) #:select ())) - - -;; IAttributeExchangingObject -(define-class () - (irr-class #:init-value "IAttributeExchangingObject")) - -(export ) - - -;;IFileArchive -(define-class () - (irr-class #:init-value "IFileArchive")) - -(export ) - - -;;IFileSystem -(define-class () - (irr-class #:init-value "IFileSystem")) - -(define-method (add-file-archive! (file-system ) filename . rest) - (let-keywords rest #f - ((ignore-case #t) - (ignore-paths #t) - (archive-type 'unknown) - (password "") - (ret-archive (make ))) - (let ((addFileArchive (get-irrlicht-proc "addFileArchive" file-system))) - (addFileArchive - file-system filename ignore-case ignore-paths archive-type password ret-archive)))) - -(export add-file-archive!) diff --git a/irrlicht/irr.scm b/irrlicht/irr.scm deleted file mode 100644 index f220cdf..0000000 --- a/irrlicht/irr.scm +++ /dev/null @@ -1,92 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht irr) - #:use-module (oop goops) - #:use-module (irrlicht base) - #:use-module (irrlicht foreign)) - - -;; IReferenceCounted -(define-class () - (irr-class #:init-value "IReferenceCounted")) - -(define-method (drop! (obj )) - (let ((drop (get-irrlicht-proc "drop" obj))) - (drop obj))) - -(export drop!) - - -;; SEvent -(define-class () - (irr-class #:init-value "SEvent")) - -(define-method (get-event-gui-caller (event )) - (let ((SGUIEvent_Caller (get-irrlicht-proc "SGUIEvent_Caller" event))) - (remember-wrapped (SGUIEvent_Caller event)))) - -(define-method (get-event-gui-type (event )) - (let ((SGUIEvent_EventType (get-irrlicht-proc "SGUIEvent_EventType" event))) - (SGUIEvent_EventType event))) - -(define-method (get-event-key (event )) - (let ((SKeyInput_Key (get-irrlicht-proc "SKeyInput_Key" event))) - (SKeyInput_Key event))) - -(define-method (get-event-key-pressed (event )) - (let ((SKeyInput_PressedDown (get-irrlicht-proc "SKeyInput_PressedDown" event))) - (SKeyInput_PressedDown event))) - -(define-method (get-event-type (event )) - (let ((EventType (get-irrlicht-proc "EventType" event))) - (EventType event))) - -(export get-event-gui-caller get-event-gui-type get-event-key get-event-key-pressed - get-event-type) - - -;; IEventReceiver -(define-class () - (irr-class #:init-value "IEventReceiver")) - -(define (make-event-receiver proc-on-event) - (let ((IEventReceiver_make (get-irrlicht-proc "IEventReceiver_make"))) - (IEventReceiver_make proc-on-event))) - -(export make-event-receiver) - - -;; SKeyMap -(define-class () - (irr-class #:init-value "SKeyMap")) - -(export ) - - -;; ITimer -(define-class () - (irr-class #:init-value "ITimer")) - -(define-method (get-time (timer )) - (let ((getTime (get-irrlicht-proc "getTime" timer))) - (getTime timer))) - -(export get-time) diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm deleted file mode 100644 index 65f1e9b..0000000 --- a/irrlicht/scene.scm +++ /dev/null @@ -1,289 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht scene) - #:use-module (oop goops) - #:use-module (ice-9 optargs) - #:use-module (irrlicht base) - #:use-module (irrlicht foreign) - #:use-module ((irrlicht io) #:select ()) - #:use-module ((irrlicht irr) #:select ( )) - #:use-module ((irrlicht video) #:select ())) - - -;; IMesh -(define-class () - (irr-class #:init-value "IMesh")) - -(export ) - - -;; IAnimatedMesh -(define-class () - (irr-class #:init-value "IAnimatedMesh")) - -(export ) - - -;; ISceneNodeAnimator -(define-class ( ) - (irr-class #:init-value "ISceneNodeAnimator")) - -(export ) - - -;; ISceneManager -(define-class () - (irr-class #:init-value "ISceneManager")) - -(define-method (add-animated-mesh-scene-node! (scene-manager ) - (mesh ) - . rest) - (let-keywords rest #f - ((parent (make )) - (id -1) - (position '(0 0 0)) - (rotation '(0 0 0)) - (scale '(1 1 1)) - (also-add-if-mesh-pointer-zero #f)) - (let* ((addAnimatedMeshSceneNode (get-irrlicht-proc "addAnimatedMeshSceneNode" - scene-manager - parent)) - (node (addAnimatedMeshSceneNode scene-manager mesh parent id position - rotation scale also-add-if-mesh-pointer-zero))) - (cond ((null-object? node) - (error "In procedure add-animated-mesh-scene-node!: Scene node cannot be created")) - (else - node))))) - -(define-method (add-camera-scene-node! (scene-manager ) . rest) - (let-keywords rest #f - ((parent (make )) - (position '(0 0 0)) - (lookat '(0 0 100)) - (id -1) - (make-active #t)) - (let ((addCameraSceneNode (get-irrlicht-proc "addCameraSceneNode" scene-manager parent))) - (addCameraSceneNode scene-manager parent position lookat id make-active)))) - -(define-method (add-camera-scene-node-fps! (scene-manager ) . rest) - (let-keywords rest #f - ((parent (make )) - (rotate-speed 100) - (move-speed 0.5) - (id -1) - (key-map-array (make )) - (key-map-size 0) - (no-vertical-movement #f) - (jump-speed 0) - (invert-mouse #f) - (make-active #t)) - (let ((addCameraSceneNodeFPS (get-irrlicht-proc "addCameraSceneNodeFPS" - scene-manager parent))) - (addCameraSceneNodeFPS scene-manager #:parent parent #:rotate-speed rotate-speed - #:move-speed move-speed #:id id #:key-map-array key-map-array - #:key-map-size key-map-size - #:no-vertical-movement no-vertical-movement - #:jump-speed jump-speed #:invert-mouse invert-mouse - #:make-active make-active)))) - -(define-method (add-cube-scene-node! (scene-manager ) . rest) - (let-keywords rest #f - ((size 10) - (parent (make )) - (id -1) - (position '(0 0 0)) - (rotation '(0 0 0)) - (scale '(1 1 1))) - (let ((addCubeSceneNode (get-irrlicht-proc "addCubeSceneNode" scene-manager parent))) - (addCubeSceneNode scene-manager size parent id position rotation scale)))) - -(define-method (add-custom-scene-node! (scene-manager ) proc-render - proc-get-bounding-box proc-get-material-count - proc-get-material . rest) - (let-keywords rest #f - ((parent (make )) - (id -1) - (position '(0 0 0)) - (rotation '(0 0 0)) - (scale '(1 1 1))) - (let ((addCustomSceneNode (get-irrlicht-proc "addCustomSceneNode" scene-manager parent))) - (addCustomSceneNode scene-manager proc-render proc-get-bounding-box proc-get-material-count - proc-get-material parent id position rotation scale)))) - -(define-method (add-octree-scene-node! (scene-manager ) - (mesh ) - . rest) - (let-keywords rest #f - ((parent (make )) - (id -1) - (minimal-polys-per-node 512) - (also-add-if-mesh-pointer-zero #f)) - (let ((addOctreeSceneNode (get-irrlicht-proc "addOctreeSceneNode" scene-manager parent mesh))) - (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node - also-add-if-mesh-pointer-zero)))) - -(define-method (add-octree-scene-node! (scene-manager ) - (mesh ) - . rest) - (let-keywords rest #f - ((parent (make )) - (id -1) - (minimal-polys-per-node 256) - (also-add-if-mesh-pointer-zero #f)) - (let ((addOctreeSceneNode (get-irrlicht-proc "addOctreeSceneNode" scene-manager parent mesh))) - (addOctreeSceneNode scene-manager mesh parent id minimal-polys-per-node - also-add-if-mesh-pointer-zero)))) - -(define-method (add-sphere-scene-node! (scene-manager ) . rest) - (let-keywords rest #f - ((radius 5) - (poly-count 16) - (parent (make )) - (id -1) - (position '(0 0 0)) - (rotation '(0 0 0)) - (scale '(1 1 1))) - (let ((addSphereSceneNode (get-irrlicht-proc "addSphereSceneNode" scene-manager parent))) - (addSphereSceneNode scene-manager radius poly-count parent id position rotation scale)))) - -(define-method (create-fly-circle-animator (scene-manager ) . rest) - (let-keywords rest #f - ((center '(0 0 0)) - (radius 100) - (speed 0.001) - (direction '(0 1 0)) - (start-position 0) - (radius-ellipsoid 0)) - (let ((createFlyCircleAnimator (get-irrlicht-proc "createFlyCircleAnimator" scene-manager))) - (createFlyCircleAnimator scene-manager center radius speed direction start-position - radius-ellipsoid)))) - -(define-method (create-fly-straight-animator (scene-manager ) - start-point end-point time-for-way . rest) - (let-keywords rest #f - ((loop #f) - (pingpong #f)) - (let ((createFlyStraightAnimator (get-irrlicht-proc "createFlyStraightAnimator" scene-manager))) - (createFlyStraightAnimator scene-manager start-point end-point time-for-way - loop pingpong)))) - -(define-method (create-rotation-animator (scene-manager ) rotation-speed) - (let ((createRotationAnimator (get-irrlicht-proc "createRotationAnimator" scene-manager))) - (createRotationAnimator scene-manager rotation-speed))) - -(define-method (draw-all (scene-manager )) - ((get-irrlicht-proc "drawAll" scene-manager) - scene-manager)) - -(define-method (get-mesh (scene-manager ) filename) - (let* ((getMesh (get-irrlicht-proc "getMesh" scene-manager)) - (mesh (getMesh scene-manager filename))) - (cond ((null-object? mesh) - (error "In procedure get-mesh: Mesh cannot be created")) - (else - mesh)))) - -(define-method (get-root-scene-node (scene-manager )) - (let ((getRootSceneNode (get-irrlicht-proc "getRootSceneNode" scene-manager))) - (getRootSceneNode scene-manager))) - -(export add-animated-mesh-scene-node! add-cube-scene-node! add-camera-scene-node! - add-camera-scene-node-fps! add-custom-scene-node! add-octree-scene-node! - add-sphere-scene-node! create-fly-circle-animator create-fly-straight-animator - create-rotation-animator draw-all get-root-scene-node get-mesh) - - -;; ISceneNode -(define-class () - (irr-class #:init-value "ISceneNode")) - -(define-method (add-animator! (node ) (animator )) - (let ((addAnimator (get-irrlicht-proc "addAnimator" node))) - (addAnimator node animator))) - -(define-method (get-absolute-transformation (node )) - (let ((getAbsoluteTransformation (get-irrlicht-proc "getAbsoluteTransformation" node))) - (getAbsoluteTransformation node))) - -(define-method (get-position (node )) - (let ((getPosition (get-irrlicht-proc "getPosition" node))) - (getPosition node))) - -(define-method (set-material-flag! (node ) flag new-value) - ((get-irrlicht-proc "setMaterialFlag" node) - node - flag - new-value)) - -(define-method (set-material-texture! (node ) texture-layer (texture )) - ((get-irrlicht-proc "setMaterialTexture" node) - node - texture-layer - texture)) - -(define-method (set-position! (node ) new-pos) - (let ((setPosition (get-irrlicht-proc "setPosition" node))) - (setPosition node new-pos))) - -(define-method (set-rotation! (node ) rotation) - (let ((setRotation (get-irrlicht-proc "setRotation" node))) - (setRotation node rotation))) - -(define-method (set-scale! (node ) scale) - (let ((setScale (get-irrlicht-proc "setScale" node))) - (setScale node scale))) - -(export add-animator! get-absolute-transformation get-position set-material-flag! - set-material-texture! set-position! set-rotation! set-scale!) - - -;; IAnimatedMeshSceneNode -(define-class () - (irr-class #:init-value "IAnimatedMeshSceneNode")) - -(define-method (set-animation-speed! (node ) frames-per-second) - (let ((setAnimationSpeed (get-irrlicht-proc "setAnimationSpeed" node))) - (setAnimationSpeed node frames-per-second))) - -(define-method (set-frame-loop! (node ) begin end) - (let ((setFrameLoop (get-irrlicht-proc "setFrameLoop" node))) - (setFrameLoop node begin end))) - -(define-method (set-md2-animation! (node ) anim) - ((get-irrlicht-proc "setMD2Animation" node) - node - anim)) - -(export set-animation-speed! set-frame-loop! set-md2-animation!) - - -;; ICameraSceneNode -(define-class () - (irr-class #:init-value "ICameraSceneNode")) - -(export ) - - -;; IMeshSceneNode -(define-class () - (irr-class #:init-value "IMeshSceneNode")) - -(export ) diff --git a/irrlicht/video.scm b/irrlicht/video.scm deleted file mode 100644 index f4feff4..0000000 --- a/irrlicht/video.scm +++ /dev/null @@ -1,152 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(define-module (irrlicht video) - #:use-module (oop goops) - #:use-module (ice-9 optargs) - #:use-module (irrlicht base) - #:use-module (irrlicht foreign)) - - -;; ITexture -(define-class () - (irr-class #:init-value "ITexture")) - -(export ) - - -;; SMaterial -(define-class () - (irr-class #:init-value "SMaterial")) - -(define* (make-material #:key - (material-type 'solid) - (ambient-color '(255 255 255 255)) - (diffuse-color '(255 255 255 255)) - (emissive-color '(0 0 0 0)) - (specular-color '(255 255 255 255)) - (shininess 0) - (material-type-param 0) - (material-type-param-2 0) - (thickness 1) - (z-buffer 'less-equal) - (anti-aliasing 'simple) - (color-mask 'all) - (color-material 'diffuse) - (blend-operation 'none) - (polygon-offset-factor 0) - (polygon-offset-direction 'front) - (wireframe #f) - (point-cloud #f) - (gouraud-shading #t) - (lighting #t) - (z-write-enable #t) - (backface-culling #t) - (frontface-culling #f) - (fog-enable #f) - (normalize-normals #f) - (use-mip-maps #t)) - (let ((SMaterial_make (get-irrlicht-proc "SMaterial_make"))) - (SMaterial_make #:material-type material-type #:ambient-color ambient-color - #:diffuse-color diffuse-color #:emissive-color emissive-color - #:specular-color specular-color #:shininess shininess - #:material-type-param material-type-param - #:material-type-param-2 material-type-param-2 - #:thickness thickness #:z-buffer z-buffer #:anti-aliasing anti-aliasing - #:color-mask color-mask #:color-material color-material - #:blend-operation blend-operation - #:polygon-offset-factor polygon-offset-factor - #:polygon-offset-direction polygon-offset-direction - #:wireframe wireframe #:point-cloud point-cloud - #:gouraud-shading gouraud-shading #:lighting lighting - #:z-write-enable z-write-enable #:backface-culling backface-culling - #:frontface-culling frontface-culling #:fog-enable fog-enable - #:normalize-normals normalize-normals #:use-mip-maps use-mip-maps))) - -(export make-material) - - -;; IVideoDriver -(define-class () - (irr-class #:init-value "IVideoDriver")) - -(define-method (begin-scene (video-driver ) . rest) - (let-keywords rest #f - ((back-buffer #t) - (z-buffer #t) - (color '(255 0 0 0)) - video-data - source-rect) - ((get-irrlicht-proc "beginScene" video-driver) - video-driver - back-buffer - z-buffer - color - video-data - source-rect))) - -(define-method (draw-vertex-primitive-list (video-driver ) vertices indices . rest) - (let-keywords rest #f - ((v-type 'standard) - (p-type 'triangles)) - (let ((drawVertexPrimitiveList (get-irrlicht-proc "drawVertexPrimitiveList" video-driver))) - (drawVertexPrimitiveList video-driver vertices indices v-type p-type)))) - -(define-method (end-scene (video-driver )) - ((get-irrlicht-proc "endScene" video-driver) - video-driver)) - -(define-method (get-fps (video-driver )) - (let ((getFPS (get-irrlicht-proc "getFPS" video-driver))) - (getFPS video-driver))) - -(define-method (get-name (video-driver )) - (let ((getName (get-irrlicht-proc "getName" video-driver))) - (getName video-driver))) - -(define-method (get-texture (video-driver ) filename) - (let ((getTexture (get-irrlicht-proc "getTexture" video-driver))) - (getTexture video-driver filename))) - -(define-method (set-material! (video-driver ) (material )) - (let ((setMaterial (get-irrlicht-proc "setMaterial" video-driver))) - (setMaterial video-driver material))) - -(define-method (set-transform! (video-driver ) state mat) - (let ((setTransform (get-irrlicht-proc "setTransform" video-driver))) - (setTransform video-driver state mat))) - -(export begin-scene draw-vertex-primitive-list end-scene get-fps get-name get-texture - set-material! set-transform!) - - -;; S3DVertex -(define-class () - (irr-class #:init-value "S3DVertex")) - -(define-method (get-position (vertex3d )) - (let ((S3DVertex_Pos (get-irrlicht-proc "S3DVertex_Pos"))) - (S3DVertex_Pos vertex3d))) - -(define (make-vertex3d position normal color tcoords) - (let ((S3DVertex_make (get-irrlicht-proc "S3DVertex_make"))) - (S3DVertex_make position normal color tcoords))) - -(export get-position make-vertex3d) diff --git a/src/animated-mesh-md2.cpp b/src/animated-mesh-md2.cpp deleted file mode 100644 index 844665f..0000000 --- a/src/animated-mesh-md2.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "animated-mesh-md2.h" - -using namespace irr; - -scene::EMD2_ANIMATION_TYPE -scm_to_md2_animation_type (SCM md2_animation_type) -{ - char* type_name = scm_to_utf8_string (scm_symbol_to_string (md2_animation_type)); - scene::EMD2_ANIMATION_TYPE type; - - if (!strcmp (type_name, "stand")) - { - type = scene::EMAT_STAND; - } - else if (!strcmp (type_name, "run")) - { - type = scene::EMAT_RUN; - } - else if (!strcmp (type_name, "attack")) - { - type = scene::EMAT_ATTACK; - } - else if (!strcmp (type_name, "pain-a")) - { - type = scene::EMAT_PAIN_A; - } - else if (!strcmp (type_name, "pain-b")) - { - type = scene::EMAT_PAIN_B; - } - else if (!strcmp (type_name, "pain-c")) - { - type = scene::EMAT_PAIN_C; - } - else if (!strcmp (type_name, "jump")) - { - type = scene::EMAT_JUMP; - } - else if (!strcmp (type_name, "flip")) - { - type = scene::EMAT_FLIP; - } - else if (!strcmp (type_name, "salute")) - { - type = scene::EMAT_SALUTE; - } - else if (!strcmp (type_name, "fallback")) - { - type = scene::EMAT_FALLBACK; - } - else if (!strcmp (type_name, "wave")) - { - type = scene::EMAT_WAVE; - } - else if (!strcmp (type_name, "point")) - { - type = scene::EMAT_POINT; - } - else if (!strcmp (type_name, "crouch-stand")) - { - type = scene::EMAT_CROUCH_STAND; - } - else if (!strcmp (type_name, "crouch-walk")) - { - type = scene::EMAT_CROUCH_WALK; - } - else if (!strcmp (type_name, "crouch-attack")) - { - type = scene::EMAT_CROUCH_ATTACK; - } - else if (!strcmp (type_name, "crouch-pain")) - { - type = scene::EMAT_CROUCH_PAIN; - } - else if (!strcmp (type_name, "crouch-death")) - { - type = scene::EMAT_CROUCH_DEATH; - } - else if (!strcmp (type_name, "death-fallback")) - { - type = scene::EMAT_DEATH_FALLBACK; - } - else if (!strcmp (type_name, "death-fallforward")) - { - type = scene::EMAT_DEATH_FALLFORWARD; - } - else if (!strcmp (type_name, "death-fallbackslow")) - { - type = scene::EMAT_DEATH_FALLBACKSLOW; - } - else if (!strcmp (type_name, "boom")) - { - type = scene::EMAT_BOOM; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong MD2 animation type: ~S", - scm_list_1 (md2_animation_type), scm_list_1 (md2_animation_type)); - } - - free (type_name); - return type; -} diff --git a/src/animated-mesh-md2.h b/src/animated-mesh-md2.h deleted file mode 100644 index 3998030..0000000 --- a/src/animated-mesh-md2.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_ANIMATED_MESH_MD2_H_INCLUDED__ -#define __GUILE_IRRLICHT_ANIMATED_MESH_MD2_H_INCLUDED__ - -#include -#include - -irr::scene::EMD2_ANIMATION_TYPE -scm_to_md2_animation_type (SCM md2_animation_type); - -#endif diff --git a/src/animated-mesh-scene-node.cpp b/src/animated-mesh-scene-node.cpp deleted file mode 100644 index e63541b..0000000 --- a/src/animated-mesh-scene-node.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "animated-mesh-md2.h" -#include "animated-mesh-scene-node.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IAnimatedMeshSceneNode_setAnimationSpeed (SCM animated_mesh_scene_node, - SCM frames_per_second) -{ - scene::IAnimatedMeshSceneNode* node = - (scene::IAnimatedMeshSceneNode*) scm_to_irr_pointer (animated_mesh_scene_node); - node->setAnimationSpeed (scm_to_double (frames_per_second)); - return SCM_UNSPECIFIED; -} - -SCM -IAnimatedMeshSceneNode_setFrameLoop (SCM animated_mesh_scene_node, - SCM begin, - SCM end) -{ - return scm_from_bool - (((scene::IAnimatedMeshSceneNode*)scm_to_irr_pointer (animated_mesh_scene_node))-> - setFrameLoop (scm_to_int32 (begin), - scm_to_int32 (end))); -} - -SCM -IAnimatedMeshSceneNode_setMD2Animation (SCM animated_mesh_scene_node, - SCM anim) -{ - return scm_from_bool - (((scene::IAnimatedMeshSceneNode*)scm_to_irr_pointer (animated_mesh_scene_node))-> - setMD2Animation (scm_to_md2_animation_type (anim))); -} - -void -init_animated_mesh_scene_node (void) -{ - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setAnimationSpeed", 2, 0, 0, - IAnimatedMeshSceneNode_setAnimationSpeed); - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setFrameLoop", 3, 0, 0, - IAnimatedMeshSceneNode_setFrameLoop); - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMD2Animation", 2, 0, 0, - IAnimatedMeshSceneNode_setMD2Animation); -} diff --git a/src/animated-mesh-scene-node.h b/src/animated-mesh-scene-node.h deleted file mode 100644 index d586cce..0000000 --- a/src/animated-mesh-scene-node.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__ -#define __GUILE_IRRLICHT_ANIMATED_MESH_SCENE_NODE_H_INCLUDED__ - -void -init_animated_mesh_scene_node (void); - -#endif diff --git a/src/animated-mesh.cpp b/src/animated-mesh.cpp deleted file mode 100644 index 896cfe9..0000000 --- a/src/animated-mesh.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "animated-mesh.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IAnimatedMesh_setAnimationSpeed (SCM animated_mesh, - SCM frames_per_second) -{ - ((scene::IAnimatedMesh*)scm_to_irr_pointer (animated_mesh))-> - setAnimationSpeed (scm_to_double (frames_per_second)); - return SCM_UNSPECIFIED; -} - -void -init_animated_mesh (void) -{ - DEFINE_GSUBR ("IAnimatedMesh_setAnimationSpeed", 2, 0, 0, IAnimatedMesh_setAnimationSpeed); -} diff --git a/src/animated-mesh.h b/src/animated-mesh.h deleted file mode 100644 index 3a4966b..0000000 --- a/src/animated-mesh.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_ANIMATED_MESH_H_INCLUDED__ -#define __GUILE_IRRLICHT_ANIMATED_MESH_H_INCLUDED__ - -void -init_animated_mesh (void); - -#endif diff --git a/src/box3d.cpp b/src/box3d.cpp deleted file mode 100644 index e254bc2..0000000 --- a/src/box3d.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "box3d.h" -#include "gsubr.h" -#include "vector3d.h" -#include "wrapped.h" - -using namespace irr; - -SCM -aabbox3d_addInternalPoint (SCM box3d, - SCM point) -{ - ((core::aabbox3df*)scm_to_irr_pointer (box3d))->addInternalPoint (scm_to_vector3df (point)); - return SCM_UNSPECIFIED; -} - -SCM -aabbox3d_make () -{ - core::aabbox3df* aabbox = new core::aabbox3df (); - return scm_from_irr_pointer ("", (void*) aabbox); -} - -SCM -aabbox3d_reset (SCM box3d, - SCM init_value) -{ - ((core::aabbox3df*)scm_to_irr_pointer (box3d))->reset (scm_to_vector3df (init_value)); - return SCM_UNSPECIFIED; -} - -void -init_box3d (void) -{ - DEFINE_GSUBR ("aabbox3d_addInternalPoint", 2, 0, 0, aabbox3d_addInternalPoint); - DEFINE_GSUBR ("aabbox3d_make", 0, 0, 0, aabbox3d_make); - DEFINE_GSUBR ("aabbox3d_reset", 2, 0, 0, aabbox3d_reset); -} diff --git a/src/box3d.h b/src/box3d.h deleted file mode 100644 index cfcde7b..0000000 --- a/src/box3d.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_AABBOX_3D_H_INCLUDED__ -#define __GUILE_IRRLICHT_AABBOX_3D_H_INCLUDED__ - -void -init_box3d (void); - -#endif diff --git a/src/color.cpp b/src/color.cpp deleted file mode 100644 index 9308abc..0000000 --- a/src/color.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "color.h" - -using namespace irr; - -SCM -scm_from_color (video::SColor color) -{ - return scm_list_4 (scm_from_uint32 (color.getAlpha ()), - scm_from_uint32 (color.getRed ()), - scm_from_uint32 (color.getGreen ()), - scm_from_uint32 (color.getBlue ())); -} - -video::SColor -scm_to_color (SCM color) -{ - return video::SColor - (scm_to_uint32 (scm_car (color)), - scm_to_uint32 (scm_cadr (color)), - scm_to_uint32 (scm_caddr (color)), - scm_to_uint32 (scm_cadddr (color))); -} diff --git a/src/color.h b/src/color.h deleted file mode 100644 index bab6a93..0000000 --- a/src/color.h +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_COLOR_H_INCLUDED__ -#define __GUILE_IRRLICHT_COLOR_H_INCLUDED__ - -#include -#include - -SCM -scm_from_color (irr::video::SColor color); - -irr::video::SColor -scm_to_color (SCM color); - -#endif diff --git a/src/cursor-control.cpp b/src/cursor-control.cpp deleted file mode 100644 index c489346..0000000 --- a/src/cursor-control.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "cursor-control.h" -#include "gsubr.h" -#include "position2d.h" -#include "wrapped.h" - -using namespace irr; - -SCM -ICursorControl_getPosition (SCM cursor_control) -{ - return scm_from_position2d_s32 - (((gui::ICursorControl*)scm_to_irr_pointer (cursor_control))->getPosition ()); -} - -SCM -ICursorControl_setPosition (SCM cursor_control, - SCM position) -{ - ((gui::ICursorControl*)scm_to_irr_pointer (cursor_control))-> - setPosition (scm_to_position2d_s32 (position)); - return SCM_UNSPECIFIED; -} - -SCM -ICursorControl_setVisible (SCM cursor_control, - SCM visible) -{ - ((gui::ICursorControl*)scm_to_irr_pointer (cursor_control))-> - setVisible (scm_to_bool (visible)); - return SCM_UNSPECIFIED; -} - -void -init_cursor_control (void) -{ - DEFINE_GSUBR ("ICursorControl_getPosition", 1, 0, 0, ICursorControl_getPosition); - DEFINE_GSUBR ("ICursorControl_setPosition", 2, 0, 0, ICursorControl_setPosition); - DEFINE_GSUBR ("ICursorControl_setVisible", 2, 0, 0, ICursorControl_setVisible); -} diff --git a/src/cursor-control.h b/src/cursor-control.h deleted file mode 100644 index f01bd78..0000000 --- a/src/cursor-control.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_CURSOR_CONTROL_H_INCLUDED__ -#define __GUILE_IRRLICHT_CURSOR_CONTROL_H_INCLUDED__ - -void -init_cursor_control (void); - -#endif diff --git a/src/device.cpp b/src/device.cpp deleted file mode 100644 index 02edd85..0000000 --- a/src/device.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "device.h" -#include "dimension2d.h" -#include "driver-types.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -irr_createDevice (SCM device_type, - SCM window_size, - SCM bits, - SCM fullscreen, - SCM stencilbuffer, - SCM vsync, - SCM receiver) -{ - IrrlichtDevice* device = - createDevice (scm_to_driver_type (device_type), - scm_to_dimension2d_u32 (window_size), - scm_to_uint32 (bits), - scm_to_bool (fullscreen), - scm_to_bool (stencilbuffer), - scm_to_bool (vsync), - (IEventReceiver*)scm_to_irr_pointer (receiver)); - return scm_from_irr_pointer ("", (void*) device); -} - -SCM -IrrlichtDevice_closeDevice (SCM device) -{ - ((IrrlichtDevice*)scm_to_irr_pointer (device))->closeDevice (); - return SCM_UNSPECIFIED; -} - -SCM -IrrlichtDevice_getCursorControl (SCM device) -{ - gui::ICursorControl* cursor_control = - ((IrrlichtDevice*)scm_to_irr_pointer (device))->getCursorControl (); - return scm_from_irr_pointer ("", (void*) cursor_control); -} - -SCM -IrrlichtDevice_getFileSystem (SCM device) -{ - io::IFileSystem* file_system = - ((IrrlichtDevice*)scm_to_irr_pointer (device))->getFileSystem (); - return scm_from_irr_pointer ("", (void*) file_system); -} - -SCM -IrrlichtDevice_getGUIEnvironment (SCM device) -{ - gui::IGUIEnvironment* gui_env = - ((IrrlichtDevice*)scm_to_irr_pointer (device))->getGUIEnvironment (); - return scm_from_irr_pointer ("", (void*) gui_env); -} - -SCM -IrrlichtDevice_getSceneManager (SCM device) -{ - scene::ISceneManager* manager = - ((IrrlichtDevice*)scm_to_irr_pointer (device))->getSceneManager (); - return scm_from_irr_pointer ("", (void*) manager); -} - -SCM -IrrlichtDevice_getTimer (SCM device) -{ - ITimer* timer = - ((IrrlichtDevice*)scm_to_irr_pointer (device))->getTimer (); - return scm_from_irr_pointer ("", (void*) timer); -} - -SCM -IrrlichtDevice_getVideoDriver (SCM device) -{ - video::IVideoDriver* driver = - ((IrrlichtDevice*)scm_to_irr_pointer (device))->getVideoDriver (); - return scm_from_irr_pointer ("", (void*) driver); -} - -SCM -IrrlichtDevice_isWindowActive (SCM device) -{ - return scm_from_bool - (((IrrlichtDevice*)scm_to_irr_pointer (device))->isWindowActive ()); -} - -SCM -IrrlichtDevice_run (SCM device) -{ - return scm_from_bool - (((IrrlichtDevice*)scm_to_irr_pointer (device))->run ()); -} - -template -SCM -IrrlichtDevice_setEventReceiver (SCM device, - SCM receiver) -{ - ((IrrlichtDevice*)scm_to_irr_pointer (device))-> - setEventReceiver ((TEventReceiver)scm_to_irr_pointer (receiver)); - return SCM_UNSPECIFIED; -} - -SCM -IrrlichtDevice_setResizable (SCM device, - SCM resize) -{ - ((IrrlichtDevice*)scm_to_irr_pointer (device))-> - setResizable (scm_to_bool (resize)); - return SCM_UNSPECIFIED; -} - -SCM -IrrlichtDevice_setWindowCaption (SCM device, - SCM text) -{ - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - ((IrrlichtDevice*)scm_to_irr_pointer (device))->setWindowCaption (wtext); - free (wtext); - return SCM_UNSPECIFIED; -} - -SCM -IrrlichtDevice_yield (SCM device) -{ - ((IrrlichtDevice*)scm_to_irr_pointer (device))->yield (); - return SCM_UNSPECIFIED; -} - -void -init_device (void) -{ - DEFINE_GSUBR ("createDevice", 7, 0, 0, irr_createDevice); - DEFINE_GSUBR ("IrrlichtDevice_closeDevice", 1, 0, 0, IrrlichtDevice_closeDevice); - DEFINE_GSUBR ("IrrlichtDevice_getCursorControl", 1, 0, 0, IrrlichtDevice_getCursorControl); - DEFINE_GSUBR ("IrrlichtDevice_getFileSystem", 1, 0, 0, IrrlichtDevice_getFileSystem); - DEFINE_GSUBR ("IrrlichtDevice_getGUIEnvironment", 1, 0, 0, IrrlichtDevice_getGUIEnvironment); - DEFINE_GSUBR ("IrrlichtDevice_getSceneManager", 1, 0, 0, IrrlichtDevice_getSceneManager); - DEFINE_GSUBR ("IrrlichtDevice_getTimer", 1, 0, 0, IrrlichtDevice_getTimer); - DEFINE_GSUBR ("IrrlichtDevice_getVideoDriver", 1, 0, 0, IrrlichtDevice_getVideoDriver); - DEFINE_GSUBR ("IrrlichtDevice_isWindowActive", 1, 0, 0, IrrlichtDevice_isWindowActive); - DEFINE_GSUBR ("IrrlichtDevice_run", 1, 0, 0, IrrlichtDevice_run); - DEFINE_GSUBR ("IrrlichtDevice_setEventReceiver_IEventReceiver", 2, 0, 0, - IrrlichtDevice_setEventReceiver); - DEFINE_GSUBR ("IrrlichtDevice_setResizable", 2, 0, 0, IrrlichtDevice_setResizable); - DEFINE_GSUBR ("IrrlichtDevice_setWindowCaption", 2, 0, 0, IrrlichtDevice_setWindowCaption); - DEFINE_GSUBR ("IrrlichtDevice_yield", 1, 0, 0, IrrlichtDevice_yield); -} diff --git a/src/device.h b/src/device.h deleted file mode 100644 index 5081ccd..0000000 --- a/src/device.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_DEVICE_H_INCLUDED__ -#define __GUILE_IRRLICHT_DEVICE_H_INCLUDED__ - -void -init_device (void); - -#endif diff --git a/src/dimension2d.cpp b/src/dimension2d.cpp deleted file mode 100644 index 7db4cfc..0000000 --- a/src/dimension2d.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "dimension2d.h" - -using namespace irr; - -core::dimension2d -scm_to_dimension2d_u32 (SCM dimension2d) -{ - return core::dimension2d - (scm_to_uint32 (scm_car (dimension2d)), - scm_to_uint32 (scm_cadr (dimension2d))); -} diff --git a/src/dimension2d.h b/src/dimension2d.h deleted file mode 100644 index 534a905..0000000 --- a/src/dimension2d.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_DIMENSION_2D_H_INCLUDED__ -#define __GUILE_IRRLICHT_DIMENSION_2D_H_INCLUDED__ - -#include -#include - -irr::core::dimension2d -scm_to_dimension2d_u32 (SCM dimension2d); - -#endif diff --git a/src/driver-types.cpp b/src/driver-types.cpp deleted file mode 100644 index fef8547..0000000 --- a/src/driver-types.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "driver-types.h" - -using namespace irr; - -video::E_DRIVER_TYPE -scm_to_driver_type (SCM driver_type) -{ - char* type_name = scm_to_utf8_string (scm_symbol_to_string (driver_type)); - video::E_DRIVER_TYPE type; - - if (!strcmp (type_name, "null")) - { - type = video::EDT_NULL; - } - else if (!strcmp (type_name, "software")) - { - type = video::EDT_SOFTWARE; - } - else if (!strcmp (type_name, "burnings")) - { - type = video::EDT_BURNINGSVIDEO; - } - else if (!strcmp (type_name, "direct3d8")) - { - type = video::EDT_DIRECT3D8; - } - else if (!strcmp (type_name, "direct3d9")) - { - type = video::EDT_DIRECT3D9; - } - else if (!strcmp (type_name, "opengl")) - { - type = video::EDT_OPENGL; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong driver type: ~S", - scm_list_1 (driver_type), scm_list_1 (driver_type)); - } - - free (type_name); - return type; -} diff --git a/src/driver-types.h b/src/driver-types.h deleted file mode 100644 index acabf0b..0000000 --- a/src/driver-types.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_DRIVER_TYPES_H_INCLUDED__ -#define __GUILE_IRRLICHT_DRIVER_TYPES_H_INCLUDED__ - -#include -#include - -irr::video::E_DRIVER_TYPE -scm_to_driver_type (SCM driver_type); - -#endif diff --git a/src/event-receiver.cpp b/src/event-receiver.cpp deleted file mode 100644 index 1d8e097..0000000 --- a/src/event-receiver.cpp +++ /dev/null @@ -1,272 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "event-receiver.h" -#include "gsubr.h" -#include "keycodes.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IEventReceiver_make (SCM proc_on_event) -{ - class CustomReceiver : public IEventReceiver - { - SCM scm_on_event; - - public: - CustomReceiver (SCM on_event) - { - scm_on_event = on_event; - } - - virtual bool OnEvent (const SEvent& event) - { - SCM wrapped_event = scm_from_irr_pointer ("", (void*) &event); - return scm_to_bool (scm_call_1 (scm_on_event, wrapped_event)); - } - }; - - CustomReceiver* receiver = new CustomReceiver (proc_on_event); - return scm_from_irr_pointer ("", (void*) receiver); -} - -SCM -SEvent_EventType (SCM event) -{ - return scm_from_event_type - (((SEvent*)scm_to_irr_pointer (event))->EventType); -} - -SCM -SEvent_SGUIEvent_Caller (SCM event) -{ - gui::IGUIElement* caller = - ((SEvent*)scm_to_irr_pointer (event))->GUIEvent.Caller; - return scm_from_irr_pointer ("", (void*) caller); -} - -SCM -SEvent_SGUIEvent_EventType (SCM event) -{ - return scm_from_gui_event_type - (((SEvent*)scm_to_irr_pointer (event))->GUIEvent.EventType); -} - -SCM -SEvent_SKeyInput_Key (SCM event) -{ - return scm_from_key_code - (((SEvent*)scm_to_irr_pointer (event))->KeyInput.Key); -} - -SCM -SEvent_SKeyInput_PressedDown (SCM event) -{ - return scm_from_bool - (((SEvent*)scm_to_irr_pointer (event))->KeyInput.PressedDown); -} - -void -init_event_receiver (void) -{ - DEFINE_GSUBR ("IEventReceiver_make", 1, 0, 0, IEventReceiver_make); - DEFINE_GSUBR ("SEvent_EventType", 1, 0, 0, SEvent_EventType); - DEFINE_GSUBR ("SEvent_SGUIEvent_Caller", 1, 0, 0, SEvent_SGUIEvent_Caller); - DEFINE_GSUBR ("SEvent_SGUIEvent_EventType", 1, 0, 0, SEvent_SGUIEvent_EventType); - DEFINE_GSUBR ("SEvent_SKeyInput_Key", 1, 0, 0, SEvent_SKeyInput_Key); - DEFINE_GSUBR ("SEvent_SKeyInput_PressedDown", 1, 0, 0, SEvent_SKeyInput_PressedDown); -} - -SCM -scm_from_event_type (EEVENT_TYPE event_type) -{ - switch (event_type) - { - case EET_GUI_EVENT: - return scm_from_utf8_symbol ("gui-event"); - break; - - case EET_MOUSE_INPUT_EVENT: - return scm_from_utf8_symbol ("mouse-input-event"); - break; - - case EET_KEY_INPUT_EVENT: - return scm_from_utf8_symbol ("key-input-event"); - break; - - case EET_JOYSTICK_INPUT_EVENT: - return scm_from_utf8_symbol ("joystick-input-event"); - break; - - case EET_LOG_TEXT_EVENT: - return scm_from_utf8_symbol ("log-text-event"); - break; - - case EET_USER_EVENT: - return scm_from_utf8_symbol ("user-event"); - break; - - default: - SCM type = scm_from_uint (event_type); - scm_error (scm_arg_type_key, NULL, "Wrong event type: ~S", - scm_list_1 (type), scm_list_1 (type)); - } -} - -SCM -scm_from_gui_event_type (gui::EGUI_EVENT_TYPE gui_event_type) -{ - switch (gui_event_type) - { - case gui::EGET_ELEMENT_FOCUS_LOST: - return scm_from_utf8_symbol ("element-focus-lost"); - break; - - case gui::EGET_ELEMENT_FOCUSED: - return scm_from_utf8_symbol ("element-focused"); - break; - - case gui::EGET_ELEMENT_HOVERED: - return scm_from_utf8_symbol ("element-hovered"); - break; - - case gui::EGET_ELEMENT_LEFT: - return scm_from_utf8_symbol ("element-left"); - break; - - case gui::EGET_ELEMENT_CLOSED: - return scm_from_utf8_symbol ("element-closed"); - break; - - case gui::EGET_BUTTON_CLICKED: - return scm_from_utf8_symbol ("button-clicked"); - break; - - case gui::EGET_SCROLL_BAR_CHANGED: - return scm_from_utf8_symbol ("scrollbar-changed"); - break; - - case gui::EGET_CHECKBOX_CHANGED: - return scm_from_utf8_symbol ("checkbox-changed"); - break; - - case gui::EGET_LISTBOX_CHANGED: - return scm_from_utf8_symbol ("listbox-changed"); - break; - - case gui::EGET_LISTBOX_SELECTED_AGAIN: - return scm_from_utf8_symbol ("listbox-selected-again"); - break; - - case gui::EGET_FILE_SELECTED: - return scm_from_utf8_symbol ("file-selected"); - break; - - case gui::EGET_DIRECTORY_SELECTED: - return scm_from_utf8_symbol ("directory-selected"); - break; - - case gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED: - return scm_from_utf8_symbol ("file-choose-dialog-cancelled"); - break; - - case gui::EGET_MESSAGEBOX_YES: - return scm_from_utf8_symbol ("messagebox-yes"); - break; - - case gui::EGET_MESSAGEBOX_NO: - return scm_from_utf8_symbol ("messagebox-no"); - break; - - case gui::EGET_MESSAGEBOX_OK: - return scm_from_utf8_symbol ("messagebox-ok"); - break; - - case gui::EGET_MESSAGEBOX_CANCEL: - return scm_from_utf8_symbol ("messagebox-cancel"); - break; - - case gui::EGET_EDITBOX_ENTER: - return scm_from_utf8_symbol ("editbox-enter"); - break; - - case gui::EGET_EDITBOX_CHANGED: - return scm_from_utf8_symbol ("editbox-changed"); - break; - - case gui::EGET_EDITBOX_MARKING_CHANGED: - return scm_from_utf8_symbol ("editbox-marking-changed"); - break; - - case gui::EGET_TAB_CHANGED: - return scm_from_utf8_symbol ("tab-changed"); - break; - - case gui::EGET_MENU_ITEM_SELECTED: - return scm_from_utf8_symbol ("menu-item-selected"); - break; - - case gui::EGET_COMBO_BOX_CHANGED: - return scm_from_utf8_symbol ("combo-box-changed"); - break; - - case gui::EGET_SPINBOX_CHANGED: - return scm_from_utf8_symbol ("spinbox-changed"); - break; - - case gui::EGET_TABLE_CHANGED: - return scm_from_utf8_symbol ("table-changed"); - break; - - case gui::EGET_TABLE_HEADER_CHANGED: - return scm_from_utf8_symbol ("table-header-changed"); - break; - - case gui::EGET_TABLE_SELECTED_AGAIN: - return scm_from_utf8_symbol ("table-selected-again"); - break; - - case gui::EGET_TREEVIEW_NODE_DESELECT: - return scm_from_utf8_symbol ("treeview-node-deselect"); - break; - - case gui::EGET_TREEVIEW_NODE_SELECT: - return scm_from_utf8_symbol ("treeview-node-select"); - break; - - case gui::EGET_TREEVIEW_NODE_EXPAND: - return scm_from_utf8_symbol ("treeview-node-expand"); - break; - - case gui::EGET_TREEVIEW_NODE_COLLAPSE: - return scm_from_utf8_symbol ("treeview-node-collapse"); - break; - - default: - SCM type = scm_from_uint (gui_event_type); - scm_error (scm_arg_type_key, NULL, "Wrong GUI event type: ~S", - scm_list_1 (type), scm_list_1 (type)); - } -} diff --git a/src/event-receiver.h b/src/event-receiver.h deleted file mode 100644 index 5df68b7..0000000 --- a/src/event-receiver.h +++ /dev/null @@ -1,37 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_EVENT_RECEIVER_H_INCLUDED__ -#define __GUILE_IRRLICHT_EVENT_RECEIVER_H_INCLUDED__ - -#include -#include - -void -init_event_receiver (void); - -SCM -scm_from_event_type (irr::EEVENT_TYPE event_type); - -SCM -scm_from_gui_event_type (irr::gui::EGUI_EVENT_TYPE gui_event_type); - -#endif diff --git a/src/file-archive.cpp b/src/file-archive.cpp deleted file mode 100644 index 751da74..0000000 --- a/src/file-archive.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "file-archive.h" - -using namespace irr; - -io::E_FILE_ARCHIVE_TYPE -scm_to_file_archive_type (SCM file_archive_type) -{ - char* type_name = scm_to_utf8_string (scm_symbol_to_string (file_archive_type)); - io::E_FILE_ARCHIVE_TYPE type; - - if (!strcmp (type_name, "zip")) - { - type = io::EFAT_ZIP; - } - else if (!strcmp (type_name, "gzip")) - { - type = io::EFAT_GZIP; - } - else if (!strcmp (type_name, "folder")) - { - type = io::EFAT_FOLDER; - } - else if (!strcmp (type_name, "pak")) - { - type = io::EFAT_PAK; - } - else if (!strcmp (type_name, "npk")) - { - type = io::EFAT_NPK; - } - else if (!strcmp (type_name, "tar")) - { - type = io::EFAT_TAR; - } - else if (!strcmp (type_name, "wad")) - { - type = io::EFAT_WAD; - } - else if (!strcmp (type_name, "unknown")) - { - type = io::EFAT_UNKNOWN; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong file archive type: ~S", - scm_list_1 (file_archive_type), scm_list_1 (file_archive_type)); - } - - free (type_name); - return type; -} diff --git a/src/file-archive.h b/src/file-archive.h deleted file mode 100644 index 5c0635c..0000000 --- a/src/file-archive.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_FILE_ARCHIVE_H_INCLUDED__ -#define __GUILE_IRRLICHT_FILE_ARCHIVE_H_INCLUDED__ - -#include -#include - -irr::io::E_FILE_ARCHIVE_TYPE -scm_to_file_archive_type (SCM file_archive_type); - -#endif diff --git a/src/file-system.cpp b/src/file-system.cpp deleted file mode 100644 index 30a89ce..0000000 --- a/src/file-system.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "file-archive.h" -#include "file-system.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IFileSystem_addFileArchive (SCM file_system, - SCM filename, - SCM ignore_case, - SCM ignore_paths, - SCM archive_type, - SCM password, - SCM ret_archive) -{ - io::IFileArchive* retArchive = (io::IFileArchive*)scm_to_irr_pointer (ret_archive); - io::IFileArchive** retArchiveReference = 0; - if (retArchive != NULL) - { - retArchiveReference = &retArchive; - } - - char* cfilename = scm_to_utf8_string (filename); - char* cpassword = scm_to_utf8_string (password); - bool result = - (((io::IFileSystem*)scm_to_irr_pointer (file_system))-> - addFileArchive (cfilename, - scm_to_bool (ignore_case), - scm_to_bool (ignore_paths), - scm_to_file_archive_type (archive_type), - cpassword, - retArchiveReference)); - - free (cfilename); - free (cpassword); - return scm_from_bool (result); -} - -void -init_file_system (void) -{ - DEFINE_GSUBR ("IFileSystem_addFileArchive", 7, 0, 0, IFileSystem_addFileArchive); -} diff --git a/src/file-system.h b/src/file-system.h deleted file mode 100644 index 947c8cc..0000000 --- a/src/file-system.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_FILE_SYSTEM_H_INCLUDED__ -#define __GUILE_IRRLICHT_FILE_SYSTEM_H_INCLUDED__ - -void -init_file_system (void); - -#endif diff --git a/src/gsubr.h b/src/gsubr.h deleted file mode 100644 index 5db534d..0000000 --- a/src/gsubr.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GSUBR_H_INCLUDED__ -#define __GUILE_IRRLICHT_GSUBR_H_INCLUDED__ - -#include - -#define DEFINE_GSUBR(NAME, REQ, OPT, REST, FUNC) \ - scm_c_define_gsubr (NAME, REQ, OPT, REST, (scm_t_subr)FUNC); \ - scm_c_export (NAME, NULL); - -#endif diff --git a/src/gui-element.cpp b/src/gui-element.cpp deleted file mode 100644 index 896554d..0000000 --- a/src/gui-element.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "gui-element.h" -#include "wrapped.h" - -using namespace irr; - -template -SCM -IGUIElement_getID (SCM gui_element) -{ - T element = (T) scm_to_irr_pointer (gui_element); - return scm_from_int32 (element->getID ()); -} - -void -init_gui_element (void) -{ - DEFINE_GSUBR ("IGUIButton_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIEditBox_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIElement_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIFileOpenDialog_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIImage_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIListBox_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIScrollBar_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIStaticText_getID", 1, 0, 0, IGUIElement_getID); - DEFINE_GSUBR ("IGUIWindow_getID", 1, 0, 0, IGUIElement_getID); -} diff --git a/src/gui-element.h b/src/gui-element.h deleted file mode 100644 index 2808ca8..0000000 --- a/src/gui-element.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_ELEMENT_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_ELEMENT_H_INCLUDED__ - -#include -#include - -void -init_gui_element (void); - -#endif diff --git a/src/gui-environment.cpp b/src/gui-environment.cpp deleted file mode 100644 index c2e5272..0000000 --- a/src/gui-environment.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "gui-environment.h" -#include "position2d.h" -#include "rect.h" -#include "wchar.h" -#include "wrapped.h" - -using namespace irr; - -template -SCM -IGUIEnvironment_addButton (SCM gui_environment, - SCM rectangle, - SCM parent, - SCM id, - SCM text, - SCM tooltiptext) -{ - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - wchar_t* wtooltiptext = (wchar_t*) scm_to_utf32_string (tooltiptext); - - gui::IGUIButton* button = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))-> - addButton (scm_to_rect_s32 (rectangle), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id), - wtext, - wtooltiptext); - - free (wtext); - free (wtooltiptext); - return scm_from_irr_pointer ("", (void*) button); -} - -template -SCM -IGUIEnvironment_addEditBox (SCM gui_environment, - SCM text, - SCM rectangle, - SCM border, - SCM parent, - SCM id) -{ - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - - gui::IGUIEditBox* editbox = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))-> - addEditBox (wtext, - scm_to_rect_s32 (rectangle), - scm_to_bool (border), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id)); - - free (wtext); - return scm_from_irr_pointer ("", (void*) editbox); -} - -template -SCM -IGUIEnvironment_addFileOpenDialog (SCM gui_environment, - SCM title, - SCM modal, - SCM parent, - SCM id, - SCM restore_cwd, - SCM start_dir) -{ - gui::IGUIEnvironment* guienv = (gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment); - wchar_t* wtitle = (wchar_t*) scm_to_utf32_string (title); - io::path::char_type* cstartDir = scm_to_utf8_string (start_dir); - - gui::IGUIFileOpenDialog* dialog = - guienv->addFileOpenDialog (wtitle, - scm_to_bool (modal), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_bool (restore_cwd), - cstartDir); - - free (wtitle); - free (cstartDir); - return scm_from_irr_pointer ("", (void*) dialog); -} - -template -SCM -IGUIEnvironment_addImage (SCM gui_environment, - SCM image, - SCM position, - SCM use_alpha_channel, - SCM parent, - SCM id, - SCM text) -{ - gui::IGUIEnvironment* guienv = (gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment); - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - - gui::IGUIImage* new_image = - guienv->addImage ((video::ITexture*)scm_to_irr_pointer (image), - scm_to_position2d_s32 (position), - scm_to_bool (use_alpha_channel), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id), - wtext); - - free (wtext); - return scm_from_irr_pointer ("", (void*) new_image); -} - -template -SCM -IGUIEnvironment_addListBox (SCM gui_environment, - SCM rectangle, - SCM parent, - SCM id, - SCM draw_background) -{ - gui::IGUIListBox* listbox = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))-> - addListBox (scm_to_rect_s32 (rectangle), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_bool (draw_background)); - return scm_from_irr_pointer ("", (void*) listbox); -} - -template -SCM -IGUIEnvironment_addScrollBar (SCM gui_environment, - SCM horizontal, - SCM rectangle, - SCM parent, - SCM id) -{ - gui::IGUIScrollBar* scrollbar = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))-> - addScrollBar (scm_to_bool (horizontal), - scm_to_rect_s32 (rectangle), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id)); - return scm_from_irr_pointer ("", (void*) scrollbar); -} - -template -SCM -IGUIEnvironment_addStaticText (SCM gui_environment, - SCM text, - SCM rectangle, - SCM border, - SCM word_wrap, - SCM parent, - SCM id, - SCM fill_background) -{ - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - - gui::IGUIStaticText* static_text = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))-> - addStaticText (wtext, - scm_to_rect_s32 (rectangle), - scm_to_bool (border), - scm_to_bool (word_wrap), - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_bool (fill_background)); - - free (wtext); - return scm_from_irr_pointer ("", (void*) static_text); -} - -template -SCM -IGUIEnvironment_addWindow (SCM gui_environment, - SCM rectangle, - SCM modal, - SCM text, - SCM parent, - SCM id) -{ - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - - gui::IGUIWindow* window = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))-> - addWindow (scm_to_rect_s32 (rectangle), - scm_to_bool (modal), - wtext, - (TParent)scm_to_irr_pointer (parent), - scm_to_int32 (id)); - - free (wtext); - return scm_from_irr_pointer ("", (void*) window); -} - -SCM -IGUIEnvironment_drawAll (SCM gui_environment) -{ - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->drawAll (); - return SCM_UNSPECIFIED; -} - -SCM -IGUIEnvironment_getBuiltInFont (SCM gui_environment) -{ - gui::IGUIFont* font = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->getBuiltInFont (); - return scm_from_irr_pointer ("", (void*) font); -} - -SCM -IGUIEnvironment_getFont (SCM gui_environment, - SCM filename) -{ - char* cfilename = scm_to_utf8_string (filename); - gui::IGUIFont* font = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->getFont (cfilename); - free (cfilename); - return scm_from_irr_pointer ("", (void*) font); -} - -SCM -IGUIEnvironment_getSkin (SCM gui_environment) -{ - gui::IGUISkin* skin = - ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->getSkin (); - return scm_from_irr_pointer ("", (void*) skin); -} - -void -init_gui_environment (void) -{ - DEFINE_GSUBR ("IGUIEnvironment_addButton_IGUIElement", 6, 0, 0, - IGUIEnvironment_addButton); - DEFINE_GSUBR ("IGUIEnvironment_addEditBox_IGUIElement", 6, 0, 0, - IGUIEnvironment_addEditBox); - DEFINE_GSUBR ("IGUIEnvironment_addFileOpenDialog_IGUIElement", 7, 0, 0, - IGUIEnvironment_addFileOpenDialog); - DEFINE_GSUBR ("IGUIEnvironment_addImage_IGUIElement", 7, 0, 0, - IGUIEnvironment_addImage); - DEFINE_GSUBR ("IGUIEnvironment_addListBox_IGUIElement", 5, 0, 0, - IGUIEnvironment_addListBox); - DEFINE_GSUBR ("IGUIEnvironment_addScrollBar_IGUIElement", 5, 0, 0, - IGUIEnvironment_addScrollBar); - DEFINE_GSUBR ("IGUIEnvironment_addStaticText_IGUIElement", 8, 0, 0, - IGUIEnvironment_addStaticText); - DEFINE_GSUBR ("IGUIEnvironment_addStaticText_IGUIWindow", 8, 0, 0, - IGUIEnvironment_addStaticText); - DEFINE_GSUBR ("IGUIEnvironment_addWindow_IGUIElement", 6, 0, 0, - IGUIEnvironment_addWindow); - DEFINE_GSUBR ("IGUIEnvironment_drawAll", 1, 0, 0, IGUIEnvironment_drawAll); - DEFINE_GSUBR ("IGUIEnvironment_getBuiltInFont", 1, 0, 0, IGUIEnvironment_getBuiltInFont); - DEFINE_GSUBR ("IGUIEnvironment_getFont", 2, 0, 0, IGUIEnvironment_getFont); - DEFINE_GSUBR ("IGUIEnvironment_getSkin", 1, 0, 0, IGUIEnvironment_getSkin); -} diff --git a/src/gui-environment.h b/src/gui-environment.h deleted file mode 100644 index d621b84..0000000 --- a/src/gui-environment.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_ENVIRONMENT_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_ENVIRONMENT_H_INCLUDED__ - -void -init_gui_environment (void); - -#endif diff --git a/src/gui-file-open-dialog.cpp b/src/gui-file-open-dialog.cpp deleted file mode 100644 index c706a6f..0000000 --- a/src/gui-file-open-dialog.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gui-file-open-dialog.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUIFileOpenDialog_getFileName (SCM gui_file_open_dialog) -{ - gui::IGUIFileOpenDialog* dialog = - (gui::IGUIFileOpenDialog*)scm_to_irr_pointer (gui_file_open_dialog); - return scm_from_utf32_string ((scm_t_wchar*) dialog->getFileName ()); -} - -void -init_gui_file_open_dialog (void) -{ - DEFINE_GSUBR ("IGUIFileOpenDialog_getFileName", 1, 0, 0, IGUIFileOpenDialog_getFileName); -} diff --git a/src/gui-file-open-dialog.h b/src/gui-file-open-dialog.h deleted file mode 100644 index 717b51d..0000000 --- a/src/gui-file-open-dialog.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ - -void -init_gui_file_open_dialog (void); - -#endif diff --git a/src/gui-in-out-fader.cpp b/src/gui-in-out-fader.cpp deleted file mode 100644 index ea296a5..0000000 --- a/src/gui-in-out-fader.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "color.h" -#include "gsubr.h" -#include "gui-in-out-fader.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUIInOutFader_setColor (SCM in_out_fader, - SCM color, - SCM dest_color) -{ - gui::IGUIInOutFader* fader = (gui::IGUIInOutFader*)scm_to_irr_pointer (in_out_fader); - if (dest_color == SCM_UNDEFINED) - { - fader->setColor (scm_to_color (color)); - } - else - { - fader->setColor (scm_to_color (color), - scm_to_color (dest_color)); - } - return SCM_UNSPECIFIED; -} - -void -init_gui_in_out_fader (void) -{ - DEFINE_GSUBR ("IGUIInOutFader_setColor", 2, 1, 0, IGUIInOutFader_setColor); -} diff --git a/src/gui-in-out-fader.h b/src/gui-in-out-fader.h deleted file mode 100644 index 1e9c4d1..0000000 --- a/src/gui-in-out-fader.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_IN_OUT_FADER_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_IN_OUT_FADER_H_INCLUDED__ - -void -init_gui_in_out_fader (void); - -#endif diff --git a/src/gui-listbox.cpp b/src/gui-listbox.cpp deleted file mode 100644 index a839690..0000000 --- a/src/gui-listbox.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gui-listbox.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUIListBox_addItem (SCM gui_listbox, - SCM text, - SCM icon) -{ - gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_irr_pointer (gui_listbox); - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - u32 item_id; - if (icon == SCM_UNDEFINED) - { - item_id = listbox->addItem (wtext); - } - else - { - item_id = listbox->addItem (wtext, - scm_to_int32 (icon)); - } - free (wtext); - return scm_from_uint32 (item_id); -} - -void -init_gui_listbox (void) -{ - DEFINE_GSUBR ("IGUIListBox_addItem", 2, 1, 0, IGUIListBox_addItem); -} diff --git a/src/gui-listbox.h b/src/gui-listbox.h deleted file mode 100644 index 0a6d016..0000000 --- a/src/gui-listbox.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_LISTBOX_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_LISTBOX_H_INCLUDED__ - -void -init_gui_listbox (void); - -#endif diff --git a/src/gui-scrollbar.cpp b/src/gui-scrollbar.cpp deleted file mode 100644 index bf9bd1c..0000000 --- a/src/gui-scrollbar.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gui-scrollbar.h" -#include "gsubr.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUIScrollBar_getPos (SCM gui_scrollbar) -{ - return scm_from_int32 - (((gui::IGUIScrollBar*)scm_to_irr_pointer (gui_scrollbar))->getPos ()); -} - -SCM -IGUIScrollBar_setMax (SCM gui_scrollbar, - SCM max) -{ - ((gui::IGUIScrollBar*) scm_to_irr_pointer (gui_scrollbar))->setMax (scm_to_int32 (max)); - return SCM_UNSPECIFIED; -} - -SCM -IGUIScrollBar_setPos (SCM gui_scrollbar, - SCM pos) -{ - ((gui::IGUIScrollBar*) scm_to_irr_pointer (gui_scrollbar))->setPos (scm_to_int32 (pos)); - return SCM_UNSPECIFIED; -} - -void -init_gui_scrollbar (void) -{ - DEFINE_GSUBR ("IGUIScrollBar_getPos", 1, 0, 0, IGUIScrollBar_getPos); - DEFINE_GSUBR ("IGUIScrollBar_setMax", 2, 0, 0, IGUIScrollBar_setMax); - DEFINE_GSUBR ("IGUIScrollBar_setPos", 2, 0, 0, IGUIScrollBar_setPos); -} diff --git a/src/gui-scrollbar.h b/src/gui-scrollbar.h deleted file mode 100644 index 5c55a43..0000000 --- a/src/gui-scrollbar.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_SCROLLBAR_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_SCROLLBAR_H_INCLUDED__ - -void -init_gui_scrollbar (void); - -#endif diff --git a/src/gui-skin.cpp b/src/gui-skin.cpp deleted file mode 100644 index aeebebe..0000000 --- a/src/gui-skin.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "color.h" -#include "gsubr.h" -#include "gui-skin.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUISkin_getColor (SCM gui_skin, - SCM color) -{ - gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin); - video::SColor scolor = skin->getColor (scm_to_default_color (color)); - return scm_from_color (scolor); -} - -SCM -IGUISkin_getFont (SCM gui_skin, - SCM which) -{ - gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin); - gui::IGUIFont* font = skin->getFont (scm_to_default_font (which)); - return scm_from_irr_pointer ("", (void*) font); -} - -SCM -IGUISkin_setColor (SCM gui_skin, - SCM which, - SCM new_color) -{ - gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin); - skin->setColor (scm_to_default_color (which), - scm_to_color (new_color)); - return SCM_UNSPECIFIED; -} - -SCM -IGUISkin_setFont (SCM gui_skin, - SCM font, - SCM which) -{ - gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin); - skin->setFont ((gui::IGUIFont*) scm_to_irr_pointer (font), - scm_to_default_font (which)); - return SCM_UNSPECIFIED; -} - -void -init_gui_skin (void) -{ - DEFINE_GSUBR ("IGUISkin_getColor", 2, 0, 0, IGUISkin_getColor); - DEFINE_GSUBR ("IGUISkin_getFont", 2, 0, 0, IGUISkin_getFont); - DEFINE_GSUBR ("IGUISkin_setColor", 3, 0, 0, IGUISkin_setColor); - DEFINE_GSUBR ("IGUISkin_setFont", 3, 0, 0, IGUISkin_setFont); -} - -gui::EGUI_DEFAULT_COLOR -scm_to_default_color (SCM default_color) -{ - char* color_name = scm_to_utf8_string (scm_symbol_to_string (default_color)); - gui::EGUI_DEFAULT_COLOR color; - - if (!strcmp (color_name, "3d-dark-shadow")) - { - color = gui::EGDC_3D_DARK_SHADOW; - } - else if (!strcmp (color_name, "3d-shadow")) - { - color = gui::EGDC_3D_SHADOW; - } - else if (!strcmp (color_name, "3d-face")) - { - color = gui::EGDC_3D_FACE; - } - else if (!strcmp (color_name, "3d-high-light")) - { - color = gui::EGDC_3D_HIGH_LIGHT; - } - else if (!strcmp (color_name, "3d-light")) - { - color = gui::EGDC_3D_LIGHT; - } - else if (!strcmp (color_name, "active-border")) - { - color = gui::EGDC_ACTIVE_BORDER; - } - else if (!strcmp (color_name, "active-caption")) - { - color = gui::EGDC_ACTIVE_CAPTION; - } - else if (!strcmp (color_name, "app-workspace")) - { - color = gui::EGDC_APP_WORKSPACE; - } - else if (!strcmp (color_name, "button-text")) - { - color = gui::EGDC_BUTTON_TEXT; - } - else if (!strcmp (color_name, "gray-text")) - { - color = gui::EGDC_GRAY_TEXT; - } - else if (!strcmp (color_name, "high-light")) - { - color = gui::EGDC_HIGH_LIGHT; - } - else if (!strcmp (color_name, "high-light-text")) - { - color = gui::EGDC_HIGH_LIGHT_TEXT; - } - else if (!strcmp (color_name, "inactive-border")) - { - color = gui::EGDC_INACTIVE_BORDER; - } - else if (!strcmp (color_name, "inactive-caption")) - { - color = gui::EGDC_INACTIVE_CAPTION; - } - else if (!strcmp (color_name, "tooltip")) - { - color = gui::EGDC_TOOLTIP; - } - else if (!strcmp (color_name, "tooltip-background")) - { - color = gui::EGDC_TOOLTIP_BACKGROUND; - } - else if (!strcmp (color_name, "scrollbar")) - { - color = gui::EGDC_SCROLLBAR; - } - else if (!strcmp (color_name, "window")) - { - color = gui::EGDC_WINDOW; - } - else if (!strcmp (color_name, "window-symbol")) - { - color = gui::EGDC_WINDOW_SYMBOL; - } - else if (!strcmp (color_name, "icon")) - { - color = gui::EGDC_ICON; - } - else if (!strcmp (color_name, "icon-high-light")) - { - color = gui::EGDC_ICON_HIGH_LIGHT; - } - else if (!strcmp (color_name, "gray-window-symbol")) - { - color = gui::EGDC_GRAY_WINDOW_SYMBOL; - } - else if (!strcmp (color_name, "editable")) - { - color = gui::EGDC_EDITABLE; - } - else if (!strcmp (color_name, "gray-editable")) - { - color = gui::EGDC_GRAY_EDITABLE; - } - else if (!strcmp (color_name, "focused-editable")) - { - color = gui::EGDC_FOCUSED_EDITABLE; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong default color: ~S", - scm_list_1 (default_color), scm_list_1 (default_color)); - } - - free (color_name); - return color; -} - -gui::EGUI_DEFAULT_FONT -scm_to_default_font (SCM default_font) -{ - char* font_name = scm_to_utf8_string (scm_symbol_to_string (default_font)); - gui::EGUI_DEFAULT_FONT font; - - if (!strcmp (font_name, "default")) - { - font = gui::EGDF_DEFAULT; - } - else if (!strcmp (font_name, "button")) - { - font = gui::EGDF_BUTTON; - } - else if (!strcmp (font_name, "window")) - { - font = gui::EGDF_WINDOW; - } - else if (!strcmp (font_name, "menu")) - { - font = gui::EGDF_MENU; - } - else if (!strcmp (font_name, "tooltip")) - { - font = gui::EGDF_TOOLTIP; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong default font: ~S", - scm_list_1 (default_font), scm_list_1 (default_font)); - } - - free (font_name); - return font; -} diff --git a/src/gui-skin.h b/src/gui-skin.h deleted file mode 100644 index 57a31d9..0000000 --- a/src/gui-skin.h +++ /dev/null @@ -1,37 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_SKIN_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_SKIN_H_INCLUDED__ - -#include -#include - -void -init_gui_skin (void); - -irr::gui::EGUI_DEFAULT_COLOR -scm_to_default_color (SCM default_color); - -irr::gui::EGUI_DEFAULT_FONT -scm_to_default_font (SCM default_font); - -#endif diff --git a/src/gui-static-text.cpp b/src/gui-static-text.cpp deleted file mode 100644 index 9785b11..0000000 --- a/src/gui-static-text.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "color.h" -#include "gsubr.h" -#include "gui-static-text.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUIStaticText_setOverrideColor (SCM gui_static_text, - SCM color) -{ - gui::IGUIStaticText* static_text = (gui::IGUIStaticText*) scm_to_irr_pointer (gui_static_text); - static_text->setOverrideColor (scm_to_color (color)); - return SCM_UNSPECIFIED; -} - -void -init_gui_static_text (void) -{ - DEFINE_GSUBR ("IGUIStaticText_setOverrideColor", 2, 0, 0, IGUIStaticText_setOverrideColor); -} diff --git a/src/gui-static-text.h b/src/gui-static-text.h deleted file mode 100644 index 319555b..0000000 --- a/src/gui-static-text.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_STATIC_TEXT_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_STATIC_TEXT_H_INCLUDED__ - -#include -#include - -void -init_gui_static_text (void); - -#endif diff --git a/src/gui-toolbar.cpp b/src/gui-toolbar.cpp deleted file mode 100644 index 1340816..0000000 --- a/src/gui-toolbar.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "gui-toolbar.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IGUIToolBar_addButton (SCM gui_toolbar, - SCM id, - SCM text, - SCM tooltiptext, - SCM img, - SCM pressedimg, - SCM is_push_button, - SCM use_alpha_channel) -{ - gui::IGUIToolBar* toolbar = (gui::IGUIToolBar*) scm_to_irr_pointer (gui_toolbar); - wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); - wchar_t* wtooltiptext = (wchar_t*) scm_to_utf32_string (tooltiptext); - - gui::IGUIButton* button = - toolbar->addButton (scm_to_int32 (id), - wtext, - wtooltiptext, - (video::ITexture*) scm_to_irr_pointer (img), - (video::ITexture*) scm_to_irr_pointer (pressedimg), - scm_to_bool (is_push_button), - scm_to_bool (use_alpha_channel)); - - free (wtext); - free (wtooltiptext); - return scm_from_irr_pointer ("", (void*) button); -} - -void -init_gui_toolbar (void) -{ - DEFINE_GSUBR ("IGUIToolBar_addButton", 8, 0, 0, IGUIToolBar_addButton); -} diff --git a/src/gui-toolbar.h b/src/gui-toolbar.h deleted file mode 100644 index 9f5b574..0000000 --- a/src/gui-toolbar.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_GUI_TOOLBAR_H_INCLUDED__ -#define __GUILE_IRRLICHT_GUI_TOOLBAR_H_INCLUDED__ - -void -init_gui_toolbar (void); - -#endif diff --git a/src/guile-irrlicht.cpp b/src/guile-irrlicht.cpp deleted file mode 100644 index 8f04ce3..0000000 --- a/src/guile-irrlicht.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include "animated-mesh.h" -#include "animated-mesh-scene-node.h" -#include "box3d.h" -#include "cursor-control.h" -#include "device.h" -#include "event-receiver.h" -#include "file-system.h" -#include "gui-element.h" -#include "gui-environment.h" -#include "gui-file-open-dialog.h" -#include "gui-in-out-fader.h" -#include "gui-listbox.h" -#include "gui-scrollbar.h" -#include "gui-skin.h" -#include "gui-static-text.h" -#include "gui-toolbar.h" -#include "guile-irrlicht.h" -#include "material.h" -#include "reference-counted.h" -#include "scene-manager.h" -#include "scene-node.h" -#include "timer.h" -#include "vertex3d.h" -#include "video-driver.h" - - -extern "C" { - - void - init_guile_irrlicht (void) - { - init_animated_mesh (); - init_animated_mesh_scene_node (); - init_box3d (); - init_cursor_control (); - init_device (); - init_event_receiver (); - init_file_system (); - init_gui_element (); - init_gui_environment (); - init_gui_file_open_dialog (); - init_gui_in_out_fader (); - init_gui_listbox (); - init_gui_scrollbar (); - init_gui_skin (); - init_gui_static_text (); - init_gui_toolbar (); - init_material (); - init_reference_counted (); - init_scene_manager (); - init_scene_node (); - init_timer (); - init_vertex3d (); - init_video_driver (); - } - -} diff --git a/src/guile-irrlicht.h b/src/guile-irrlicht.h deleted file mode 100644 index f3ba249..0000000 --- a/src/guile-irrlicht.h +++ /dev/null @@ -1,30 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_H_INCLUDED__ -#define __GUILE_IRRLICHT_H_INCLUDED__ - -extern "C" { - void - init_guile_irrlicht (void); -} - -#endif diff --git a/src/keycodes.cpp b/src/keycodes.cpp deleted file mode 100644 index 0f1d132..0000000 --- a/src/keycodes.cpp +++ /dev/null @@ -1,637 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include - -using namespace irr; - -SCM -scm_from_key_code (EKEY_CODE key_code) -{ - switch (key_code) - { - case KEY_LBUTTON: - return scm_from_utf8_symbol ("lbutton"); - break; - - case KEY_RBUTTON: - return scm_from_utf8_symbol ("rbutton"); - break; - - case KEY_CANCEL: - return scm_from_utf8_symbol ("cancel"); - break; - - case KEY_MBUTTON: - return scm_from_utf8_symbol ("mbutton"); - break; - - case KEY_XBUTTON1: - return scm_from_utf8_symbol ("xbutton1"); - break; - - case KEY_XBUTTON2: - return scm_from_utf8_symbol ("xbutton2"); - break; - - case KEY_BACK: - return scm_from_utf8_symbol ("back"); - break; - - case KEY_TAB: - return scm_from_utf8_symbol ("tab"); - break; - - case KEY_CLEAR: - return scm_from_utf8_symbol ("clear"); - break; - - case KEY_RETURN: - return scm_from_utf8_symbol ("return"); - break; - - case KEY_SHIFT: - return scm_from_utf8_symbol ("shift"); - break; - - case KEY_CONTROL: - return scm_from_utf8_symbol ("control"); - break; - - case KEY_MENU: - return scm_from_utf8_symbol ("menu"); - break; - - case KEY_PAUSE: - return scm_from_utf8_symbol ("pause"); - break; - - case KEY_CAPITAL: - return scm_from_utf8_symbol ("capital"); - break; - - case KEY_KANA: - return scm_from_utf8_symbol ("kana"); - break; - - case KEY_JUNJA: - return scm_from_utf8_symbol ("junja"); - break; - - case KEY_FINAL: - return scm_from_utf8_symbol ("final"); - break; - - case KEY_HANJA: - return scm_from_utf8_symbol ("hanja"); - break; - - case KEY_ESCAPE: - return scm_from_utf8_symbol ("escape"); - break; - - case KEY_CONVERT: - return scm_from_utf8_symbol ("convert"); - break; - - case KEY_NONCONVERT: - return scm_from_utf8_symbol ("nonconvert"); - break; - - case KEY_ACCEPT: - return scm_from_utf8_symbol ("accept"); - break; - - case KEY_MODECHANGE: - return scm_from_utf8_symbol ("modechange"); - break; - - case KEY_SPACE: - return scm_from_utf8_symbol ("space"); - break; - - case KEY_PRIOR: - return scm_from_utf8_symbol ("prior"); - break; - - case KEY_NEXT: - return scm_from_utf8_symbol ("next"); - break; - - case KEY_END: - return scm_from_utf8_symbol ("end"); - break; - - case KEY_HOME: - return scm_from_utf8_symbol ("home"); - break; - - case KEY_LEFT: - return scm_from_utf8_symbol ("left"); - break; - - case KEY_UP: - return scm_from_utf8_symbol ("up"); - break; - - case KEY_RIGHT: - return scm_from_utf8_symbol ("right"); - break; - - case KEY_DOWN: - return scm_from_utf8_symbol ("down"); - break; - - case KEY_SELECT: - return scm_from_utf8_symbol ("select"); - break; - - case KEY_PRINT: - return scm_from_utf8_symbol ("print"); - break; - - case KEY_EXECUT: - return scm_from_utf8_symbol ("execut"); - break; - - case KEY_SNAPSHOT: - return scm_from_utf8_symbol ("snapshot"); - break; - - case KEY_INSERT: - return scm_from_utf8_symbol ("insert"); - break; - - case KEY_DELETE: - return scm_from_utf8_symbol ("delete"); - break; - - case KEY_HELP: - return scm_from_utf8_symbol ("help"); - break; - - case KEY_KEY_0: - return scm_from_utf8_symbol ("key-0"); - break; - - case KEY_KEY_1: - return scm_from_utf8_symbol ("key-1"); - break; - - case KEY_KEY_2: - return scm_from_utf8_symbol ("key-2"); - break; - - case KEY_KEY_3: - return scm_from_utf8_symbol ("key-3"); - break; - - case KEY_KEY_4: - return scm_from_utf8_symbol ("key-4"); - break; - - case KEY_KEY_5: - return scm_from_utf8_symbol ("key-5"); - break; - - case KEY_KEY_6: - return scm_from_utf8_symbol ("key-6"); - break; - - case KEY_KEY_7: - return scm_from_utf8_symbol ("key-7"); - break; - - case KEY_KEY_8: - return scm_from_utf8_symbol ("key-8"); - break; - - case KEY_KEY_9: - return scm_from_utf8_symbol ("key-9"); - break; - - case KEY_KEY_A: - return scm_from_utf8_symbol ("key-a"); - break; - - case KEY_KEY_B: - return scm_from_utf8_symbol ("key-b"); - break; - - case KEY_KEY_C: - return scm_from_utf8_symbol ("key-c"); - break; - - case KEY_KEY_D: - return scm_from_utf8_symbol ("key-d"); - break; - - case KEY_KEY_E: - return scm_from_utf8_symbol ("key-e"); - break; - - case KEY_KEY_F: - return scm_from_utf8_symbol ("key-f"); - break; - - case KEY_KEY_G: - return scm_from_utf8_symbol ("key-g"); - break; - - case KEY_KEY_H: - return scm_from_utf8_symbol ("key-h"); - break; - - case KEY_KEY_I: - return scm_from_utf8_symbol ("key-i"); - break; - - case KEY_KEY_J: - return scm_from_utf8_symbol ("key-j"); - break; - - case KEY_KEY_K: - return scm_from_utf8_symbol ("key-k"); - break; - - case KEY_KEY_L: - return scm_from_utf8_symbol ("key-l"); - break; - - case KEY_KEY_M: - return scm_from_utf8_symbol ("key-m"); - break; - - case KEY_KEY_N: - return scm_from_utf8_symbol ("key-n"); - break; - - case KEY_KEY_O: - return scm_from_utf8_symbol ("key-o"); - break; - - case KEY_KEY_P: - return scm_from_utf8_symbol ("key-p"); - break; - - case KEY_KEY_Q: - return scm_from_utf8_symbol ("key-q"); - break; - - case KEY_KEY_R: - return scm_from_utf8_symbol ("key-r"); - break; - - case KEY_KEY_S: - return scm_from_utf8_symbol ("key-s"); - break; - - case KEY_KEY_T: - return scm_from_utf8_symbol ("key-t"); - break; - - case KEY_KEY_U: - return scm_from_utf8_symbol ("key-u"); - break; - - case KEY_KEY_V: - return scm_from_utf8_symbol ("key-v"); - break; - - case KEY_KEY_W: - return scm_from_utf8_symbol ("key-w"); - break; - - case KEY_KEY_X: - return scm_from_utf8_symbol ("key-x"); - break; - - case KEY_KEY_Y: - return scm_from_utf8_symbol ("key-y"); - break; - - case KEY_KEY_Z: - return scm_from_utf8_symbol ("key-z"); - break; - - case KEY_LWIN: - return scm_from_utf8_symbol ("lwin"); - break; - - case KEY_RWIN: - return scm_from_utf8_symbol ("rwin"); - break; - - case KEY_APPS: - return scm_from_utf8_symbol ("apps"); - break; - - case KEY_SLEEP: - return scm_from_utf8_symbol ("sleep"); - break; - - case KEY_NUMPAD0: - return scm_from_utf8_symbol ("numpad0"); - break; - - case KEY_NUMPAD1: - return scm_from_utf8_symbol ("numpad1"); - break; - - case KEY_NUMPAD2: - return scm_from_utf8_symbol ("numpad2"); - break; - - case KEY_NUMPAD3: - return scm_from_utf8_symbol ("numpad3"); - break; - - case KEY_NUMPAD4: - return scm_from_utf8_symbol ("numpad4"); - break; - - case KEY_NUMPAD5: - return scm_from_utf8_symbol ("numpad5"); - break; - - case KEY_NUMPAD6: - return scm_from_utf8_symbol ("numpad6"); - break; - - case KEY_NUMPAD7: - return scm_from_utf8_symbol ("numpad7"); - break; - - case KEY_NUMPAD8: - return scm_from_utf8_symbol ("numpad8"); - break; - - case KEY_NUMPAD9: - return scm_from_utf8_symbol ("numpad9"); - break; - - case KEY_MULTIPLY: - return scm_from_utf8_symbol ("multiply"); - break; - - case KEY_ADD: - return scm_from_utf8_symbol ("add"); - break; - - case KEY_SEPARATOR: - return scm_from_utf8_symbol ("separator"); - break; - - case KEY_SUBTRACT: - return scm_from_utf8_symbol ("subtract"); - break; - - case KEY_DECIMAL: - return scm_from_utf8_symbol ("decimal"); - break; - - case KEY_DIVIDE: - return scm_from_utf8_symbol ("divide"); - break; - - case KEY_F1: - return scm_from_utf8_symbol ("f1"); - break; - - case KEY_F2: - return scm_from_utf8_symbol ("f2"); - break; - - case KEY_F3: - return scm_from_utf8_symbol ("f3"); - break; - - case KEY_F4: - return scm_from_utf8_symbol ("f4"); - break; - - case KEY_F5: - return scm_from_utf8_symbol ("f5"); - break; - - case KEY_F6: - return scm_from_utf8_symbol ("f6"); - break; - - case KEY_F7: - return scm_from_utf8_symbol ("f7"); - break; - - case KEY_F8: - return scm_from_utf8_symbol ("f8"); - break; - - case KEY_F9: - return scm_from_utf8_symbol ("f9"); - break; - - case KEY_F10: - return scm_from_utf8_symbol ("f10"); - break; - - case KEY_F11: - return scm_from_utf8_symbol ("f11"); - break; - - case KEY_F12: - return scm_from_utf8_symbol ("f12"); - break; - - case KEY_F13: - return scm_from_utf8_symbol ("f13"); - break; - - case KEY_F14: - return scm_from_utf8_symbol ("f14"); - break; - - case KEY_F15: - return scm_from_utf8_symbol ("f15"); - break; - - case KEY_F16: - return scm_from_utf8_symbol ("f16"); - break; - - case KEY_F17: - return scm_from_utf8_symbol ("f17"); - break; - - case KEY_F18: - return scm_from_utf8_symbol ("f18"); - break; - - case KEY_F19: - return scm_from_utf8_symbol ("f19"); - break; - - case KEY_F20: - return scm_from_utf8_symbol ("f20"); - break; - - case KEY_F21: - return scm_from_utf8_symbol ("f21"); - break; - - case KEY_F22: - return scm_from_utf8_symbol ("f22"); - break; - - case KEY_F23: - return scm_from_utf8_symbol ("f23"); - break; - - case KEY_F24: - return scm_from_utf8_symbol ("f24"); - break; - - case KEY_NUMLOCK: - return scm_from_utf8_symbol ("numlock"); - break; - - case KEY_SCROLL: - return scm_from_utf8_symbol ("scroll"); - break; - - case KEY_LSHIFT: - return scm_from_utf8_symbol ("lshift"); - break; - - case KEY_RSHIFT: - return scm_from_utf8_symbol ("rshift"); - break; - - case KEY_LCONTROL: - return scm_from_utf8_symbol ("lcontrol"); - break; - - case KEY_RCONTROL: - return scm_from_utf8_symbol ("rcontrol"); - break; - - case KEY_LMENU: - return scm_from_utf8_symbol ("lmenu"); - break; - - case KEY_RMENU: - return scm_from_utf8_symbol ("rmenu"); - break; - - case KEY_OEM_1: - return scm_from_utf8_symbol ("oem-1"); - break; - - case KEY_PLUS: - return scm_from_utf8_symbol ("plus"); - break; - - case KEY_COMMA: - return scm_from_utf8_symbol ("comma"); - break; - - case KEY_MINUS: - return scm_from_utf8_symbol ("minus"); - break; - - case KEY_PERIOD: - return scm_from_utf8_symbol ("period"); - break; - - case KEY_OEM_2: - return scm_from_utf8_symbol ("oem-2"); - break; - - case KEY_OEM_3: - return scm_from_utf8_symbol ("oem-3"); - break; - - case KEY_OEM_4: - return scm_from_utf8_symbol ("oem-4"); - break; - - case KEY_OEM_5: - return scm_from_utf8_symbol ("oem-5"); - break; - - case KEY_OEM_6: - return scm_from_utf8_symbol ("oem-6"); - break; - - case KEY_OEM_7: - return scm_from_utf8_symbol ("oem-7"); - break; - - case KEY_OEM_8: - return scm_from_utf8_symbol ("oem-8"); - break; - - case KEY_OEM_AX: - return scm_from_utf8_symbol ("oem-ax"); - break; - - case KEY_OEM_102: - return scm_from_utf8_symbol ("oem-102"); - break; - - case KEY_ATTN: - return scm_from_utf8_symbol ("attn"); - break; - - case KEY_CRSEL: - return scm_from_utf8_symbol ("crsel"); - break; - - case KEY_EXSEL: - return scm_from_utf8_symbol ("exsel"); - break; - - case KEY_EREOF: - return scm_from_utf8_symbol ("ereof"); - break; - - case KEY_PLAY: - return scm_from_utf8_symbol ("play"); - break; - - case KEY_ZOOM: - return scm_from_utf8_symbol ("zoom"); - break; - - case KEY_PA1: - return scm_from_utf8_symbol ("pa1"); - break; - - case KEY_OEM_CLEAR: - return scm_from_utf8_symbol ("oem-clear"); - break; - - default: - SCM code = scm_from_uint (key_code); - scm_error (scm_arg_type_key, NULL, "Wrong key code: ~S", - scm_list_1 (code), scm_list_1 (code)); - } -} diff --git a/src/keycodes.h b/src/keycodes.h deleted file mode 100644 index a9a04a8..0000000 --- a/src/keycodes.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_KEYCODES_H_INCLUDED__ -#define __GUILE_IRRLICHT_KEYCODES_H_INCLUDED__ - -#include -#include - -SCM -scm_from_key_code (irr::EKEY_CODE key_code); - -#endif diff --git a/src/material-flags.cpp b/src/material-flags.cpp deleted file mode 100644 index d69bd77..0000000 --- a/src/material-flags.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include - -using namespace irr; - -video::E_MATERIAL_FLAG -scm_to_material_flag (SCM material_flag) -{ - char* flag_name = scm_to_utf8_string (scm_symbol_to_string (material_flag)); - video::E_MATERIAL_FLAG flag; - - if (!strcmp (flag_name, "wireframe")) - { - flag = video::EMF_WIREFRAME; - } - else if (!strcmp (flag_name, "pointcloud")) - { - flag = video::EMF_POINTCLOUD; - } - else if (!strcmp (flag_name, "gouraud-shading")) - { - flag = video::EMF_GOURAUD_SHADING; - } - else if (!strcmp (flag_name, "lighting")) - { - flag = video::EMF_LIGHTING; - } - else if (!strcmp (flag_name, "zbuffer")) - { - flag = video::EMF_ZBUFFER; - } - else if (!strcmp (flag_name, "zwrite-enable")) - { - flag = video::EMF_ZWRITE_ENABLE; - } - else if (!strcmp (flag_name, "back-face-culling")) - { - flag = video::EMF_BACK_FACE_CULLING; - } - else if (!strcmp (flag_name, "front-face-culling")) - { - flag = video::EMF_FRONT_FACE_CULLING; - } - else if (!strcmp (flag_name, "bilinear-filter")) - { - flag = video::EMF_BILINEAR_FILTER; - } - else if (!strcmp (flag_name, "trilinear-filter")) - { - flag = video::EMF_TRILINEAR_FILTER; - } - else if (!strcmp (flag_name, "anisotropic-filter")) - { - flag = video::EMF_ANISOTROPIC_FILTER; - } - else if (!strcmp (flag_name, "fog-enable")) - { - flag = video::EMF_FOG_ENABLE; - } - else if (!strcmp (flag_name, "normalize-normals")) - { - flag = video::EMF_NORMALIZE_NORMALS; - } - else if (!strcmp (flag_name, "texture-wrap")) - { - flag = video::EMF_TEXTURE_WRAP; - } - else if (!strcmp (flag_name, "anti-aliasing")) - { - flag = video::EMF_ANTI_ALIASING; - } - else if (!strcmp (flag_name, "color-mask")) - { - flag = video::EMF_COLOR_MASK; - } - else if (!strcmp (flag_name, "color-material")) - { - flag = video::EMF_COLOR_MATERIAL; - } - else if (!strcmp (flag_name, "use-mip-maps")) - { - flag = video::EMF_USE_MIP_MAPS; - } - else if (!strcmp (flag_name, "blend-operation")) - { - flag = video::EMF_BLEND_OPERATION; - } - else if (!strcmp (flag_name, "polygon-offset")) - { - flag = video::EMF_POLYGON_OFFSET; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong material flag: ~S", - scm_list_1 (material_flag), scm_list_1 (material_flag)); - } - - free (flag_name); - return flag; -} diff --git a/src/material-flags.h b/src/material-flags.h deleted file mode 100644 index d73f691..0000000 --- a/src/material-flags.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_MATERIAL_FLAGS_H_INCLUDED__ -#define __GUILE_IRRLICHT_MATERIAL_FLAGS_H_INCLUDED__ - -#include -#include - -irr::video::E_MATERIAL_FLAG -scm_to_material_flag (SCM material_flag); - -#endif diff --git a/src/material-types.cpp b/src/material-types.cpp deleted file mode 100644 index eddb4cf..0000000 --- a/src/material-types.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "material-types.h" - -using namespace irr; - -video::E_MATERIAL_TYPE -scm_to_material_type (SCM material_type) -{ - char* type_name = scm_to_utf8_string (scm_symbol_to_string (material_type)); - video::E_MATERIAL_TYPE type; - - if (!strcmp (type_name, "solid")) - { - type = video::EMT_SOLID; - } - else if (!strcmp (type_name, "solid-2-layer")) - { - type = video::EMT_SOLID_2_LAYER; - } - else if (!strcmp (type_name, "lightmap")) - { - type = video::EMT_LIGHTMAP; - } - else if (!strcmp (type_name, "lightmap-add")) - { - type = video::EMT_LIGHTMAP_ADD; - } - else if (!strcmp (type_name, "lightmap-m2")) - { - type = video::EMT_LIGHTMAP_M2; - } - else if (!strcmp (type_name, "lightmap-m4")) - { - type = video::EMT_LIGHTMAP_M4; - } - else if (!strcmp (type_name, "lightmap-lighting")) - { - type = video::EMT_LIGHTMAP_LIGHTING; - } - else if (!strcmp (type_name, "lightmap-lighting-m2")) - { - type = video::EMT_LIGHTMAP_LIGHTING_M2; - } - else if (!strcmp (type_name, "lightmap-lighting-m4")) - { - type = video::EMT_LIGHTMAP_LIGHTING_M4; - } - else if (!strcmp (type_name, "detail-map")) - { - type = video::EMT_DETAIL_MAP; - } - else if (!strcmp (type_name, "sphere-map")) - { - type = video::EMT_SPHERE_MAP; - } - else if (!strcmp (type_name, "reflection-2-layer")) - { - type = video::EMT_REFLECTION_2_LAYER; - } - else if (!strcmp (type_name, "transparent-add-color")) - { - type = video::EMT_TRANSPARENT_ADD_COLOR; - } - else if (!strcmp (type_name, "transparent-alpha-channel")) - { - type = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - } - else if (!strcmp (type_name, "transparent-alpha-channel-ref")) - { - type = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; - } - else if (!strcmp (type_name, "transparent-vertex-alpha")) - { - type = video::EMT_TRANSPARENT_VERTEX_ALPHA; - } - else if (!strcmp (type_name, "transparent-reflection-2-layer")) - { - type = video::EMT_TRANSPARENT_REFLECTION_2_LAYER; - } - else if (!strcmp (type_name, "normal-map-solid")) - { - type = video::EMT_NORMAL_MAP_SOLID; - } - else if (!strcmp (type_name, "normal-map-transparent-add-color")) - { - type = video::EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR; - } - else if (!strcmp (type_name, "normal-map-transparent-vertex-alpha")) - { - type = video::EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA; - } - else if (!strcmp (type_name, "parallax-map-solid")) - { - type = video::EMT_PARALLAX_MAP_SOLID; - } - else if (!strcmp (type_name, "parallax-map-transparent-add-color")) - { - type = video::EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR; - } - else if (!strcmp (type_name, "parallax-map-transparent-vertex-alpha")) - { - type = video::EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA; - } - else if (!strcmp (type_name, "onetexture-blend")) - { - type = video::EMT_ONETEXTURE_BLEND; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong material type: ~S", - scm_list_1 (material_type), scm_list_1 (material_type)); - } - - free (type_name); - return type; -} diff --git a/src/material-types.h b/src/material-types.h deleted file mode 100644 index 2886e42..0000000 --- a/src/material-types.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_MATERIAL_TYPES_H_INCLUDED__ -#define __GUILE_IRRLICHT_MATERIAL_TYPES_H_INCLUDED__ - -#include -#include - -irr::video::E_MATERIAL_TYPE -scm_to_material_type (SCM material_type); - -#endif diff --git a/src/material.cpp b/src/material.cpp deleted file mode 100644 index 087952a..0000000 --- a/src/material.cpp +++ /dev/null @@ -1,383 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include - -#include "color.h" -#include "gsubr.h" -#include "material.h" -#include "material-types.h" -#include "wrapped.h" - -using namespace irr; - -SCM -SMaterial_make (SCM rest) -{ - SCM material_type; - SCM ambient_color; - SCM diffuse_color; - SCM emissive_color; - SCM specular_color; - SCM shininess; - SCM material_type_param; - SCM material_type_param_2; - SCM thickness; - SCM z_buffer; - SCM anti_aliasing; - SCM color_mask; - SCM color_material; - SCM blend_operation; - SCM polygon_offset_factor; - SCM polygon_offset_direction; - SCM wireframe; - SCM point_cloud; - SCM gouraud_shading; - SCM lighting; - SCM z_write_enable; - SCM backface_culling; - SCM frontface_culling; - SCM fog_enable; - SCM normalize_normals; - SCM use_mip_maps; - - scm_c_bind_keyword_arguments - ("video_SMaterial_make", rest, (scm_t_keyword_arguments_flags)0, - scm_from_utf8_keyword ("material-type"), &material_type, - scm_from_utf8_keyword ("ambient-color"), &ambient_color, - scm_from_utf8_keyword ("diffuse-color"), &diffuse_color, - scm_from_utf8_keyword ("emissive-color"), &emissive_color, - scm_from_utf8_keyword ("specular-color"), &specular_color, - scm_from_utf8_keyword ("shininess"), &shininess, - scm_from_utf8_keyword ("material-type-param"), &material_type_param, - scm_from_utf8_keyword ("material-type-param-2"), &material_type_param_2, - scm_from_utf8_keyword ("thickness"), &thickness, - scm_from_utf8_keyword ("z-buffer"), &z_buffer, - scm_from_utf8_keyword ("anti-aliasing"), &anti_aliasing, - scm_from_utf8_keyword ("color-mask"), &color_mask, - scm_from_utf8_keyword ("color-material"), &color_material, - scm_from_utf8_keyword ("blend-operation"), &blend_operation, - scm_from_utf8_keyword ("polygon-offset-factor"), &polygon_offset_factor, - scm_from_utf8_keyword ("polygon-offset-direction"), &polygon_offset_direction, - scm_from_utf8_keyword ("wireframe"), &wireframe, - scm_from_utf8_keyword ("point-cloud"), &point_cloud, - scm_from_utf8_keyword ("gouraud-shading"), &gouraud_shading, - scm_from_utf8_keyword ("lighting"), &lighting, - scm_from_utf8_keyword ("z-write-enable"), &z_write_enable, - scm_from_utf8_keyword ("backface-culling"), &backface_culling, - scm_from_utf8_keyword ("frontface-culling"), &frontface_culling, - scm_from_utf8_keyword ("fog-enable"), &fog_enable, - scm_from_utf8_keyword ("normalize-normals"), &normalize_normals, - scm_from_utf8_keyword ("use-mip-maps"), &use_mip_maps, - SCM_UNDEFINED); - - video::SMaterial* material = new video::SMaterial (); - material->MaterialType = scm_to_material_type(material_type); - material->AmbientColor = scm_to_color (ambient_color); - material->DiffuseColor = scm_to_color (diffuse_color); - material->EmissiveColor = scm_to_color (emissive_color); - material->SpecularColor = scm_to_color (specular_color); - material->Shininess = scm_to_double (shininess); - material->MaterialTypeParam = scm_to_double (material_type_param); - material->MaterialTypeParam2 = scm_to_double (material_type_param_2); - material->Thickness = scm_to_double (thickness); - material->ZBuffer = scm_to_comparison_func (z_buffer); - material->AntiAliasing = scm_to_anti_aliasing_mode (anti_aliasing); - material->ColorMask = scm_to_color_plane (color_mask); - material->ColorMaterial = scm_to_color_material (color_material); - material->BlendOperation = scm_to_blend_operation (blend_operation); - material->PolygonOffsetFactor = scm_to_uint8 (polygon_offset_factor); - material->PolygonOffsetDirection = scm_to_polygon_offset (polygon_offset_direction); - material->Wireframe = scm_to_bool (wireframe); - material->PointCloud = scm_to_bool (point_cloud); - material->GouraudShading = scm_to_bool (gouraud_shading); - material->Lighting = scm_to_bool (lighting); - material->ZWriteEnable = scm_to_bool (z_write_enable); - material->BackfaceCulling = scm_to_bool (backface_culling); - material->FrontfaceCulling = scm_to_bool (frontface_culling); - material->FogEnable = scm_to_bool (fog_enable); - material->NormalizeNormals = scm_to_bool (normalize_normals); - material->UseMipMaps = scm_to_bool (use_mip_maps); - return scm_from_irr_pointer ("", (void*) material); -} - -void -init_material (void) -{ - DEFINE_GSUBR ("SMaterial_make", 0, 0, 1, SMaterial_make); -} - -video::E_ANTI_ALIASING_MODE -scm_to_anti_aliasing_mode (SCM anti_aliasing_mode) -{ - char* mode_name = scm_to_utf8_string (scm_symbol_to_string (anti_aliasing_mode)); - video::E_ANTI_ALIASING_MODE mode; - - if (!strcmp (mode_name, "off")) - { - mode = video::EAAM_OFF; - } - else if (!strcmp (mode_name, "simple")) - { - mode = video::EAAM_SIMPLE; - } - else if (!strcmp (mode_name, "quality")) - { - mode = video::EAAM_QUALITY; - } - else if (!strcmp (mode_name, "line-smooth")) - { - mode = video::EAAM_LINE_SMOOTH; - } - else if (!strcmp (mode_name, "point-smooth")) - { - mode = video::EAAM_POINT_SMOOTH; - } - else if (!strcmp (mode_name, "full-basic")) - { - mode = video::EAAM_FULL_BASIC; - } - else if (!strcmp (mode_name, "alpha-to-coverage")) - { - mode = video::EAAM_ALPHA_TO_COVERAGE; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong anti aliasing mode: ~S", - scm_list_1 (anti_aliasing_mode), scm_list_1 (anti_aliasing_mode)); - } - - free (mode_name); - return mode; -} - -video::E_BLEND_OPERATION -scm_to_blend_operation (SCM blend_operation) -{ - char* operation_name = scm_to_utf8_string (scm_symbol_to_string (blend_operation)); - video::E_BLEND_OPERATION operation; - - if (!strcmp (operation_name, "none")) - { - operation = video::EBO_NONE; - } - else if (!strcmp (operation_name, "add")) - { - operation = video::EBO_ADD; - } - else if (!strcmp (operation_name, "subtract")) - { - operation = video::EBO_SUBTRACT; - } - else if (!strcmp (operation_name, "rev-subtract")) - { - operation = video::EBO_REVSUBTRACT; - } - else if (!strcmp (operation_name, "min")) - { - operation = video::EBO_MIN; - } - else if (!strcmp (operation_name, "max")) - { - operation = video::EBO_MAX; - } - else if (!strcmp (operation_name, "min-factor")) - { - operation = video::EBO_MIN_FACTOR; - } - else if (!strcmp (operation_name, "max-factor")) - { - operation = video::EBO_MAX_FACTOR; - } - else if (!strcmp (operation_name, "min-alpha")) - { - operation = video::EBO_MIN_ALPHA; - } - else if (!strcmp (operation_name, "max-alpha")) - { - operation = video::EBO_MAX_ALPHA; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong blend operation: ~S", - scm_list_1 (blend_operation), scm_list_1 (blend_operation)); - } - - free (operation_name); - return operation; -} - -video::E_COLOR_MATERIAL -scm_to_color_material (SCM color_material) -{ - char* material_name = scm_to_utf8_string (scm_symbol_to_string (color_material)); - video::E_COLOR_MATERIAL material; - - if (!strcmp (material_name, "none")) - { - material = video::ECM_NONE; - } - else if (!strcmp (material_name, "diffuse")) - { - material = video::ECM_DIFFUSE; - } - else if (!strcmp (material_name, "ambient")) - { - material = video::ECM_AMBIENT; - } - else if (!strcmp (material_name, "emissive")) - { - material = video::ECM_EMISSIVE; - } - else if (!strcmp (material_name, "specular")) - { - material = video::ECM_SPECULAR; - } - else if (!strcmp (material_name, "diffuse-and-ambient")) - { - material = video::ECM_DIFFUSE_AND_AMBIENT; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong color material: ~S", - scm_list_1 (color_material), scm_list_1 (color_material)); - } - - free (material_name); - return material; -} - -video::E_COLOR_PLANE -scm_to_color_plane (SCM color_plane) -{ - char* plane_name = scm_to_utf8_string (scm_symbol_to_string (color_plane)); - video::E_COLOR_PLANE plane; - - if (!strcmp (plane_name, "none")) - { - plane = video::ECP_NONE; - } - else if (!strcmp (plane_name, "alpha")) - { - plane = video::ECP_ALPHA; - } - else if (!strcmp (plane_name, "red")) - { - plane = video::ECP_RED; - } - else if (!strcmp (plane_name, "green")) - { - plane = video::ECP_GREEN; - } - else if (!strcmp (plane_name, "blue")) - { - plane = video::ECP_BLUE; - } - else if (!strcmp (plane_name, "rgb")) - { - plane = video::ECP_RGB; - } - else if (!strcmp (plane_name, "all")) - { - plane = video::ECP_ALL; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong color plane: ~S", - scm_list_1 (color_plane), scm_list_1 (color_plane)); - } - - free (plane_name); - return plane; -} - -video::E_COMPARISON_FUNC -scm_to_comparison_func (SCM comparison_func) -{ - char* func_name = scm_to_utf8_string (scm_symbol_to_string (comparison_func)); - video::E_COMPARISON_FUNC func; - - if (!strcmp (func_name, "never")) - { - func = video::ECFN_NEVER; - } - else if (!strcmp (func_name, "less-equal")) - { - func = video::ECFN_LESSEQUAL; - } - else if (!strcmp (func_name, "equal")) - { - func = video::ECFN_EQUAL; - } - else if (!strcmp (func_name, "less")) - { - func = video::ECFN_LESS; - } - else if (!strcmp (func_name, "not-equal")) - { - func = video::ECFN_NOTEQUAL; - } - else if (!strcmp (func_name, "greater-equal")) - { - func = video::ECFN_GREATEREQUAL; - } - else if (!strcmp (func_name, "greater")) - { - func = video::ECFN_GREATER; - } - else if (!strcmp (func_name, "always")) - { - func = video::ECFN_ALWAYS; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong comparison func: ~S", - scm_list_1 (comparison_func), scm_list_1 (comparison_func)); - } - - free (func_name); - return func; -} - -video::E_POLYGON_OFFSET -scm_to_polygon_offset (SCM polygon_offset) -{ - char* offset_name = scm_to_utf8_string (scm_symbol_to_string (polygon_offset)); - video::E_POLYGON_OFFSET offset; - - if (!strcmp (offset_name, "back")) - { - offset = video::EPO_BACK; - } - else if (!strcmp (offset_name, "front")) - { - offset = video::EPO_FRONT; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong polygon offset: ~S", - scm_list_1 (polygon_offset), scm_list_1 (polygon_offset)); - } - - free (offset_name); - return offset; -} diff --git a/src/material.h b/src/material.h deleted file mode 100644 index 15c6345..0000000 --- a/src/material.h +++ /dev/null @@ -1,49 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_MATERIAL_H_INCLUDED__ -#define __GUILE_IRRLICHT_MATERIAL_H_INCLUDED__ - -#include -#include - -void -init_material (void); - -irr::video::E_ANTI_ALIASING_MODE -scm_to_anti_aliasing_mode (SCM anti_aliasing_mode); - -irr::video::E_BLEND_OPERATION -scm_to_blend_operation (SCM blend_operation); - -irr::video::E_COLOR_MATERIAL -scm_to_color_material (SCM color_material); - -irr::video::E_COLOR_PLANE -scm_to_color_plane (SCM color_plane); - -irr::video::E_COMPARISON_FUNC -scm_to_comparison_func (SCM comparison_func); - -irr::video::E_POLYGON_OFFSET -scm_to_polygon_offset (SCM polygon_offset); - -#endif diff --git a/src/matrix4.cpp b/src/matrix4.cpp deleted file mode 100644 index 4506166..0000000 --- a/src/matrix4.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "matrix4.h" - -using namespace irr; - -SCM -scm_from_matrix4 (core::matrix4 cmatrix) -{ - return scm_list_4 (scm_list_4 (scm_from_double (cmatrix[0]), - scm_from_double (cmatrix[1]), - scm_from_double (cmatrix[2]), - scm_from_double (cmatrix[3])), - scm_list_4 (scm_from_double (cmatrix[4]), - scm_from_double (cmatrix[5]), - scm_from_double (cmatrix[6]), - scm_from_double (cmatrix[7])), - scm_list_4 (scm_from_double (cmatrix[8]), - scm_from_double (cmatrix[9]), - scm_from_double (cmatrix[10]), - scm_from_double (cmatrix[11])), - scm_list_4 (scm_from_double (cmatrix[12]), - scm_from_double (cmatrix[13]), - scm_from_double (cmatrix[14]), - scm_from_double (cmatrix[15]))); -} - -core::matrix4 -scm_to_matrix4 (SCM matrix) -{ - core::matrix4 cmatrix; - - cmatrix[0] = scm_to_double (scm_car (scm_car (matrix))); - cmatrix[1] = scm_to_double (scm_cadr (scm_car (matrix))); - cmatrix[2] = scm_to_double (scm_caddr (scm_car (matrix))); - cmatrix[3] = scm_to_double (scm_cadddr (scm_car (matrix))); - - cmatrix[4] = scm_to_double (scm_car (scm_cadr (matrix))); - cmatrix[5] = scm_to_double (scm_cadr (scm_cadr (matrix))); - cmatrix[6] = scm_to_double (scm_caddr (scm_cadr (matrix))); - cmatrix[7] = scm_to_double (scm_cadddr (scm_cadr (matrix))); - - cmatrix[8] = scm_to_double (scm_car (scm_caddr (matrix))); - cmatrix[9] = scm_to_double (scm_cadr (scm_caddr (matrix))); - cmatrix[10] = scm_to_double (scm_caddr (scm_caddr (matrix))); - cmatrix[11] = scm_to_double (scm_cadddr (scm_caddr (matrix))); - - cmatrix[12] = scm_to_double (scm_car (scm_cadddr (matrix))); - cmatrix[13] = scm_to_double (scm_cadr (scm_cadddr (matrix))); - cmatrix[14] = scm_to_double (scm_caddr (scm_cadddr (matrix))); - cmatrix[15] = scm_to_double (scm_cadddr (scm_cadddr (matrix))); - - return cmatrix; -} diff --git a/src/matrix4.h b/src/matrix4.h deleted file mode 100644 index dd3b030..0000000 --- a/src/matrix4.h +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_MATRIX4_H_INCLUDED__ -#define __GUILE_IRRLICHT_MATRIX4_H_INCLUDED__ - -#include -#include - -SCM -scm_from_matrix4 (irr::core::matrix4 cmatrix); - -irr::core::matrix4 -scm_to_matrix4 (SCM matrix); - -#endif diff --git a/src/position2d.cpp b/src/position2d.cpp deleted file mode 100644 index 4d063d4..0000000 --- a/src/position2d.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "position2d.h" - -using namespace irr; - -SCM -scm_from_position2d_s32 (core::position2d position2d) -{ - return scm_list_2 (scm_from_int32 (position2d.X), - scm_from_int32 (position2d.Y)); -} - -core::position2d -scm_to_position2d_f32 (SCM position2d) -{ - return core::position2d - (scm_to_double (scm_car (position2d)), - scm_to_double (scm_cadr (position2d))); -} - -core::position2d -scm_to_position2d_s32 (SCM position2d) -{ - return core::position2d - (scm_to_int32 (scm_car (position2d)), - scm_to_int32 (scm_cadr (position2d))); -} diff --git a/src/position2d.h b/src/position2d.h deleted file mode 100644 index ed83cff..0000000 --- a/src/position2d.h +++ /dev/null @@ -1,39 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_POSITION_2D_H_INCLUDED__ -#define __GUILE_IRRLICHT_POSITION_2D_H_INCLUDED__ - -#include -#include - -using namespace irr; - -SCM -scm_from_position2d_s32 (core::position2d position2d); - -core::position2d -scm_to_position2d_f32 (SCM position2d); - -core::position2d -scm_to_position2d_s32 (SCM position2d); - -#endif diff --git a/src/primitive-types.cpp b/src/primitive-types.cpp deleted file mode 100644 index eb1d8a5..0000000 --- a/src/primitive-types.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "primitive-types.h" - -using namespace irr; - -scene::E_PRIMITIVE_TYPE -scm_to_primitive_type (SCM primitive_type) -{ - char* type_name = scm_to_utf8_string (scm_symbol_to_string (primitive_type)); - scene::E_PRIMITIVE_TYPE type; - - if (!strcmp (type_name, "points")) - { - type = scene::EPT_POINTS; - } - else if (!strcmp (type_name, "line-strip")) - { - type = scene::EPT_LINE_STRIP; - } - else if (!strcmp (type_name, "line-loop")) - { - type = scene::EPT_LINE_LOOP; - } - else if (!strcmp (type_name, "lines")) - { - type = scene::EPT_LINES; - } - else if (!strcmp (type_name, "triangle-strip")) - { - type = scene::EPT_TRIANGLE_STRIP; - } - else if (!strcmp (type_name, "triangle-fan")) - { - type = scene::EPT_TRIANGLE_FAN; - } - else if (!strcmp (type_name, "triangles")) - { - type = scene::EPT_TRIANGLES; - } - else if (!strcmp (type_name, "quad-strip")) - { - type = scene::EPT_QUAD_STRIP; - } - else if (!strcmp (type_name, "quads")) - { - type = scene::EPT_QUADS; - } - else if (!strcmp (type_name, "polygon")) - { - type = scene::EPT_POLYGON; - } - else if (!strcmp (type_name, "point-sprites")) - { - type = scene::EPT_POINT_SPRITES; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong primitive type: ~S", - scm_list_1 (primitive_type), scm_list_1 (primitive_type)); - } - - free (type_name); - return type; -} diff --git a/src/primitive-types.h b/src/primitive-types.h deleted file mode 100644 index 09ca8df..0000000 --- a/src/primitive-types.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_PRIMITIVE_TYPES_H_INCLUDED__ -#define __GUILE_IRRLICHT_PRIMITIVE_TYPES_H_INCLUDED__ - -#include -#include - -irr::scene::E_PRIMITIVE_TYPE -scm_to_primitive_type (SCM primitive_type); - -#endif diff --git a/src/rect.cpp b/src/rect.cpp deleted file mode 100644 index ce109c6..0000000 --- a/src/rect.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "rect.h" - -using namespace irr; - -core::rect -scm_to_rect_s32 (SCM rect) -{ - return core::rect - (scm_to_int32 (scm_car (rect)), - scm_to_int32 (scm_cadr (rect)), - scm_to_int32 (scm_caddr (rect)), - scm_to_int32 (scm_cadddr (rect))); -} diff --git a/src/rect.h b/src/rect.h deleted file mode 100644 index 313965e..0000000 --- a/src/rect.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_RECT_H_INCLUDED__ -#define __GUILE_IRRLICHT_RECT_H_INCLUDED__ - -#include -#include - -irr::core::rect -scm_to_rect_s32 (SCM rect); - -#endif diff --git a/src/reference-counted.cpp b/src/reference-counted.cpp deleted file mode 100644 index 24394a4..0000000 --- a/src/reference-counted.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "reference-counted.h" -#include "wrapped.h" - -using namespace irr; - -template -SCM -IReferenceCounted_drop (SCM obj) -{ - return scm_from_bool (((T) scm_to_irr_pointer (obj))->drop ()); -} - -void -init_reference_counted (void) -{ - DEFINE_GSUBR ("IrrlichtDevice_drop", 1, 0, 0, IReferenceCounted_drop); - DEFINE_GSUBR ("ISceneNodeAnimator_drop", 1, 0, 0, - IReferenceCounted_drop); -} diff --git a/src/reference-counted.h b/src/reference-counted.h deleted file mode 100644 index 6c0a87f..0000000 --- a/src/reference-counted.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_REFERENCE_COUNTED_H_INCLUDED__ -#define __GUILE_IRRLICHT_REFERENCE_COUNTED_H_INCLUDED__ - -void -init_reference_counted (void); - -#endif diff --git a/src/scene-manager.cpp b/src/scene-manager.cpp deleted file mode 100644 index 31f4330..0000000 --- a/src/scene-manager.cpp +++ /dev/null @@ -1,367 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "scene-manager.h" -#include "vector3d.h" -#include "wrapped.h" - -using namespace irr; - -template -SCM -ISceneManager_addAnimatedMeshSceneNode (SCM scene_manager, - SCM mesh, - SCM parent, - SCM id, - SCM position, - SCM rotation, - SCM scale, - SCM also_add_if_mesh_pointer_zero) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::IAnimatedMeshSceneNode* node = - smgr->addAnimatedMeshSceneNode ((scene::IAnimatedMesh*) scm_to_irr_pointer (mesh), - (TParent) scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_vector3df (position), - scm_to_vector3df (rotation), - scm_to_vector3df (scale), - scm_to_bool (also_add_if_mesh_pointer_zero)); - return scm_from_irr_pointer ("", (void*) node); -} - -template -SCM -ISceneManager_addCameraSceneNode (SCM scene_manager, - SCM parent, - SCM position, - SCM lookat, - SCM id, - SCM make_active) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::ICameraSceneNode* camera = - smgr->addCameraSceneNode ((TParent) scm_to_irr_pointer (parent), - scm_to_vector3df (position), - scm_to_vector3df (lookat), - scm_to_int32 (id), - scm_to_bool (make_active)); - return scm_from_irr_pointer ("", (void*) camera); -} - -template -SCM -ISceneManager_addCameraSceneNodeFPS (SCM scene_manager, - SCM rest) -{ - SCM parent; - SCM rotate_speed; - SCM move_speed; - SCM id; - SCM key_map_array; - SCM key_map_size; - SCM no_vertical_movement; - SCM jump_speed; - SCM invert_mouse; - SCM make_active; - - scm_c_bind_keyword_arguments ("scene_ISceneManager_addCameraSceneNodeFPS", - rest, (scm_t_keyword_arguments_flags)0, - scm_from_utf8_keyword ("parent"), &parent, - scm_from_utf8_keyword ("rotate-speed"), &rotate_speed, - scm_from_utf8_keyword ("move-speed"), &move_speed, - scm_from_utf8_keyword ("id"), &id, - scm_from_utf8_keyword ("key-map-array"), &key_map_array, - scm_from_utf8_keyword ("key-map-size"), &key_map_size, - scm_from_utf8_keyword ("no-vertical-movement"), &no_vertical_movement, - scm_from_utf8_keyword ("jump-speed"), &jump_speed, - scm_from_utf8_keyword ("invert-mouse"), &invert_mouse, - scm_from_utf8_keyword ("make-active"), &make_active, - SCM_UNDEFINED); - - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::ICameraSceneNode* camera = - smgr->addCameraSceneNodeFPS ((TParent) scm_to_irr_pointer (parent), - scm_to_double (rotate_speed), - scm_to_double (move_speed), - scm_to_int32 (id), - (SKeyMap*) scm_to_irr_pointer (key_map_array), - scm_to_int32 (key_map_size), - scm_to_bool (no_vertical_movement), - scm_to_double (jump_speed), - scm_to_bool (invert_mouse), - scm_to_bool (make_active)); - return scm_from_irr_pointer ("", (void*) camera); -} - -template -SCM -ISceneManager_addCubeSceneNode (SCM scene_manager, - SCM size, - SCM parent, - SCM id, - SCM position, - SCM rotation, - SCM scale) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::IMeshSceneNode* node = - smgr->addCubeSceneNode (scm_to_double (size), - (TParent) scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_vector3df (position), - scm_to_vector3df (rotation), - scm_to_vector3df (scale)); - return scm_from_irr_pointer ("", (void*) node); -} - -template -SCM -ISceneManager_addCustomSceneNode (SCM scene_manager, - SCM proc_render, - SCM proc_get_bounding_box, - SCM proc_get_material_count, - SCM proc_get_material, - SCM parent, - SCM id, - SCM position, - SCM rotation, - SCM scale) -{ - class CustomSceneNode : public scene::ISceneNode - { - SCM scm_render; - SCM scm_get_bounding_box; - SCM scm_get_material_count; - SCM scm_get_material; - - public: - CustomSceneNode (scene::ISceneNode* parent, - scene::ISceneManager* smgr, - s32 id, - const core::vector3df& position, - const core::vector3df& rotation, - const core::vector3df& scale, - SCM render, - SCM get_bounding_box, - SCM get_material_count, - SCM get_material) - : scene::ISceneNode (parent, smgr, id, position, rotation, scale) - { - scm_render = render; - scm_get_bounding_box = get_bounding_box; - scm_get_material_count = get_material_count; - scm_get_material = get_material; - } - - virtual void OnRegisterSceneNode () - { - if (IsVisible) - { - SceneManager->registerNodeForRendering (this); - } - ISceneNode::OnRegisterSceneNode (); - } - - virtual void render () - { - scm_call_0 (scm_render); - } - - virtual const core::aabbox3d& getBoundingBox () const - { - SCM box = scm_call_0 (scm_get_bounding_box); - return *((core::aabbox3d*) scm_to_irr_pointer (box)); - } - - virtual u32 getMaterialCount () const - { - return scm_to_uint32 (scm_call_0 (scm_get_material_count)); - } - - virtual video::SMaterial& getMaterial (u32 i) - { - SCM material = scm_call_1 (scm_get_material, scm_from_uint32 (i)); - return *((video::SMaterial*) scm_to_irr_pointer (material)); - } - }; - - CustomSceneNode* node = - new CustomSceneNode ((TParent) scm_to_irr_pointer (parent), - (scene::ISceneManager*) scm_to_irr_pointer (scene_manager), - scm_to_int32 (id), - scm_to_vector3df (position), - scm_to_vector3df (rotation), - scm_to_vector3df (scale), - proc_render, - proc_get_bounding_box, - proc_get_material_count, - proc_get_material); - return scm_from_irr_pointer ("", (void*) node); -} - -template -SCM -ISceneManager_addOctreeSceneNode (SCM scene_manager, - SCM mesh, - SCM parent, - SCM id, - SCM minimal_polys_per_node, - SCM also_add_if_mesh_pointer_zero) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::IMeshSceneNode* node = - smgr->addOctreeSceneNode ((TMesh) scm_to_irr_pointer (mesh), - (TParent) scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_int32 (minimal_polys_per_node), - scm_to_bool (also_add_if_mesh_pointer_zero)); - return scm_from_irr_pointer ("", (void*) node); -} - -template -SCM -ISceneManager_addSphereSceneNode (SCM scene_manager, - SCM radius, - SCM poly_count, - SCM parent, - SCM id, - SCM position, - SCM rotation, - SCM scale) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::IMeshSceneNode* node = - smgr->addSphereSceneNode (scm_to_double (radius), - scm_to_int32 (poly_count), - (TParent) scm_to_irr_pointer (parent), - scm_to_int32 (id), - scm_to_vector3df (position), - scm_to_vector3df (rotation), - scm_to_vector3df (scale)); - return scm_from_irr_pointer ("", (void*) node); -} - -SCM -ISceneManager_createFlyCircleAnimator (SCM scene_manager, - SCM center, - SCM radius, - SCM speed, - SCM direction, - SCM start_position, - SCM radius_ellipsoid) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::ISceneNodeAnimator* anim = - smgr->createFlyCircleAnimator (scm_to_vector3df (center), - scm_to_double (radius), - scm_to_double (speed), - scm_to_vector3df (direction), - scm_to_double (start_position), - scm_to_double (radius_ellipsoid)); - return scm_from_irr_pointer ("", (void*) anim); -} - -SCM -ISceneManager_createFlyStraightAnimator (SCM scene_manager, - SCM start_point, - SCM end_point, - SCM time_for_way, - SCM loop, - SCM pingpong) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::ISceneNodeAnimator* anim = - smgr->createFlyStraightAnimator (scm_to_vector3df (start_point), - scm_to_vector3df (end_point), - scm_to_uint32 (time_for_way), - scm_to_bool (loop), - scm_to_bool (pingpong)); - return scm_from_irr_pointer ("", (void*) anim); -} - -SCM -ISceneManager_createRotationAnimator (SCM scene_manager, - SCM rotation_speed) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::ISceneNodeAnimator* anim = - smgr->createRotationAnimator (scm_to_vector3df (rotation_speed)); - return scm_from_irr_pointer ("", (void*) anim); -} - -SCM -ISceneManager_drawAll (SCM scene_manager) -{ - ((scene::ISceneManager*) scm_to_irr_pointer (scene_manager))->drawAll (); - return SCM_UNSPECIFIED; -} - -SCM -ISceneManager_getMesh (SCM scene_manager, - SCM filename) -{ - char* cfilename = scm_to_utf8_string (filename); - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - scene::IAnimatedMesh* mesh = smgr->getMesh(cfilename); - free (cfilename); - return scm_from_irr_pointer ("", (void*) mesh); -} - -SCM -ISceneManager_getRootSceneNode (SCM scene_manager) -{ - scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager); - return scm_from_irr_pointer ("", (void*) smgr->getRootSceneNode ()); -} - -void -init_scene_manager (void) -{ - DEFINE_GSUBR ("ISceneManager_addAnimatedMeshSceneNode_ISceneNode", 8, 0, 0, - ISceneManager_addAnimatedMeshSceneNode); - DEFINE_GSUBR ("ISceneManager_addCameraSceneNode_ISceneNode", 6, 0, 0, - ISceneManager_addCameraSceneNode); - DEFINE_GSUBR ("ISceneManager_addCameraSceneNodeFPS_ISceneNode", 1, 0, 1, - ISceneManager_addCameraSceneNodeFPS); - DEFINE_GSUBR ("ISceneManager_addCubeSceneNode_ISceneNode", 7, 0, 0, - ISceneManager_addCubeSceneNode); - DEFINE_GSUBR ("ISceneManager_addCustomSceneNode_ISceneNode", 10, 0, 0, - ISceneManager_addCustomSceneNode); - DEFINE_GSUBR ("ISceneManager_addOctreeSceneNode_ISceneNode_IAnimatedMesh", 6, 0, 0, - (ISceneManager_addOctreeSceneNode)); - DEFINE_GSUBR ("ISceneManager_addOctreeSceneNode_ISceneNode_IMesh", 6, 0, 0, - (ISceneManager_addOctreeSceneNode)); - DEFINE_GSUBR ("ISceneManager_addSphereSceneNode_ISceneNode", 8, 0, 0, - ISceneManager_addSphereSceneNode); - DEFINE_GSUBR ("ISceneManager_createFlyCircleAnimator", 7, 0, 0, - ISceneManager_createFlyCircleAnimator); - DEFINE_GSUBR ("ISceneManager_createFlyStraightAnimator", 6, 0, 0, - ISceneManager_createFlyStraightAnimator); - DEFINE_GSUBR ("ISceneManager_createRotationAnimator", 2, 0, 0, - ISceneManager_createRotationAnimator); - DEFINE_GSUBR ("ISceneManager_drawAll", 1, 0, 0, ISceneManager_drawAll); - DEFINE_GSUBR ("ISceneManager_getMesh", 2, 0, 0, ISceneManager_getMesh); - DEFINE_GSUBR ("ISceneManager_getRootSceneNode", 1, 0, 0, ISceneManager_getRootSceneNode); -} diff --git a/src/scene-manager.h b/src/scene-manager.h deleted file mode 100644 index 4643336..0000000 --- a/src/scene-manager.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_SCENE_MANAGER_H_INCLUDED__ -#define __GUILE_IRRLICHT_SCENE_MANAGER_H_INCLUDED__ - -void -init_scene_manager (void); - -#endif diff --git a/src/scene-node.cpp b/src/scene-node.cpp deleted file mode 100644 index 3700818..0000000 --- a/src/scene-node.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "material-flags.h" -#include "matrix4.h" -#include "scene-node.h" -#include "vector3d.h" -#include "wrapped.h" - -using namespace irr; - -template -SCM -ISceneNode_addAnimator (SCM scene_node, - SCM animator) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->addAnimator ((scene::ISceneNodeAnimator*) scm_to_irr_pointer (animator)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_getAbsoluteTransformation (SCM scene_node) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - return scm_from_matrix4 (node->getAbsoluteTransformation ()); -} - -template -SCM -ISceneNode_getPosition (SCM scene_node) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - return scm_from_vector3df (node->getPosition ()); -} - -template -SCM -ISceneNode_setMaterialFlag (SCM scene_node, - SCM flag, - SCM newvalue) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setMaterialFlag (scm_to_material_flag (flag), scm_to_bool (newvalue)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setMaterialTexture (SCM scene_node, - SCM texture_layer, - SCM texture) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setMaterialTexture (scm_to_uint32 (texture_layer), - (video::ITexture*) scm_to_irr_pointer (texture)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setPosition (SCM scene_node, - SCM position) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setPosition (scm_to_vector3df (position)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setRotation (SCM scene_node, - SCM rotation) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setRotation (scm_to_vector3df (rotation)); - return SCM_UNSPECIFIED; -} - -template -SCM -ISceneNode_setScale (SCM scene_node, - SCM scale) -{ - TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node); - node->setScale (scm_to_vector3df (scale)); - return SCM_UNSPECIFIED; -} - -void -init_scene_node (void) -{ - DEFINE_GSUBR ("IAnimatedMeshSceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - DEFINE_GSUBR ("IMeshSceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - DEFINE_GSUBR ("ISceneNode_addAnimator", 2, 0, 0, - ISceneNode_addAnimator); - - DEFINE_GSUBR ("ISceneNode_getAbsoluteTransformation", 1, 0, 0, - ISceneNode_getAbsoluteTransformation); - - DEFINE_GSUBR ("IMeshSceneNode_getPosition", 1, 0, 0, - ISceneNode_getPosition); - DEFINE_GSUBR ("ISceneNode_getPosition", 1, 0, 0, - ISceneNode_getPosition); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - DEFINE_GSUBR ("IMeshSceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - DEFINE_GSUBR ("ISceneNode_setMaterialFlag", 3, 0, 0, - ISceneNode_setMaterialFlag); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - DEFINE_GSUBR ("IMeshSceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - DEFINE_GSUBR ("ISceneNode_setMaterialTexture", 3, 0, 0, - ISceneNode_setMaterialTexture); - - DEFINE_GSUBR ("IMeshSceneNode_setPosition", 2, 0, 0, - ISceneNode_setPosition); - DEFINE_GSUBR ("ISceneNode_setPosition", 2, 0, 0, - ISceneNode_setPosition); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - DEFINE_GSUBR ("ICameraSceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - DEFINE_GSUBR ("ISceneNode_setRotation", 2, 0, 0, - ISceneNode_setRotation); - - DEFINE_GSUBR ("IAnimatedMeshSceneNode_setScale", 2, 0, 0, - ISceneNode_setScale); - DEFINE_GSUBR ("ISceneNode_setScale", 2, 0, 0, - ISceneNode_setScale); -} diff --git a/src/scene-node.h b/src/scene-node.h deleted file mode 100644 index e333075..0000000 --- a/src/scene-node.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_SCENE_NODE_H_INCLUDED__ -#define __GUILE_IRRLICHT_SCENE_NODE_H_INCLUDED__ - -void -init_scene_node (void); - -#endif diff --git a/src/timer.cpp b/src/timer.cpp deleted file mode 100644 index e557217..0000000 --- a/src/timer.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "gsubr.h" -#include "timer.h" -#include "wrapped.h" - -using namespace irr; - -SCM -ITimer_getTime (SCM timer) -{ - return scm_from_uint32 (((ITimer*) scm_to_irr_pointer (timer))->getTime()); -} - -void -init_timer (void) -{ - DEFINE_GSUBR ("ITimer_getTime", 1, 0, 0, ITimer_getTime); -} diff --git a/src/timer.h b/src/timer.h deleted file mode 100644 index 501bf13..0000000 --- a/src/timer.h +++ /dev/null @@ -1,28 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_TIMER_H_INCLUDED__ -#define __GUILE_IRRLICHT_TIMER_H_INCLUDED__ - -void -init_timer (void); - -#endif diff --git a/src/vector2d.cpp b/src/vector2d.cpp deleted file mode 100644 index 52e8dcc..0000000 --- a/src/vector2d.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "vector2d.h" - -using namespace irr; - -core::vector2df -scm_to_vector2df (SCM vector2d) -{ - return core::vector2df - (scm_to_double (scm_car (vector2d)), - scm_to_double (scm_cadr (vector2d))); -} diff --git a/src/vector2d.h b/src/vector2d.h deleted file mode 100644 index 83d6f8b..0000000 --- a/src/vector2d.h +++ /dev/null @@ -1,31 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_VECTOR_2D_H_INCLUDED__ -#define __GUILE_IRRLICHT_VECTOR_2D_H_INCLUDED__ - -#include -#include - -irr::core::vector2df -scm_to_vector2df (SCM vector2d); - -#endif diff --git a/src/vector3d.cpp b/src/vector3d.cpp deleted file mode 100644 index 566a441..0000000 --- a/src/vector3d.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "vector3d.h" - -using namespace irr; - -SCM -scm_from_vector3df (core::vector3df vector3d) -{ - return scm_list_3 (scm_from_double (vector3d.X), - scm_from_double (vector3d.Y), - scm_from_double (vector3d.Z)); -} - -core::vector3df -scm_to_vector3df (SCM vector3d) -{ - return core::vector3df - (scm_to_double (scm_car (vector3d)), - scm_to_double (scm_cadr (vector3d)), - scm_to_double (scm_caddr (vector3d))); -} diff --git a/src/vector3d.h b/src/vector3d.h deleted file mode 100644 index c253ebb..0000000 --- a/src/vector3d.h +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_VECTOR_3D_H_INCLUDED__ -#define __GUILE_IRRLICHT_VECTOR_3D_H_INCLUDED__ - -#include -#include - -SCM -scm_from_vector3df (irr::core::vector3df vector3d); - -irr::core::vector3df -scm_to_vector3df (SCM vector3d); - -#endif diff --git a/src/vertex3d.cpp b/src/vertex3d.cpp deleted file mode 100644 index e0ca2d2..0000000 --- a/src/vertex3d.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "color.h" -#include "gsubr.h" -#include "vector2d.h" -#include "vector3d.h" -#include "vertex3d.h" -#include "wrapped.h" - -using namespace irr; - -SCM -S3DVertex_make (SCM position, - SCM normal, - SCM color, - SCM tcoords) -{ - video::S3DVertex* vertex = - new video::S3DVertex (scm_to_vector3df (position), - scm_to_vector3df (normal), - scm_to_color (color), - scm_to_vector2df (tcoords)); - return scm_from_irr_pointer ("", (void*) vertex); -} - -SCM -S3DVertex_Pos (SCM vertex) { - video::S3DVertex* s3dvertex = (video::S3DVertex*) scm_to_irr_pointer (vertex); - return scm_from_vector3df (s3dvertex->Pos); -} - -void -init_vertex3d (void) -{ - DEFINE_GSUBR ("S3DVertex_make", 4, 0, 0, S3DVertex_make); - DEFINE_GSUBR ("S3DVertex_Pos", 1, 0, 0, S3DVertex_Pos); -} - -video::E_VERTEX_TYPE -scm_to_vertex_type (SCM vertex_type) -{ - char* type_name = scm_to_utf8_string (scm_symbol_to_string (vertex_type)); - video::E_VERTEX_TYPE type; - - if (!strcmp (type_name, "standard")) - { - type = video::EVT_STANDARD; - } - else if (!strcmp (type_name, "2tcoords")) - { - type = video::EVT_2TCOORDS; - } - else if (!strcmp (type_name, "tangents")) - { - type = video::EVT_TANGENTS; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong vertex_type: ~S", - scm_list_1 (vertex_type), scm_list_1 (vertex_type)); - } - - free (type_name); - return type; -} diff --git a/src/vertex3d.h b/src/vertex3d.h deleted file mode 100644 index adca1ea..0000000 --- a/src/vertex3d.h +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_VERTEX_3D_H_INCLUDED__ -#define __GUILE_IRRLICHT_VERTEX_3D_H_INCLUDED__ - -#include -#include - -void -init_vertex3d (void); - -irr::video::E_VERTEX_TYPE -scm_to_vertex_type (SCM vertex_type); - -#endif diff --git a/src/video-driver.cpp b/src/video-driver.cpp deleted file mode 100644 index 60fc867..0000000 --- a/src/video-driver.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "color.h" -#include "gsubr.h" -#include "matrix4.h" -#include "primitive-types.h" -#include "rect.h" -#include "vertex3d.h" -#include "video-driver.h" -#include "wrapped.h" - -using namespace irr; - -SCM -IVideoDriver_beginScene (SCM video_driver, - SCM back_buffer, - SCM z_buffer, - SCM color, - SCM video_data, - SCM source_rect) -{ - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - - // Source rect - core::rect* sourceRectAddress = 0; - if (!scm_is_false (source_rect)) - { - core::rect sourceRect = scm_to_rect_s32 (source_rect); - sourceRectAddress = &sourceRect; - } - - return scm_from_bool (driver->beginScene (scm_to_bool (back_buffer), - scm_to_bool (z_buffer), - scm_to_color (color), - video::SExposedVideoData (), - sourceRectAddress)); -} - -SCM -IVideoDriver_drawVertexPrimitiveList (SCM video_driver, - SCM vertices, - SCM indices, - SCM v_type, - SCM p_type) -{ - // Build vertex array - u32 vertex_count = scm_to_uint32 (scm_length (vertices)); - video::S3DVertex s3d_vertices [vertex_count]; - for (int i = 0; i < vertex_count; i++) - { - video::S3DVertex* vertex = - (video::S3DVertex*) scm_to_irr_pointer (scm_list_ref (vertices, scm_from_int (i))); - s3d_vertices[i] = video::S3DVertex (vertex->Pos, - vertex->Normal, - vertex->Color, - vertex->TCoords); - } - - // Build index array - u32 index_count = scm_to_uint32 (scm_length (indices)); - SCM flat_indices = scm_apply_0 (scm_eval_string (scm_from_utf8_string ("append")), - indices); - int flat_length = scm_to_int (scm_length (flat_indices)); - u32 c_indices [flat_length]; - for (int i = 0; i < flat_length; i++) - { - c_indices[i] = scm_to_uint32 (scm_list_ref (flat_indices, scm_from_int (i))); - } - - // Draw vertices - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - driver->drawVertexPrimitiveList (&s3d_vertices[0], - vertex_count, - &c_indices[0], - index_count, - scm_to_vertex_type (v_type), - scm_to_primitive_type (p_type), - video::EIT_32BIT); - return SCM_UNSPECIFIED; -} - -SCM -IVideoDriver_endScene (SCM video_driver) -{ - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - return scm_from_bool (driver->endScene ()); -} - -SCM -IVideoDriver_getFPS (SCM video_driver) -{ - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - return scm_from_int32 (driver->getFPS ()); -} - -SCM -IVideoDriver_getName (SCM video_driver) -{ - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - return scm_from_utf32_string ((scm_t_wchar*) driver->getName ()); -} - -SCM -IVideoDriver_getTexture (SCM video_driver, - SCM filename) -{ - char* cfilename = scm_to_utf8_string (filename); - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - video::ITexture* texture = driver->getTexture (cfilename); - free (cfilename); - return scm_from_irr_pointer ("", (void*) texture); -} - -SCM -IVideoDriver_setMaterial (SCM video_driver, - SCM material) -{ - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - driver->setMaterial (*((video::SMaterial*) scm_to_irr_pointer (material))); - return SCM_UNSPECIFIED; -} - -SCM -IVideoDriver_setTransform (SCM video_driver, - SCM state, - SCM mat) -{ - video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver); - driver->setTransform (scm_to_transformation_state (state), - scm_to_matrix4 (mat)); - return SCM_UNSPECIFIED; -} - - -void -init_video_driver (void) -{ - DEFINE_GSUBR ("IVideoDriver_beginScene", 6, 0, 0, IVideoDriver_beginScene); - DEFINE_GSUBR ("IVideoDriver_drawVertexPrimitiveList", 5, 0, 1, - IVideoDriver_drawVertexPrimitiveList); - DEFINE_GSUBR ("IVideoDriver_endScene", 1, 0, 0, IVideoDriver_endScene); - DEFINE_GSUBR ("IVideoDriver_getFPS", 1, 0, 0, IVideoDriver_getFPS); - DEFINE_GSUBR ("IVideoDriver_getName", 1, 0, 0, IVideoDriver_getName); - DEFINE_GSUBR ("IVideoDriver_getTexture", 2, 0, 0, IVideoDriver_getTexture); - DEFINE_GSUBR ("IVideoDriver_setMaterial", 2, 0, 0, IVideoDriver_setMaterial); - DEFINE_GSUBR ("IVideoDriver_setTransform", 3, 0, 0, IVideoDriver_setTransform); -} - -video::E_TRANSFORMATION_STATE -scm_to_transformation_state (SCM transformation_state) -{ - char* state_name = scm_to_utf8_string (scm_symbol_to_string (transformation_state)); - video::E_TRANSFORMATION_STATE state; - - if (!strcmp (state_name, "view")) - { - state = video::ETS_VIEW; - } - else if (!strcmp (state_name, "world")) - { - state = video::ETS_WORLD; - } - else if (!strcmp (state_name, "projection")) - { - state = video::ETS_PROJECTION; - } - else if (!strcmp (state_name, "texture0")) - { - state = video::ETS_TEXTURE_0; - } - else if (!strcmp (state_name, "texture1")) - { - state = video::ETS_TEXTURE_1; - } - else if (!strcmp (state_name, "texture2")) - { - state = video::ETS_TEXTURE_2; - } - else if (!strcmp (state_name, "texture3")) - { - state = video::ETS_TEXTURE_3; - } - else - { - scm_error (scm_arg_type_key, NULL, "Wrong transformation state: ~S", - scm_list_1 (transformation_state), scm_list_1 (transformation_state)); - } - - free (state_name); - return state; -} diff --git a/src/video-driver.h b/src/video-driver.h deleted file mode 100644 index 05dcf13..0000000 --- a/src/video-driver.h +++ /dev/null @@ -1,34 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_VIDEO_DRIVER_H_INCLUDED__ -#define __GUILE_IRRLICHT_VIDEO_DRIVER_H_INCLUDED__ - -#include -#include - -void -init_video_driver (void); - -irr::video::E_TRANSFORMATION_STATE -scm_to_transformation_state (SCM transformation_state); - -#endif diff --git a/src/wrapped.cpp b/src/wrapped.cpp deleted file mode 100644 index d569440..0000000 --- a/src/wrapped.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#include -#include -#include "wrapped.h" - -using namespace irr; - -/* Make a GOOPS instance from a C++ object pointer */ -SCM -scm_from_irr_pointer (const char* class_name, void* pointer) -{ - SCM scm_class = scm_variable_ref (scm_c_public_lookup ("irrlicht", class_name)); - SCM k_pointer = scm_from_utf8_keyword ("irr-pointer"); - SCM scm_pointer = scm_from_pointer (pointer, NULL); - return scm_make (scm_list_3 (scm_class, k_pointer, scm_pointer)); -} - -/* Extract C++ irrlicht object pointer from Guile object */ -void* -scm_to_irr_pointer (SCM obj) -{ - SCM slot = scm_slot_ref (obj, scm_from_utf8_symbol ("irr-pointer")); - return scm_to_pointer (slot); -} diff --git a/src/wrapped.h b/src/wrapped.h deleted file mode 100644 index 2518025..0000000 --- a/src/wrapped.h +++ /dev/null @@ -1,36 +0,0 @@ -/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine - - Copyright (C) 2020 Javier Sancho - - 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 - . -*/ - -#ifndef __GUILE_IRRLICHT_WRAPPED_H_INCLUDED__ -#define __GUILE_IRRLICHT_WRAPPED_H_INCLUDED__ - -#include -#include - -using namespace irr; - -SCM -scm_from_irr_pointer (const char* class_name, void* pointer); - -void* -scm_to_irr_pointer (SCM obj); - -#endif -- 2.39.5