diff --git a/bindings/ruby/sfml-window/window/main.cpp b/bindings/ruby/sfml-window/window/main.cpp index 2e2e7cfa0..ae7087e04 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();