#include "cursor-control.h"
#include "gui-element.h"
+#include "gui-environment.h"
#include "mesh-scene-node.h"
#include "misc.h"
+#include "scene-manager.h"
#include "scene-node.h"
#include "video-driver.h"
#include "wchar.h"
void
init_misc (void)
{
+ scm_c_define_gsubr ("draw-all", 1, 0, 0, (scm_t_subr)irr_drawAll);
scm_c_define_gsubr ("get-name", 1, 0, 0, (scm_t_subr)irr_getName);
scm_c_define_gsubr ("set-position!", 2, 0, 0, (scm_t_subr)irr_setPosition);
scm_c_define_gsubr ("set-visible!", 2, 0, 0, (scm_t_subr)irr_setVisible);
- scm_c_export ("get-name", "set-position!", "set-visible!", NULL);
+ scm_c_export ("draw-all", "get-name", "set-position!", "set-visible!", NULL);
+ }
+
+ SCM
+ irr_drawAll (SCM wrapped_obj)
+ {
+ if (gui_environment_p (wrapped_obj))
+ {
+ unwrap_gui_environment (wrapped_obj)->drawAll ();
+ }
+ else if (scene_manager_p (wrapped_obj))
+ {
+ unwrap_scene_manager (wrapped_obj)->drawAll ();
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot draw all elements from object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ return SCM_UNSPECIFIED;
}
SCM
{
init_video_driver_type ();
scm_c_define_gsubr ("begin-scene", 1, 0, 1, (scm_t_subr)irr_video_beginScene);
- scm_c_define_gsubr ("draw-all", 1, 0, 0, (scm_t_subr)irr_drawAll);
scm_c_define_gsubr ("end-scene", 1, 0, 0, (scm_t_subr)irr_video_endScene);
+ scm_c_define_gsubr ("get-fps", 1, 0, 0, (scm_t_subr)irr_video_getFPS);
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);
- scm_c_export ("begin-scene", "draw-all", "end-scene", "get-texture",
+ scm_c_export ("begin-scene", "end-scene", "get-fps", "get-texture",
"get-video-driver", NULL);
}
}
SCM
- irr_drawAll (SCM wrapped_obj)
+ irr_video_endScene (SCM wrapped_video_driver)
{
- if (gui_environment_p (wrapped_obj))
- {
- unwrap_gui_environment (wrapped_obj)->drawAll ();
- }
- else if (scene_manager_p (wrapped_obj))
- {
- unwrap_scene_manager (wrapped_obj)->drawAll ();
- }
- else
- {
- scm_error (scm_arg_type_key, NULL, "Cannot draw all elements from object: ~S",
- scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
- }
- return SCM_UNSPECIFIED;
+ irr::video::IVideoDriver* driver = unwrap_video_driver (wrapped_video_driver);
+ return scm_from_bool (driver->endScene ());
}
SCM
- irr_video_endScene (SCM wrapped_video_driver)
+ irr_video_getFPS (SCM wrapped_video_driver)
{
irr::video::IVideoDriver* driver = unwrap_video_driver (wrapped_video_driver);
- return scm_from_bool (driver->endScene ());
+ return scm_from_int32 (driver->getFPS ());
}
SCM