Fixed some missing reference in sfml-graphics initiation function. The shared classes has to be global and reacquired in each library for it to work.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1798 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
groogy 2011-02-13 12:59:28 +00:00
parent e63a8fe442
commit 1fad97be6d
5 changed files with 10 additions and 5 deletions

View File

@ -70,15 +70,15 @@ static void CreateBlendEnum( void )
void Init_graphics( void )
{
/* SFML namespace which contains the classes of this module. */
/*globalSFMLNamespace = rb_define_module( "SFML" );*/
globalSFMLNamespace = rb_define_module( "SFML" );
if( CheckDependencies() == false )
{
rb_raise( rb_eRuntimeError, "This module depends on sfml-window" );
}
/*globalVector2Class = RetrieveSFMLClass( "Vector2" );
globalVector3Class = RetrieveSFMLClass( "Vector3" );*/
globalVector2Class = RetrieveSFMLClass( "Vector2" );
globalVector3Class = RetrieveSFMLClass( "Vector3" );
globalWindowClass = RetrieveSFMLClass( "Window" );
/*globalNonCopyableModule = RetrieveSFMLClass( "NonCopyable" );*/
globalNonCopyableModule = RetrieveSFMLClass( "NonCopyable" );
rb_define_const(globalSFMLNamespace, "GraphicsLoaded", Qtrue);
CreateBlendEnum();

View File

@ -162,7 +162,6 @@ void Init_window( void )
rb_raise( rb_eRuntimeError, "This module depends on sfml-system" );
}
globalVector2Class = rb_define_class_under(globalSFMLNamespace, "Vector2", rb_cObject );
globalNonCopyableModule = rb_define_module_under(globalSFMLNamespace, "NonCopyable");

View File

@ -25,6 +25,8 @@
#include "ruby.h"
extern VALUE globalNonCopyableModule;
void Init_NonCopyable( void );
#endif // SFML_RUBYEXT_NON_COPYABLE_HEADER_

View File

@ -25,6 +25,8 @@
#include "ruby.h"
extern VALUE globalVector2Class;
VALUE Vector2_GetX( VALUE self );
VALUE Vector2_GetY( VALUE self );

View File

@ -25,6 +25,8 @@
#include "ruby.h"
extern VALUE globalVector3Class;
VALUE Vector3_GetX( VALUE self );
VALUE Vector3_GetY( VALUE self );
VALUE Vector3_GetZ( VALUE self );