From 562547b0eeb5e24a965ac99de0232dbeafdf98ec Mon Sep 17 00:00:00 2001 From: groogy Date: Tue, 2 Nov 2010 22:20:20 +0000 Subject: [PATCH] Added comments to the ruby wrapper functions. Hopefully they comply with rdoc and the ruby standard so I can generate a good documentation later. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1592 4e206d99-4929-0410-ac5d-dfc041789085 --- ruby/sfml-system/system/Clock.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ruby/sfml-system/system/Clock.cpp b/ruby/sfml-system/system/Clock.cpp index 9b00ea6f8..019d49a2d 100644 --- a/ruby/sfml-system/system/Clock.cpp +++ b/ruby/sfml-system/system/Clock.cpp @@ -2,13 +2,23 @@ #include "System.hpp" #include +/* Clock class */ VALUE globalClockClass; +/* Free a heap allocated object + * Not accessible trough ruby directly! + */ static void Clock_Free( sf::Clock *anObject ) { delete anObject; } +/* call-seq: + * clock.getElapsedTime() -> Float + * + * This function returns the time elapsed since the last call to Reset() + * (or the construction of the instance if Reset() has not been called) in seconds. + */ static VALUE Clock_GetElapsedTime( VALUE self ) { sf::Clock *object = NULL; @@ -16,6 +26,11 @@ static VALUE Clock_GetElapsedTime( VALUE self ) return rb_float_new( object->GetElapsedTime() ); } +/* call-seq: + * clock.reset() -> nil + * + * This function puts the time counter back to zero. + */ static VALUE Clock_Reset( VALUE self ) { sf::Clock *object = NULL; @@ -24,6 +39,11 @@ static VALUE Clock_Reset( VALUE self ) return Qnil; } +/* call-seq: + * Clock.new() -> clock + * + * The clock starts automatically after being constructed. + */ static VALUE Clock_New( VALUE aKlass ) { sf::Clock *object = new sf::Clock();