Hi All -
I am creating an application in C/C++. For that a requirement is to create an image (.jpg/.bmp etc.) viewer/slide show. But the program will rum from console. That means I don’t want to login to the UI mode of Raspberry Pi, rather boot to console mode and run the program. The program will pick up images from some designated folder and display slideshows (with image transition etc.).
Now my questions are -
- Can OF help me in doing this without the presence of the x console?
- How do I get the image transition effects (fade,cut, random bars etc.). Any example…
Hi, you don’t need X to run OpenGL programs on the Raspberry Pi, so #1 is no problem.
For #2 there is no specific example that comes with oF that will do it, but there are lots of ways to go about it. There are functions for drawing images so you should be able to have some crossfading going in no time at least.
If you want to get fancy/advanced the Raspberry Pi runs shaders really fast, so you shouldn’t have much of an issue doing the transitions using shaders and there will be examples around for that.
I believe that the window of opengl openFrameworks is diverted on the framebuffer, you do not need any xinit or startx, for transactions suggest the use of masks in GLSL see example alphaMaskingShaderExample.
You can even autologin and autostart your app if needed (so you just switch on the Rpi and it will start the slideshow). Don’t forget to disable the screen saver https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=57552 and do the same on your display if such setting.
@hahakid - Thanks for your response.
For #1, I am new to OpenGL. So if you give me some pointers, that would be great.
On #2, Does OpenGL provide APIs for transition effects? or Do I need to do by myself. I am running against time to finish the work. Some example really help me.
@01010101 - Thanks. In fact I need this as my slides are planned to run forever.
Hi, no need to deal with OpenGL directly, openFrameworks has a bunch of helper functions to make your life easier, look at ofImage in particular. openFrameworks comes with a lot of examples, have a look at them on your desktop machine as it’ll be easier than dealing with the Pi to begin with (unless you are very familiar with Linux).
OpenGL does not provide any APIs for transition effects, it’s a very low level graphics library.