MonoGame on Raspberry Pi...


12 posts
by CartBlanche » Fri Oct 26, 2012 9:47 am
This Thread was originally in other projects, but I couldn't work out how to migrate it to here, where it seems more appropriate...

I just wanted to point out that Dean ( too humble to post himself), from the MonoGame team, has successfully got MonoGame and 3D working on the Raspberry Pi. Please watch the video here - http://www.youtube.com/watch?v=jwbYe6eoZgE

I'd still love to see an ultra cheap hand held gaming device that almost anyone can write games for!!

Code and steps will be available from our http://github.com/mono/MonoGame/ repo.
Posts: 14
Joined: Fri Nov 04, 2011 10:04 pm
by meltwater » Mon Oct 29, 2012 12:29 pm
I am keen to get this working having done a few XNA tutorials on a windows 7 machine I would like to continue using the Raspberry Pi.

I've been trying various ways to get things working but so far am unable to more than run the tetris demo. I guess I am in need of some more basic instructions as I am missing something here.

Following the steps from here:
http://www.vihrearobotti.com/other/monogamegles

I've been trying to get the MonoGame.Framework to build, but I get build errors if trying to build to target .Net3.5 (which apparently is required for the version of mono on the Rpi).
Building with .Net4.0 no errors!

So far errors include:
# 'Microsoft.Xna.Framework.Graphics.ClearOptions' does not contain a definition for 'HasFlag' and no extension method 'HasFlag' accepting a first argument of type 'Microsoft.Xna.Framework.Graphics.ClearOptions'...
# Default parameter specifiers are not permitted - where function declarations include default values
# System.Threading.Tasks - The type or namespace name 'Tasks' does not exist in the namespace 'System.Threading'...etc - Even installed and added Reactive Extensions (System.CoreEx and System.Reactive) to overcome this. Just leads to yet more errors!


My initial aim is to rebuild the Tetris demo on a windows machine (I've tried running monodevelop directly on the rpi but it tends to fall over too much). Then I want to attempt some tutorials or demos and learn more about XNA etc.

Has anyone else tried this?
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by meltwater » Mon Oct 29, 2012 1:21 pm
OK I've found a dirty way to hack this...

1) Take the MonoGame.Framework.EmbeddedGLES2.dll from the tetris_raspberry_gles2.zip and replace the references to use this instead of trying to build MonoGame.Framework.dll each time.
2) Ensure .Net3.5 is set as target
3) Make a copy of the tetris_raspberry_gles2 folder and replace the tetris.exe with the one from the build (and contents folder if you change any of that)...
4) The built exe works on the Raspberry Pi.

Now to try some other samples...
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by meltwater » Mon Oct 29, 2012 2:59 pm
OK:
Works for Tetris sample.
TilteSprites fails, unable to load "desaturate.xnb"
Draw2D works
Chase and Evade works
Catapult Net Wars doesn't work - CSharp lib isn't available for .Net3.5
StarWarrior doesn't work

Attempted to try example where fbx file (3d model) is loaded. Unable able to do so, since the Type "Model" can't be found in the framework...
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by meltwater » Mon Oct 29, 2012 4:09 pm
OK found that the Raspberry Pi branch of the framework includes the model bit (MonoGame.Framework.Embedded), but unable to compile with .NET3.5 only .NET4.

MonoGame.Framework.EmbeddedGLES2 builds on .NET3.5 but also no "Model" type.
I guess I can at least use that correctly now for the supported samples, still no joy in getting 3D stuff to work.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by sdd » Sat Dec 01, 2012 4:25 pm
well if an ultra cheap hand held is what you want, that should be relitively easy. make linux from scratch, that would be the best way to make a custom os for the pi. as for monodevelope I can't help you there I use unity.
Posts: 60
Joined: Sun Oct 21, 2012 5:48 pm
Location: USA
by meltwater » Sat Dec 01, 2012 10:11 pm
No was just interested in learning about XNA and 3d graphics coding using the RPi, thought monogame 3d would be able to do it. Have a feeling it just isn't quite there yet.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by sdd » Sun Dec 02, 2012 5:08 pm
well yeah, I know what your talking about, but the hand held thing was in the very first post.
Posts: 60
Joined: Sun Oct 21, 2012 5:48 pm
Location: USA
by meltwater » Sun Dec 02, 2012 6:35 pm
sdd wrote:well yeah, I know what your talking about, but the hand held thing was in the very first post.

Oh fair enough. Well a hand held pi would be nice. So does unity work on Rpi? :D
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by sdd » Mon Dec 03, 2012 4:51 am
I don't know, I don't have a Pi to try it on. I might at the end of the month, but not likly
Posts: 60
Joined: Sun Oct 21, 2012 5:48 pm
Location: USA
by meltwater » Mon Dec 03, 2012 8:10 am
sdd wrote:I don't know, I don't have a Pi to try it on. I might at the end of the month, but not likly

No problem, will have a try at some point, when I get some spare time. May have a look at the stuff used for the penguin puzzle game, shows that the GPU on the Rpi is a major asset.
http://penguinspuzzle.appspot.com/
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by 6677 » Mon Dec 03, 2012 6:30 pm
Unity is for x86 only. The pi is not x86.

Monogame is for any platform with mono support also supported by SharpDX or OpenTK. Mono on the pi has been a little sketchy with float support.
Posts: 372
Joined: Wed Mar 14, 2012 9:23 pm