Hello,
I've been playing around with some of the apps in the directfb- examples package learning how directfb works. I tried to add window resize support to df_window, and now the application segfaults when resizing. In its origonal form, the windows simply disapear when resizing. Can someone please tell me if I'm resizing correctly, or the proper way to resize if not?


Any help is much appreciated.

Thanks,
Ryan Burns


Here is the relevant code:

df_window.c

//draw rectangle with video support removed
void draw_window2()
{
    int width;
    int height;
    window_surface2->GetSize(window_surface2, &width, &height);

window_surface2->SetColor( window_surface2, 0x00, 0x30, 0x10, 0xc0 ); window_surface2->DrawRectangle( window_surface2, 0, 0, width, height ); window_surface2->SetColor( window_surface2, 0x80, 0xa0, 0x00, 0x90 ); window_surface2->FillRectangle( window_surface2, 1, 1, width-2, height- -> 2 );

    window_surface2->Flip( window_surface2, NULL, 0 );
}
[snip]

//switch inside while loop in main()
switch (evt.type) {
...
case DWET_SIZE:
    if (active == window1)
        draw_window1();
    if (active == window2)
        draw_window2();
    break;
[snip]


when running in gdb:
(gdb) where
#0 0xb7f9b010 in Cop_to_Aop_32 (gfxs=0x80a6d98) at ../../../../src/ gfx/generic/generic.c:147 #1 0xb7facced in gFillRectangle (state=0x1, rect=0xbffffc40) at ../../../../src/gfx/generic/generic.c:7070 #2 0xb7fb4e40 in dfb_gfxcard_fillrectangles (rects=0xbffffc40, num=1, state=0x80a7a38) at ../../../src/core/gfxcard.c:713 #3 0xb7f82f3c in IDirectFBSurface_FillRectangle (thiz=0x80a79e0, x=0, y=0, w=538, h=621) at ../../../src/display/idirectfbsurface.c:897
#4  0x08048c88 in draw_window2 () at ../../src/df_window_new.c:212
#5 0x080490de in main (argc=1, argv=0xbffffdc4) at ../../src/ df_window_new.c:366


I am using these versions:
directfb-0.9.24
directfb-examples-0.9.23


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

Reply via email to