Added dependency check for Window module.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1649 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
groogy 2010-11-16 08:09:41 +00:00
parent bbb8cbb25a
commit 07dd3de1d2

View File

@ -125,9 +125,24 @@ void CreateStyleEnum( void )
rb_define_const( globalStyleNamespace, "Default", sf::Style::Default ); rb_define_const( globalStyleNamespace, "Default", sf::Style::Default );
} }
bool CheckDependencies( void )
{
if( rb_cvar_defined( globalSFMLNamespace, rb_intern( "SystemLoaded" ) ) == Qtrue )
{
return true;
}
return false;
}
void Init_window( void ) void Init_window( void )
{ {
globalSFMLNamespace = rb_define_module( "SFML" ); globalSFMLNamespace = rb_define_module( "SFML" );
if( CheckDependencies() == false )
{
rb_raise( rb_eRuntimeError, "This module depends on sfml-system" );
}
rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue ); rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue );
CreateKeyEnum(); CreateKeyEnum();