Hi, I have been working with JUCE for quite a time on Windows. Now I have a project where I need to render a simple text animation on Rapberry PI. I thought since I am already familiar with JUCE I might give it a shot...
Well I have been able to build JUCE on my Raspberry PI (model B+). I used this process to install the additional libraries needed to build JUCE:
https://github.com/rec/echomesh/blob/master/documentation/Building%20Juce%20applications%20on%20the%20Raspberry%20Pi.md
What I want to do is to render 3 digits inside the rectangle of the whole screen. And then at some point shrink the text bounding box a bit to the top and make another short text come up from the bottom. A real simple animation. After few seconds the text at the bottom should go away and the 3 digits should show again stretched on the entire window.
I created an Animated Application from the Introjucer template. I have overriden the paint method in MainContentComponent like this:
void paint (Graphics& g) override { // (Our component is opaque, so we must completely fill the background with a solid colour) g.fillAll (Colours::black); g.setColour(Colours::white); Rectangle<float> numberArea = layout.getCurrentNumberArea(); Rectangle<float> bottomArea = layout.getCurrentBottomArea(); Font f; f.setHeight(numberArea.getHeight()); g.setFont(f); g.drawText("727", numberArea, Justification::centred, false); f.setHeight(bottomArea.getHeight()); g.setFont(f); g.drawText("simple text", bottomArea, Justification::centred, 1); }
In update() I just compute the Rectangles that are returned by layout.getCurrentNumberArea() and layout.getCurrentBottomArea().
On my Windows PC this runs just fine (I have set 60 FPS for the animation using setFramesPerSecond (60)). But when I made a Linux build in Introjucer and copied it to the Raspberry and build&run it, it runs like 3 FPS, which is completely useles.
Well in theory this should work even on Raspberry as it is capable of realtime decoding 1080p H264 video. I guess that using Graphics object is too inefficient for rendering on such a slow device. And I dont even use any transformations I just set a different text height to keep it simple.
Do you have any advice on what should I try?
And related questions:
Is Graphics object rendering hardware accelerated?
Can I make it faster somehow?
Is it somehow possible that the things are so slow beacuse I did not build the JUCE right? For example i have skiped the point 4 in the instructions above and it built just fine.
Also I guess I can use OpenGL rendering directly but I'd like to avoid that as it is really a simple aplication that only displays some short text. I remember from my school days that rendering a nice text in OpenGL was not exactly a job done in a matter of hours...
Thanks
//Edit:
this thread might be of some relevance as the slow text rendering is mentioned there as well (although it's not about Raspberry):
http://www.juce.com/forum/topic/opengl-renderer-drawing-performance
this thread mentions that JUCE OpenGL on Raspberry is very slow:
http://www.juce.com/forum/topic/juce-raspberry-pi-opengl?page=2