src/animated-mesh-md2.cpp \
src/animated-mesh-scene-node.cpp \
src/camera-scene-node.cpp \
+ src/color.cpp \
src/device.cpp \
src/dimension2d.cpp \
src/driver-types.cpp \
(define-module (irrlicht video)
- #:export (get-texture))
+ #:export (begin-scene
+ get-texture))
(load-extension "libguile-irrlicht" "init_guile_irrlicht")
+
+(define irr-begin-scene begin-scene)
+(define* (begin-scene video-driver
+ #:key
+ (back-buffer #t)
+ (z-buffer #t)
+ (color '(255 0 0 0))
+ (video-data #f)
+ (source-rect #f))
+ (irr-begin-scene video-driver
+ back-buffer
+ z-buffer
+ color
+ video-data
+ source-rect))
--- /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 "rect.h"
+
+extern "C" {
+
+ irr::video::SColor
+ scm_to_color (SCM color)
+ {
+ return irr::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)));
+ }
+
+}
--- /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_COLOR_H_INCLUDED__
+#define __GUILE_IRRLICHT_COLOR_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+
+extern "C" {
+
+ irr::video::SColor
+ scm_to_color (SCM color);
+
+}
+
+#endif
#include <irrlicht/irrlicht.h>
#include <libguile.h>
+#include "color.h"
#include "device.h"
+#include "rect.h"
#include "texture.h"
#include "video-driver.h"
#include "wrapped.h"
init_video_driver (void)
{
init_video_driver_type ();
+ scm_c_define_gsubr ("begin-scene", 6, 0, 0, (scm_t_subr)irr_video_beginScene);
scm_c_define_gsubr ("get-texture", 2, 0, 0, (scm_t_subr)irr_video_getTexture);
scm_c_define_gsubr ("get-video-driver", 1, 0, 0, (scm_t_subr)irr_getVideoDriver);
}
init_video_driver_type, video_driver_p,
wrap_video_driver, unwrap_video_driver);
+ SCM
+ irr_video_beginScene (SCM wrapped_video_driver,
+ SCM back_buffer,
+ SCM z_buffer,
+ SCM color,
+ SCM video_data,
+ SCM source_rect)
+ {
+ irr::video::IVideoDriver* driver = unwrap_video_driver (wrapped_video_driver);
+ irr::core::rect<irr::s32>* sourceRectAddress = 0;
+ if (!scm_is_false (source_rect))
+ {
+ irr::core::rect<irr::s32> 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),
+ irr::video::SExposedVideoData (),
+ sourceRectAddress));
+ }
+
SCM
irr_video_getTexture (SCM wrapped_video_driver,
SCM filename)
DECLARE_WRAPPED_TYPE (irr::video::IVideoDriver*, init_video_driver_type,
video_driver_p, wrap_video_driver, unwrap_video_driver);
+ SCM
+ irr_video_beginScene (SCM wrapped_video_driver,
+ SCM back_buffer,
+ SCM z_buffer,
+ SCM color,
+ SCM video_data,
+ SCM source_rect);
+
SCM
irr_video_getTexture (SCM wrapped_video_driver,
SCM filename);