Added support for external classes from sfml-system and the ability to include them.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1652 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
1fda02efc4
commit
da2cec5a9f
@ -38,6 +38,9 @@ VALUE globalMouseNamespace;
|
||||
VALUE globalJoyNamespace;
|
||||
VALUE globalStyleNamespace;
|
||||
|
||||
/* External classes */
|
||||
VALUE globalVector2Class;
|
||||
|
||||
VALUE GetNamespace( void )
|
||||
{
|
||||
return globalSFMLNamespace;
|
||||
@ -135,6 +138,22 @@ bool CheckDependencies( void )
|
||||
return false;
|
||||
}
|
||||
|
||||
VALUE RetrieveSFMLClass( const char * aName )
|
||||
{
|
||||
ID name = rb_intern( aName );
|
||||
if( rb_cvar_defined( globalSFMLNamespace, name ) == Qfalse )
|
||||
{
|
||||
rb_raise( rb_eRuntimeError, "This module depends on SFML::%s", aName );
|
||||
}
|
||||
|
||||
return rb_cvar_get( globalSFMLNamespace, name );
|
||||
}
|
||||
|
||||
void RetrieveVector2Class( void )
|
||||
{
|
||||
globalVector2Class = RetrieveSFMLClass( "Vector2" );
|
||||
}
|
||||
|
||||
void Init_window( void )
|
||||
{
|
||||
globalSFMLNamespace = rb_define_module( "SFML" );
|
||||
@ -143,6 +162,8 @@ void Init_window( void )
|
||||
rb_raise( rb_eRuntimeError, "This module depends on sfml-system" );
|
||||
}
|
||||
|
||||
RetrieveVector2Class();
|
||||
|
||||
rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue );
|
||||
|
||||
CreateKeyEnum();
|
||||
|
Loading…
Reference in New Issue
Block a user