From d516ef4f9101d9c76ea12ad8af02a6958f596a2e Mon Sep 17 00:00:00 2001 From: groogy Date: Sun, 14 Nov 2010 17:44:39 +0000 Subject: [PATCH] Forgot to fix the Init_Window function on the previous commit. Done now. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1639 4e206d99-4929-0410-ac5d-dfc041789085 --- bindings/ruby/sfml-window/window/Window.cpp | 22 ++++----------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/bindings/ruby/sfml-window/window/Window.cpp b/bindings/ruby/sfml-window/window/Window.cpp index 3cd306509..6d4634fb8 100644 --- a/bindings/ruby/sfml-window/window/Window.cpp +++ b/bindings/ruby/sfml-window/window/Window.cpp @@ -122,33 +122,19 @@ static VALUE Window_New( int argc, VALUE *args, VALUE aKlass ) rb_raise( rb_eArgError, "Expected 2..4 arguments but was given %d", argc ); break; } - VALUE rbData = Data_Wrap_Struct( aKlass, 0, VideoMode_Free, object ); + VALUE rbData = Data_Wrap_Struct( aKlass, 0, Window_Free, object ); rb_obj_call_init( rbData, 0, 0 ); return rbData; } -void Init_VideoMode( void ) +void Init_Window( void ) { - globalVideoModeClass = rb_define_class_under( GetNamespace(), "VideoMode", rb_cObject ); + globalWindowClass = rb_define_class_under( GetNamespace(), "Window", rb_cObject ); // Class methods - rb_define_singleton_method( globalVideoModeClass, "new", FUNCPTR( VideoMode_New ), -1 ); - rb_define_singleton_method( globalVideoModeClass, "getDesktopMode", FUNCPTR( VideoMode_GetDesktopMode ), 0 ); - rb_define_singleton_method( globalVideoModeClass, "getFullscreenModes", FUNCPTR( VideoMode_GetFullscreenModes ), 0 ); + rb_define_singleton_method( globalWindowClass, "new", FUNCPTR( Window_New ), -1 ); // Instance methods - rb_define_method( globalVideoModeClass, "width", FUNCPTR( VideoMode_GetWidth ), 0 ); - rb_define_method( globalVideoModeClass, "width=", FUNCPTR( VideoMode_SetWidth ), 1 ); - - rb_define_method( globalVideoModeClass, "height", FUNCPTR( VideoMode_GetWidth ), 0 ); - rb_define_method( globalVideoModeClass, "height=", FUNCPTR( VideoMode_SetWidth ), 1 ); - - rb_define_method( globalVideoModeClass, "bitsPerPixel", FUNCPTR( VideoMode_GetBitsPerPixel ), 0 ); - rb_define_method( globalVideoModeClass, "bitsPerPixel=", FUNCPTR( VideoMode_SetBitsPerPixel ), 1 ); // Aliases - rb_define_alias( globalVideoModeClass, "bits_per_pixel", "bitsPerPixel" ); - rb_define_alias( globalVideoModeClass, "bits_per_pixel=", "bitsPerPixel=" ); - rb_define_alias( globalVideoModeClass, "bpp", "bitsPerPixel" ); - rb_define_alias( globalVideoModeClass, "bpp=", "bitsPerPixel=" ); }