Other languages

Helper to easily work with the frame buffer in Lua

1 1885
Edited by destroyedlolo at Sat Apr 18, 2015 22:03

Let me introduce my new project : Selene (from the name of the Goddess of the moon)

Selene is a tool to make easier graphical programming of Linux FrameBuffer : it is programmed in C, and use Lua (moon in Portuguese ) as scripting language.

As example, the famous DirectFB's "one line test" counterpart looks like :
  1. --- The famous "horizontal line test"
  2. Selene.init( Selene.CooperativeConst('FULLSCREEN') ); -- Set display cooperative mode
  3. srf = SelSurface.create { caps=Selene.CapabilityConst('PRIMARY') } -- create a primary surface
  4. w,h = srf:GetSize() -- Retrieve its size

  5. srf:FillRectangle(0,0,w,h) -- Background with a border

  6. srf:SetColor( 0x80, 0x80, 0x80, 0x80) -- semi transparent grey
  7. srf:DrawLine( 0, h/2, w, h/2 )
  8. srf:SetColor( 0xff, 0x80, 0x80, 0x80) -- Orange
  9. srf:DrawLine( w/2, 0, w/2, h )

  10. print "Hit 'enter' key to exit"
  11. io.stdin:read'*l' -- wait for enter
  12. srf:destroy()
Copy the Code
Currently, it exposes a very small subset of DirectFB capability but will be extended as per my needs (or others if someone want to participate too ) : I'm developing and testing it on my Banana with its 3.5 LCD screen and will be the basement of some graphical projects I have on this platform related to home automation.

The project is on the GitHub ... no documentation for the moment, I will made some in case of interests.

Some news about it : it's working very well on both my A13 based tablet, my BananaPI/Pro and I'm starting some test with the Guitar (but I have no doubt it will run soothly as well).

Here the result you can have :


I'm looking for some people that can test on other machine as well.


You have to log in before you can reply Login | Sign Up

Points Rules