Quck syntax fiex to main.cpp VideoMode.cpp

Added skeleton for SFML::Window and finished the new method I think.

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1635 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
groogy 2010-11-11 20:43:18 +00:00
parent 462c5723df
commit 10de308f44
4 changed files with 196 additions and 9 deletions

View file

@ -117,7 +117,7 @@ static VALUE VideoMode_GetDesktopMode( VALUE aKlass )
static VALUE VideoMode_GetFullscreenModes( VALUE aKlass )
{
std::vector< sf::VideoMode >& modes = sf::VideoMode::GetFullscreenModes();
const std::vector< sf::VideoMode >& modes = sf::VideoMode::GetFullscreenModes();
VALUE array = rb_ary_new();
for( std::vector< sf::VideoMode >::const_iterator it = modes.begin(), end = modes.end(); it != end; it++ )
{
@ -138,13 +138,13 @@ static VALUE VideoMode_New( int argc, VALUE *args, VALUE aKlass )
object = new sf::VideoMode();
break;
case 2:
object = new sf::VideoMode( UINT2FIX( args[0] ), UINT2FIX( args[1] ) );
object = new sf::VideoMode( INT2FIX( args[0] ), INT2FIX( args[1] ) );
break;
case 3:
object = new sf::VideoMode( UINT2FIX( args[0] ), UINT2FIX( args[1] ), UINT2FIX( args[2] ) );
object = new sf::VideoMode( INT2FIX( args[0] ), INT2FIX( args[1] ), INT2FIX( args[2] ) );
break;
default:
rb_raise( rb_eArgError, "Expected 0 2 or 3 arguments but was given %ld", arrayLength );
rb_raise( rb_eArgError, "Expected 0 2 or 3 arguments but was given %d", argc );
break;
}
VALUE rbData = Data_Wrap_Struct( aKlass, 0, VideoMode_Free, object );