]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - src/gui-environment.cpp
fixing bugs
[guile-irrlicht.git] / src / gui-environment.cpp
index 00ca228b3bd9bc2faa6627e0b96db1f68804966e..420b6a67129eb743fc10a9563f1c84bd12b63f66 100644 (file)
@@ -81,15 +81,15 @@ gui_IGUIEnvironment_addImage (SCM gui_environment,
                               SCM id,
                               SCM text)
 {
-  gui::IGUIImage* image =
-    ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
-    addImage ((video::ITexture*)scm_to_pointer (image),
-              scm_to_position2d_s32 (position),
-              scm_to_bool (use_alpha_channel),
-              (TParent)scm_to_pointer (parent),
-              scm_to_int32 (id),
-              scm_to_wide_char_string (text));
-  return scm_from_pointer ((void*)image, NULL);
+  gui::IGUIEnvironment* guienv = (gui::IGUIEnvironment*)scm_to_pointer (gui_environment);
+  gui::IGUIImage* new_image =
+    guienv->addImage ((video::ITexture*)scm_to_pointer (image),
+                      scm_to_position2d_s32 (position),
+                      scm_to_bool (use_alpha_channel),
+                      (TParent)scm_to_pointer (parent),
+                      scm_to_int32 (id),
+                      scm_to_wide_char_string (text));
+  return scm_from_pointer ((void*) new_image, NULL);
 }
 
 
@@ -173,6 +173,14 @@ gui_IGUIEnvironment_addWindow (SCM gui_environment,
 }
 
 
+SCM
+gui_IGUIEnvironment_drawAll (SCM gui_environment)
+{
+  ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->drawAll ();
+  return SCM_UNSPECIFIED;
+}
+
+
 SCM
 gui_IGUIEnvironment_getBuiltInFont (SCM gui_environment)
 {
@@ -221,6 +229,7 @@ extern "C" {
                   gui_IGUIEnvironment_addStaticText<gui::IGUIElement*>);
     DEFINE_GSUBR ("gui_IGUIEnvironment_addWindow_IGUIElement", 6, 0, 0,
                   gui_IGUIEnvironment_addWindow<gui::IGUIElement*>);
+    DEFINE_GSUBR ("gui_IGUIEnvironment_drawAll", 1, 0, 0, gui_IGUIEnvironment_drawAll);
     DEFINE_GSUBR ("gui_IGUIEnvironment_getBuiltInFont", 1, 0, 0, gui_IGUIEnvironment_getBuiltInFont);
     DEFINE_GSUBR ("gui_IGUIEnvironment_getFont", 2, 0, 0, gui_IGUIEnvironment_getFont);
     DEFINE_GSUBR ("gui_IGUIEnvironment_getSkin", 1, 0, 0, gui_IGUIEnvironment_getSkin);