flat assembler
Message board for the users of flat assembler.

Index > Linux > DirectFB?

Author
Thread Post new topic Reply to topic
garystampa



Joined: 25 May 2011
Posts: 52
Location: Central FLorida
garystampa 26 Oct 2011, 13:26
I am putting together a system with the goal of using a console-only Linux. (I haven't selected one but have several choices I'm investigating).

However I will want to run some graphical content on this system. So my question is: does anyone know if DirectFB is a good solution for this?

My understanding (so far) is that I would be able to run completely console until my program boots and starts DirectFB. At this point my program can output graphics using DirectFB's interface with the Linux frame buffer.

Why not just run any flavor of Linux and use X or add DirectFB to that? I want a lean and mean system that will fit in a very small space. No particular memory goal, just as small a possible without a bunch of stuff that will never execute.

I have a program using DirectFB under Puppy Linux which works fine, I just don't have enough knowledge of general Linux to simply strip this Linux down.

Thanks in advance.
Post 26 Oct 2011, 13:26
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 31 Oct 2011, 15:21
How would you classify the graphics needs of your application(s)?

A dumb framebuffer is horribly inefficient compared to hardware accelerated rendering.
Post 31 Oct 2011, 15:21
View user's profile Send private message Visit poster's website Reply with quote
garystampa



Joined: 25 May 2011
Posts: 52
Location: Central FLorida
garystampa 09 Nov 2011, 12:18
Sorry - I never saw your answer.

The application is just to display BMP files over the entire screen. "Soothing displays". The BMP images change about every 10 to 20 seconds. Nothing fancy, so I want to keep this as minimal a system as possible. Actually I was trying to see how little I could get away with.
Post 09 Nov 2011, 12:18
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 10 Nov 2011, 16:26
i believe directfb is getting more and more unused on linux, and different architectures have different include files too...

So my preference is SDL now, it has a "framebuffer" mode too
Post 10 Nov 2011, 16:26
View user's profile Send private message Visit poster's website Reply with quote
garystampa



Joined: 25 May 2011
Posts: 52
Location: Central FLorida
garystampa 11 Nov 2011, 15:02
Thanks for the heads up - I've seen references to SDL but misinterpreted them as having been deprecated.

Do you have any favorite links to discussions regarding SDL?
Post 11 Nov 2011, 15:02
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 14 Nov 2011, 02:48
garystampa wrote:
Thanks for the heads up - I've seen references to SDL but misinterpreted them as having been deprecated.

Do you have any favorite links to discussions regarding SDL?


well in ASM i don't know any yet, but we can make one here in linux... it would be nice to get FASM like SDL.

There is an SDL homepage, some LAME examples, and an irc chanel on freenode,
i've just started using it in C too, framebuffer's there, even double buffering is there, so its already usable.
Currently working on an asynchronous buffer flip example, if developers see it, maybe they'll even consider including.

BTW.: SDL is portable and is used for porting dos games to linux like TTD => OpenTTD, Dune2 => OpenDune
Post 14 Nov 2011, 02:48
View user's profile Send private message Visit poster's website Reply with quote
garystampa



Joined: 25 May 2011
Posts: 52
Location: Central FLorida
garystampa 14 Nov 2011, 12:36
Very interesting. Thanks!
Post 14 Nov 2011, 12:36
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Nov 2011, 01:42
just for fun, if you enable framebuffer mapping from /dev/fb0 you can do this in a framebuffered text console:
this will paint random pixels in fullscreen on 1024x768 framebuffer
Code:
dd if=/dev/urandom bs=65536 count=48 of=/dev/fb0
    


this will determine the fill rate for you
Code:
dd if=/dev/zero bs=65536 count=48 of=/dev/fb0
    


they must be run as root by default, here's a sample output:
Code:
48+0 records in
48+0 records out
3145728 bytes (3.1 MB) copied, 0.00370885 s, 848 MB/s
    
Post 25 Nov 2011, 01:42
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 25 Nov 2011, 04:22
played it
Code:
sb=$(stty -g);
tput civis;
stty raw -echo;
dd if=/dev/urandom bs=65536 count=48 of=/dev/fb0 2>1 >/dev/null;
sleep 4;
stty "$sb";
tput cnorm;
    
Post 25 Nov 2011, 04:22
View user's profile Send private message Visit poster's website Reply with quote
garystampa



Joined: 25 May 2011
Posts: 52
Location: Central FLorida
garystampa 28 Nov 2011, 15:25
Now I'm confused. It seems that SDL requires X. Also, I can't find any font drawing abilities in SDL.

The reason I liked DirectFB is that it didn't require X and it also supported fonts. Am I overlooking something about SDL?
Post 28 Nov 2011, 15:25
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 28 Nov 2011, 21:43
I would assume you should be able to compile a SDL version without X11 support - but since X11 is the default graphics provider for *u*x, it makes a lot of sense for the default binaries to include support for that Smile

It's been aged since I messed with SDL, though, so I'm not up to date with the backends supported. I'd be surprised if you can't get something working with just... directfb?... support. But I'd also not be surprised if they haven't checked no-X11-support build paths for a while Smile
Post 28 Nov 2011, 21:43
View user's profile Send private message Visit poster's website Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1166
Location: Overflow
Matrix 01 Dec 2011, 12:11
garystampa wrote:
Now I'm confused. It seems that SDL requires X. Also, I can't find any font drawing abilities in SDL.

The reason I liked DirectFB is that it didn't require X and it also supported fonts. Am I overlooking something about SDL?


hehe, i was feeling the same, they recommend using some ttf library to render fonts, though i just wrote my simple text output functions using the framebuffer, db-ed a 8x8 ascii font 8 bytes / character = 1024 bytes.
Post 01 Dec 2011, 12:11
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 01 Dec 2011, 12:29
Matrix wrote:
hehe, i was feeling the same, they recommend using some ttf library to render fonts, though i just wrote my simple text output functions using the framebuffer, db-ed a 8x8 ascii font 8 bytes / character = 1024 bytes.
That's nowhere near as pretty as TTF fonts, though Smile

_________________
Image - carpe noctem
Post 01 Dec 2011, 12:29
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.