[Ironruby-core] IronRuby and XNA. Super and Generics

Dudu Baião eduardobaiao at gmail.com
Tue Nov 25 21:25:52 EST 2008

Hi guys!

Im playing with XNA trying to run the simplest xna example: To show a
SpriteBatch on screen.

After some tests I found some problems:

1- The "Microsoft::Xna::Framework::Game" expects that we implement
some methods like "Update", "Drawn" etc, and inside the method we have
to call the base class (super) actual method passing some parameters.

If I try to do this:

    def update(game_time)

I get this error:

my_game.rb:23:in `update': wrong number or type of arguments for
`update' (ArgumentError)
    from Snippets.scripting:0:in `Update'
    from Microsoft.Xna.Framework.Game:0:in `Run'
    from program.rb:23:in `main'
    from :0

2- XNA uses generic functions to load the game contents. How can I
convert the code above to IronRuby?

// This is a texture we can render.
Texture2D myTexture;

protected override void LoadContent()
    myTexture = Content.Load<Texture2D>("mytexture");

Can IronRuby consume generics?


More information about the Ironruby-core mailing list