Installing love2d on RaspberryPi 2

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
MachineCode
Citizen
Posts: 70
Joined: Fri Jun 20, 2014 1:33 pm

Installing love2d on RaspberryPi 2

Post by MachineCode »

For the last few days I have been trying to get a working installation of love2d on the new Raspberry Pi 2. This is the just released quad core A7 ARM PC with 1G of RAM and the Broadcom VC4 GPU. It is now working - with a few minor things I can't understand.

Firstly, there are a few gotchas if you have not done a build and install or are a beginner (like me).

1. SDL2 is not yet in the Raspian repositories, so you will need to grab the sources and look at SDL2 Wiki-Install to get instructions.

2. The build and install will appear to work, however it will not get you to the Baby Inspector screen from running love. The SDL2-wiki-Install-Raspberry Pi points you to some nightly builds in tarballs. Grab the latest and copy it into the root directory. This helped me, so I can only assume that some thing required for RPi 2 has been patched.

3. Grab the bartbes GLES archive and follow the instruction on the love2d wiki to install. You will need to load various packages that are required including the dev packages.

OK - that got me to a working installation. The first thing you will try is to type love in an xterm. This will result in an ERRORBOX from SDL2 which says ..

Could not create window
SDL not configured with OpenGL/GLX support

Could not create window
SDL not configured with OpenGL/GLX support (yes, you get the message twice)


It looks like Raspian X does not yet support windows with GLX. Perhaps the fact that they use 16 bit color is a showstopper? I would appreciate it if someone could explain what the issues here are - it is not clear to me.

Next ALT-CTL-F1 to get you out of X. Now typing love gives the Baby Inspector full screen 1080. Success!


Anomoly 1. Escaping from this demo screen gives a message ...

Warning, MSAA setting failed! (Result: buffer: 0, Samples:1)

After some tests, this error only goes away if you put this in config.lua " t.window.fsaa = 4"


Anomoly 2. In love.draw if you draw to the screen, then change the target to another canvas, the whole screen is drawn white. This only happens on the RPi and does not happen on Windows or Linux. Reversing the draw order in love.draw so that the first target is the offscreen canvas then after that the final target is the screen - that fixes the problem for the RPi.

I can't find anything in the documentation that says that the screen update should be the last in the draw order in love.draw. A guess would be that on the RPi version of GLES the screen draws are slower or prevent a back to back change of canvas targets.

Anyway, I have added a .love file with the test code. Basically, it loads an image to an off screen canvas then does a phosphor decay to that copy and then blits it to the screen with a sine rotation and offset. The trick to making it work with RPi is to do the screen draw last. On PC or Linux the order makes no difference.
Attachments
fade.love.zip
Off screen canvas test code
(615.85 KiB) Downloaded 102 times
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: Installing love2d on RaspberryPi 2

Post by rmcode »

Wasteland 2

<3
Post Reply

Who is online

Users browsing this forum: Google [Bot], togFox and 219 guests