Page 1 of 1

New to graphics programming - what to learn?

Posted: Sat Feb 13, 2016 2:49 pm
by Magimedia
Hi,

I have an application that revolves around a 1024 x 1280 display (ie the config sets the screen rotated 90 degrees). The application needs to display some JPEGs in sequence, and also a page of text that will scroll.

Currently I'm using HTML and KWeb3 for this, which is passable, but the transitions between images is clunky, and text scrolling isn't smooth. My thinking is that I can probably code what I need (since the layouts are very simple anyway), and interface with the GPIO, as I've made an electronics interface..

What I want to achieve is mainly smooth transitions (fade or slide) between JPEGs, and very smooth text scrolling at a reasonable speed.

As far as I can make out, my best chance of success may be to use OpenVG and AJStarks library, although there's also something called OpenFrameworks that I've encountered.

I have some programming background in PHP/MySQL, and know a little C (low level PIC programming). I've also used Python, which I'm ruling out as I don't think there are OpenVG libraries for it. I realise I'm going to have to learn some new stuff, and the prospect is a little daunting but also quite exciting!

What would be the easiest language to accomplish this in?

Is the easiest language also going to give the best performance, or isn't there much difference?

Should I use AJStarks OpenVG library, or OpenFrameworks?

Re: New to graphics programming - what to learn?

Posted: Sat Feb 13, 2016 2:54 pm
by GTR2Fan
Wouldn't it be easier to just generate a video from the stills with embedded scrolling text with ffmpeg and play that back with omxplayer?

Another alternative would be to create and run a slideshow in Libreoffice Impress.

Re: New to graphics programming - what to learn?

Posted: Sat Feb 13, 2016 2:58 pm
by Magimedia
The text content can change hourly.
The JPEGs and text will eventually be able to be controlled via the GPIO interface.

I don't see how that could be accomplished in video? ...or are you suggesting compiling a video on boot?

Re: New to graphics programming - what to learn?

Posted: Sat Feb 13, 2016 3:00 pm
by GTR2Fan
Magimedia wrote:The text content can change hourly.
The JPEGs and text will eventually be able to be controlled via the GPIO interface.
Ah. I saw no mention of this in the opening post until going back and spotting the GPIO reference.

Re: New to graphics programming - what to learn?

Posted: Sat Feb 13, 2016 4:18 pm
by ghans
Those programs should do what you want OOB or
could at least be modified to do so :

http://www.info-beamer.com
http://www.screenlyapp.com
http://pipresents.wordpress.com


ghans

Re: New to graphics programming - what to learn?

Posted: Sun Feb 14, 2016 12:56 am
by Magimedia
Thanks

I made the mistake of creating a new install of Jessie. I can't get anything to run on startup, or if I put it in rc.local it doesn't output to the screen.

Is SystemD unable to simply run scripts on startup? Will I have to go back to Wheezy?

Re: New to graphics programming - what to learn?

Posted: Sun Feb 14, 2016 9:26 am
by ghans
The whole point of an init system is to run scripts
on startup.

What does "it doesn't output to the screen" mean ? Does your
program have graphical output or does it use stdout/stderr ?


ghans

Re: New to graphics programming - what to learn?

Posted: Sun Feb 14, 2016 12:24 pm
by Magimedia
The script I used to run under Wheezy simply ran a python program, which looked to see if there was a working internet connection, and if there was, downloaded some files, then used python's print command to output the word "UPDATED" in large letters drawn out of asterisks so it could be seen clearly from across a room. This no longer happens, and rc.local is executed a little earlier.

The script then went on to start KWeb3 etc. but that's the part I want to do differently this time.

I've managed to "fudge" things, by having a python script executed in rc.local that waits for 15 seconds then fakes pressing keys on the keyboard to run another script. It's an ugly hack, but it's working.

Back to the original problem...

Re: New to graphics programming - what to learn?

Posted: Mon Mar 21, 2016 3:11 pm
by raysan5
Maybe you can try my library: raylib (www.raylib.com). Its simple and easy-to-use, you code in C and my students are very happy with it. It works very well in any RPI version.

Re: New to graphics programming - what to learn?

Posted: Sat Apr 02, 2016 8:49 am
by davenull
wow, amazing!
great source code examples, marvelous clearly arranged!
congratulations!

did you publish it on Github?

How can I "apt-get install" raylib on my Raspi to #include the lib into my own Raspi gpp C/C++ programs?

Re: New to graphics programming - what to learn?

Posted: Sun Apr 03, 2016 10:03 pm
by raysan5
Hi davenull, many thanks for your comments! Lot of effort has been invested in raylib.

You can download raylib from github: https://github.com/raysan5/raylib

In the github wiki there is some info on usage: https://github.com/raysan5/raylib/wiki/ ... spberry-Pi

I don't know how to make it available from apt-get...

Please, let me know if you have any problem! :)

Re: New to graphics programming - what to learn?

Posted: Mon Apr 04, 2016 9:03 am
by davenull
how to download and install it then on Raspbian Jessie?

Re: New to graphics programming - what to learn?

Posted: Tue Apr 05, 2016 9:37 am
by raysan5
You should download it from Git repository:

Code: Select all

sudo apt-get install git
git clone https://github.com/raysan5/raylib.git raylib
And then you can compile the library following GitHub Wiki steps.

Re: New to graphics programming - what to learn?

Posted: Tue Apr 05, 2016 9:54 am
by davenull
ah, I see!
git is already installed, so I'll try it ASAP (have some WiFi issues FTM unfortunately since a couple of weeks, with all my WiFi sticks at my Raspi)