diff --git a/bindings/ruby/sfml-window/window/main.cpp b/bindings/ruby/sfml-window/window/main.cpp index 2e2e7cfa..ae7087e0 100644 --- a/bindings/ruby/sfml-window/window/main.cpp +++ b/bindings/ruby/sfml-window/window/main.cpp @@ -125,9 +125,24 @@ void CreateStyleEnum( void ) 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 ) { globalSFMLNamespace = rb_define_module( "SFML" ); + if( CheckDependencies() == false ) + { + rb_raise( rb_eRuntimeError, "This module depends on sfml-system" ); + } + rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue ); CreateKeyEnum();