Gfx.sel
#!./Selene
Selene.UseDirectFB("--dfb:quiet,no-vt")
DirectFB.init( DirectFB.CooperativeConst('FULLSCREEN') );
srf = SelSurface.create { caps=SelSurface.CapabilityConst('PRIMARY') } w,h = srf:GetSize()
print "Only a break signal can stop this demo"
math.randomseed( os.time() )
while true do
local c = math.random(10)
if c == 1 then
srf:SetColor( math.random(0,255), math.random(0,255), math.random(0,255), math.random(0,255))
elseif c == 2 then
if math.random(10000) == 1 then srf:Clear( math.random(0,w), math.random(0,h), math.random(0,w), math.random(0,h) )
end
elseif c == 3 then
srf:DrawLine( math.random(0,w), math.random(0,h), math.random(0,w), math.random(0,h) )
elseif c == 4 then
srf:DrawRectangle( math.random(0,w), math.random(0,h), math.random(0,w), math.random(0,h) )
elseif c == 5 then
srf:FillRectangle( math.random(0,w), math.random(0,h), math.random(0,w), math.random(0,h) )
elseif c == 6 then
srf:FillTriangle( math.random(0,w), math.random(0,h), math.random(0,w), math.random(0,h), math.random(0,w), math.random(0,h) )
end
end