Hi Tomek.

To receive keys, you need focus.
For focus, you need a visible layer.
If you do CreateSurface, you still do not see something.
If you create the surface of the primary layer, you are almost there.
Only when you do "flip()" the surface is actually shown on the layer. This is to make sure that no garbage is shown when you do CreateSurface().

hth
Niels

[email protected] wrote:
I have strange problem I do not understand.

DirectFBInit( &argc, &argv ); + error check
DirectFBCreate( &super_interface ); + error check

/*(1a) */ super_interface->SetCooperativeLevel( super_interface, DFSCL_FULLSCREEN ); + error check /*(1b) */ super_interface->SetCooperativeLevel( super_interface, DFSCL_NORMAL ); + error check super_interface->SetVideoMode( super_interface, 720, 720, 32 ) ; + error check

/*(2)*/ IDirectFBSurface * primary_surface = NULL;
          DFBSurfaceDescription primary_surface_description;
          primary_surface_description.flags = DSDESC_CAPS;
primary_surface_description.caps = DSCAPS_PRIMARY | DSCAPS_FLIPPING; super_interface->CreateSurface( super_interface, &primary_surface_description, &primary_surface ); + error check

primary_surface->Flip( primary_surface, NULL, 0 ); + error check

/*(3)*/  DFBEvent user_input_event;
           IDirectFBEventBuffer * user_input_event_buffer;
super_interface->CreateInputEventBuffer(super_interface, DICAPS_KEYS, DFB_FALSE, &user_input_event_buffer); + error check user_input_event_buffer->WaitForEvent(user_input_event_buffer); + error check user_input_event_buffer->GetEvent( user_input_event_buffer, &user_input_event ); + error check

Compilation go ok.
In all cases no error while program runs.

If I write (1a) - I do not have to write (2) and everything is ok.

But if I write (1b) and I do not write (2) then program just hang up on (3)-WaitForEvent(), if I press button program does not go further.
I need to write (2):
  - I need to create _PRIMARY surface
  - I need to flip this surface
( If I do not flip surface, or if it is not _PRIMARY surface then program hang up. So I need to do both.)
And then everything goes ok.

I am toothless.
Any suggestions? Please.

Regards,
Tomek.


----------------------------------------------------------------------
Nie dla nich ciepla praca za biurkiem.
Sprawdz >>> http://link.interia.pl/f2383

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users



--

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to