Low-level (Linux framebuffer) graphics programming tutorial


58 posts   Page 3 of 3   1, 2, 3
by -rst- » Thu Dec 03, 2015 3:09 pm
Now that I 'was woken up' ;) a new post (quick & short for now) about palette animation (color cycling).
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by -rst- » Wed Feb 10, 2016 2:38 pm
Forgot to mention here: a new post two weeks ago around image color format conversion (based on discussion here https://www.raspberrypi.org/forums/view ... 10#p892207 )

http://raspberrycompote.blogspot.ie/201 ... ry-pi.html

And another quick piece on palette animation / color cycling - slightly more interesting and inspiring demo hopefully :)

http://raspberrycompote.blogspot.com/20 ... -more.html
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by -rst- » Thu Feb 11, 2016 12:07 pm
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by -rst- » Wed Feb 24, 2016 4:56 pm
Simple example on reading in an image file and displaying the image http://raspberrycompote.blogspot.ie/201 ... re_24.html
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by itsagoodquestion » Sat Mar 05, 2016 11:27 pm
Wow... this is a lot of fun, it's really similar to GDI in Windows! I would really, really like to get this working on my raspberry pi v2 b+, but whenever I run this code - http://raspberrycompote.blogspot.com.ar ... -part.html - the entire screen goes black. I have my Pi hooked up to a small TV over HDMI. Can you tell me how to fix this please? Thanks!
Posts: 47
Joined: Sat Mar 05, 2016 10:30 pm
by -rst- » Mon Mar 07, 2016 9:40 am
Hmm, that sounds odd. I only have version 1 Pis so cannot be 100% sure but I have tested with both the older Wheezy versions of Raspbian and the latest Jessie.

Does it return back to the shell prompt after 5 seconds (as it should)?

Which OS and version you have (what does 'uname -a' output)?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland
by itsagoodquestion » Tue Mar 08, 2016 10:04 pm
Hey there, thanks for your response.

Code: Select all
$ uname -a
Linux raspberrypi 4.1.17-v7+ #838 SMP Tue Feb 9 13:15:09 GMT 2016 armv7l GNU/Linux


The code from your tutorial #2 works as intended, but it does not return my desktop me. All the other codes I tried give me a black screen. So anytime after I run it, I have to reboot the machine via serial to tty cable to get display back. I've also tried running fbset w/depth-16 set before and that doesn't work either.

I haven't had much time lately to troubleshoot it I was just hoping you knew a quick fix, but I look very forward to getting this code working when I get more time :D :D :D
Posts: 47
Joined: Sat Mar 05, 2016 10:30 pm
by -rst- » Wed Mar 09, 2016 9:33 am
[quote="itsagoodquestion"... So anytime after I run it, I have to reboot the machine via serial to tty cable to get display back. I've also tried running fbset w/depth-16 set before and that doesn't work either. ...[/quote]

One trick that might help in these situations (obviously if it is not a complete lock up) is the use of the virtual consoles: hit Ctrl+Alt+F2 to get to the second console, login and reboot from there (of course the serial tty or a ssh session is about the same but this does not require another computer).
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'
Posts: 1315
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland