0

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

1 Answers1

1

I found it out : SetCooperativeLevel() has to be set to NORMAL flags instead of "FULLSCREEN". The documentation is confusing because it says "Application grabs the primary layer" whereas all graphics are created by the same application in my case. It seems FULLSCREEN means we own the primary layer and nothing else (including ourself own object) can't access to it.