From feae42e7f7db00206789f225ec934cb42659274f Mon Sep 17 00:00:00 2001 From: groogy Date: Mon, 22 Nov 2010 15:03:30 +0000 Subject: [PATCH] Fixed so that the rbDrawable::Render function now wraps the sf::Renderer and sf::RenderTarget objects and passes the wrappers to the SFML::Drawable#render method. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1694 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/sfml-graphics/graphics/Drawable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bindings/ruby/sfml-graphics/graphics/Drawable.cpp b/bindings/ruby/sfml-graphics/graphics/Drawable.cpp index 09ec8c7c..32c9105a 100644 --- a/bindings/ruby/sfml-graphics/graphics/Drawable.cpp +++ b/bindings/ruby/sfml-graphics/graphics/Drawable.cpp @@ -31,6 +31,8 @@ VALUE globalDrawableModule; /* External classes */ extern VALUE globalVector2Class; extern VALUE globalColorClass; +extern VALUE globalRenderTargetInstanceClass; +extern VALUE globalRendererClass; class rbDrawable : public sf::Drawable { @@ -47,6 +49,9 @@ protected: virtual void Render( sf::RenderTarget& aTarget, sf::Renderer& aRenderer ) const { + VALUE targetWrap = Data_Wrap_Struct( globalRenderTargetInstanceClass, 0, 0, &aTarget ); + VALUE rendererWrap = Data_Wrap_Struct( globalRendererClass, 0, 0, &aRenderer ); + rb_funcall( myRubySelf, myRenderID, 2, targetWrap, rendererWrap ); } };