My application is wrote in C and is exposing DirectFB to Lua code. It's why the code may looks strange but it's more or less what can be done directly in C.
So, first of all, I'm acquiring the primary layer and then it's surface :
layer = SelLayer.GetLayer(0) -- Get primary layer
layer:SetCooperativeLevel( SelLayer.CooperativeLevelConst('ADMINISTRATIVE') )
psrf = layer:GetSurface()
and then doing some graphics on it. Ok, no problem, it's working.
Then, I would like to create a window on top of it :
local window = layer:CreateWindow {
pos = {50,50}, size = {200,200},
caps=SelWindow.CapsConst('NONE'),
stacking=SelWindow.StackingConst("UPPER"),
surface_caps=SelSurface.CapabilityConst('NONE')
}
window:SetOpacity(0xff) -- Make it visible
rdc_srf = window:GetSurface() -- Get its surface
but if I'm doing some graphics on it
rdc_srf:Clear(60,60,60,100)
rdc_srf:Flip(SelSurface.FlipFlagsConst("BLIT"))
it is never displayed : only the layer's surface is appearing. I tried with different flip options but it never worked.
Where is my mistake ? Can't I work directly on the layer surface and put a window on top of it ?
Thanks