src/scene-manager.cpp \
src/scene-node.cpp \
src/texture.cpp \
+ src/vector2d.cpp \
src/vector3d.cpp \
+ src/vertex3d.cpp \
src/video-driver.cpp \
src/wchar.cpp
libguile_irrlicht_la_CPPFLAGS = @GUILE_CFLAGS@
;; create our custom scene node
(define box (make-aabbox3df))
(define vertices
- (list (make-s3dvertex '(0 0 10) '(1 1 0) '(255 0 255 255) '(0 1))
- (make-s3dvertex '(10 0 -10) '(1 0 0) '(255 255 0 255) '(1 1))
- (make-s3dvertex '(0 20 0) '(0 1 1) '(255 255 255 0) '(1 0))
- (make-s3dvertex '(-10 0 -10) '(0 0 1) '(255 0 255 0) '(0 0))))
+ (list (make-vertex3d '(0 0 10) '(1 1 0) '(255 0 255 255) '(0 1))
+ (make-vertex3d '(10 0 -10) '(1 0 0) '(255 255 0 255) '(1 1))
+ (make-vertex3d '(0 20 0) '(0 1 1) '(255 255 255 0) '(1 0))
+ (make-vertex3d '(-10 0 -10) '(0 0 1) '(255 0 255 0) '(0 0))))
(define material (make-material #:wireframe #f #:lighting #f))
(aabbox3d-reset! box (vertex-position (car vertices)))
#include "scene-manager.h"
#include "scene-node.h"
#include "texture.h"
+#include "vertex3d.h"
#include "video-driver.h"
extern "C" {
void
init_guile_irrlicht (void)
{
+ init_vertex3d ();
init_aabbox3d ();
init_animated_mesh ();
init_animated_mesh_scene_node ();
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "vector2d.h"
+
+extern "C" {
+
+ irr::core::vector2df
+ scm_to_vector2df (SCM vector2d)
+ {
+ return irr::core::vector2df
+ (scm_to_double (scm_car (vector2d)),
+ scm_to_double (scm_cadr (vector2d)));
+ }
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __GUILE_IRRLICHT_VECTOR_2D_H_INCLUDED__
+#define __GUILE_IRRLICHT_VECTOR_2D_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+
+extern "C" {
+
+ irr::core::vector2df
+ scm_to_vector2df (SCM vector2d);
+
+}
+
+#endif
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "color.h"
+#include "vector2d.h"
+#include "vector3d.h"
+#include "vertex3d.h"
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_vertex3d (void)
+ {
+ init_vertex3d_type ();
+ scm_c_define_gsubr ("make-vertex3d", 4, 0, 0, (scm_t_subr)make_vertex3d);
+ scm_c_export ("make-vertex3d", NULL);
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::video::S3DVertex*, "vertex3d",
+ init_vertex3d_type, vertex3d_p,
+ wrap_vertex3d, unwrap_vertex3d);
+
+ SCM
+ make_vertex3d (SCM position,
+ SCM normal,
+ SCM color,
+ SCM tcoords)
+ {
+ irr::video::S3DVertex* vertex =
+ new irr::video::S3DVertex (scm_to_vector3df (position),
+ scm_to_vector3df (normal),
+ scm_to_color (color),
+ scm_to_vector2df (tcoords));
+ return wrap_vertex3d (vertex);
+ }
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __GUILE_IRRLICHT_VERTEX_3D_H_INCLUDED__
+#define __GUILE_IRRLICHT_VERTEX_3D_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_vertex3d (void);
+
+ DECLARE_WRAPPED_TYPE (irr::video::S3DVertex*, init_vertex3d_type,
+ vertex3d_p, wrap_vertex3d, unwrap_vertex3d);
+
+ SCM
+ make_vertex3d (SCM position,
+ SCM normal,
+ SCM color,
+ SCM tcoords);
+
+}
+
+#endif