From 1fad97be6de54202c1e7378237587f32b1233f02 Mon Sep 17 00:00:00 2001 From: groogy Date: Sun, 13 Feb 2011 12:59:28 +0000 Subject: [PATCH] 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 --- bindings/ruby/sfml-graphics/graphics/main.cpp | 8 ++++---- bindings/ruby/sfml-window/window/main.cpp | 1 - bindings/ruby/shared/NonCopyable.hpp | 2 ++ bindings/ruby/shared/Vector2.hpp | 2 ++ bindings/ruby/shared/Vector3.hpp | 2 ++ 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bindings/ruby/sfml-graphics/graphics/main.cpp b/bindings/ruby/sfml-graphics/graphics/main.cpp index 9779ad254..8a6e487b9 100644 --- a/bindings/ruby/sfml-graphics/graphics/main.cpp +++ b/bindings/ruby/sfml-graphics/graphics/main.cpp @@ -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(); diff --git a/bindings/ruby/sfml-window/window/main.cpp b/bindings/ruby/sfml-window/window/main.cpp index b238b1a46..a38aac4c9 100644 --- a/bindings/ruby/sfml-window/window/main.cpp +++ b/bindings/ruby/sfml-window/window/main.cpp @@ -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"); diff --git a/bindings/ruby/shared/NonCopyable.hpp b/bindings/ruby/shared/NonCopyable.hpp index 5f8166e50..45e8e319e 100644 --- a/bindings/ruby/shared/NonCopyable.hpp +++ b/bindings/ruby/shared/NonCopyable.hpp @@ -25,6 +25,8 @@ #include "ruby.h" +extern VALUE globalNonCopyableModule; + void Init_NonCopyable( void ); #endif // SFML_RUBYEXT_NON_COPYABLE_HEADER_ diff --git a/bindings/ruby/shared/Vector2.hpp b/bindings/ruby/shared/Vector2.hpp index 729c77eb8..72d561ef7 100644 --- a/bindings/ruby/shared/Vector2.hpp +++ b/bindings/ruby/shared/Vector2.hpp @@ -25,6 +25,8 @@ #include "ruby.h" +extern VALUE globalVector2Class; + VALUE Vector2_GetX( VALUE self ); VALUE Vector2_GetY( VALUE self ); diff --git a/bindings/ruby/shared/Vector3.hpp b/bindings/ruby/shared/Vector3.hpp index 5a438d90f..6ad35de5f 100644 --- a/bindings/ruby/shared/Vector3.hpp +++ b/bindings/ruby/shared/Vector3.hpp @@ -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 );