mirror of
https://github.com/SFML/SFML.git
synced 2025-02-08 01:18:02 +08:00
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 globalJoyNamespace;
|
||||||
VALUE globalStyleNamespace;
|
VALUE globalStyleNamespace;
|
||||||
|
|
||||||
|
/* External classes */
|
||||||
|
VALUE globalVector2Class;
|
||||||
|
|
||||||
VALUE GetNamespace( void )
|
VALUE GetNamespace( void )
|
||||||
{
|
{
|
||||||
return globalSFMLNamespace;
|
return globalSFMLNamespace;
|
||||||
@ -135,6 +138,22 @@ bool CheckDependencies( void )
|
|||||||
return false;
|
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 )
|
void Init_window( void )
|
||||||
{
|
{
|
||||||
globalSFMLNamespace = rb_define_module( "SFML" );
|
globalSFMLNamespace = rb_define_module( "SFML" );
|
||||||
@ -143,6 +162,8 @@ void Init_window( void )
|
|||||||
rb_raise( rb_eRuntimeError, "This module depends on sfml-system" );
|
rb_raise( rb_eRuntimeError, "This module depends on sfml-system" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RetrieveVector2Class();
|
||||||
|
|
||||||
rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue );
|
rb_define_const( globalSFMLNamespace, "WindowLoaded", Qtrue );
|
||||||
|
|
||||||
CreateKeyEnum();
|
CreateKeyEnum();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user