Hi

Thanks for all of the help on the windowing problem.  I now have that working 
but I have to go onto the next stage that is a little involved.  I am creating 
a window.  All the information that has to do with the window is stored in a 
structure like so.

typedef struct view {
        int state;                    /* state of view                          
*/
        int flags;                    /* properties of the view                 
*/
        int x, y, w, h;               /* view position and size on screen       
*/
        unsigned long token;          /* private token of the application       
*/
        char label[MAX_LABEL];        /* label string (client-defined label)    
*/
        char *client_name;            /* name of client (trusted label)         
*/
        int lx, ly, lw, lh;           /* position and size of label             
*/
        struct buffer *buf;           /* buffer that is visible within the view 
*/
        int buf_x, buf_y;             /* offset to the visible buffer area      
*/
        struct view *share_next;      /* next view of the same buffer           
*/
        struct view *next;            /* next view in ordered stacking list     
*/
        CORBA_Object_base listener;   /* receiver of events for this view       
*/
        nitpicker owner;              /* associated client id                   
*/
        IDirectFBWindow   *vwindow;   /* window associated with this particular 
*/
        DFBWindowDescription  wdesc;   /* This window will have a surface for 
graphics*/
        IDirectFBSurface  *vsurface;
        DFBSurfaceDescription sdesc;
        DFBDataBufferDescription  ddsc;
        IDirectFBDataBuffer      *buffer;
        IDirectFBImageProvider *image_provider;


} view;

There are several calls to CORBA for inter process/client communication.

What I want do do is map the data stream from a client to the window I have 
created as an image.  

The graphics are initialized as:

  DirectFBCreate (&dfb);// Create the frame buffer interface
  dfb->GetDeviceDescription( dfb, &gdesc );  //Get the discription of the 
graphics device
  dfb->GetDisplayLayer( dfb, DLID_PRIMARY, &dl ); // grab the interface to the 
screen primary display layer
  dl->SetCooperativeLevel( dl, DLSCL_ADMINISTRATIVE );

     if (!((gdesc.blitting_flags & DSBLIT_BLEND_ALPHACHANNEL) &&
           (gdesc.blitting_flags & DSBLIT_BLEND_COLORALPHA  )))
     {
          dl_config.flags = DLCONF_BUFFERMODE | DLCONF_PIXELFORMAT;
          dl_config.buffermode = DLBM_BACKSYSTEM;
          dl_config.pixelformat = DSPF_RGB32;

          dl->SetConfiguration( dl, &dl_config );
     }

   dl->GetConfiguration( dl, &dl_config );

This is part of the routine that sets up the window.

        v->sdesc.width = w;
        v->sdesc.height = h;
        v->wdesc.posx   = x;
        v->wdesc.posy   = y;
        v->wdesc.width  = w;
        v->wdesc.height = h;
        dl->CreateWindow(dl, &v->wdesc, &v->vwindow); //Create a window for 
each view
        //      dl->SetBackgroundImage( dl, bgsurface );
        //dl->SetBackgroundMode( dl, DLBM_IMAGE );

        v->vwindow->GetSurface( v->vwindow,  &v->vsurface);
        v->vwindow->SetOpacity(v->vwindow, 0x00 );
        //v->vwindow->CreateEventBuffer( v->vwindow, &dfbbuffer );

        //Need to fix draw rectangle call
        //draw_frame(v);

        /* update affected views */
        draw_rec(first_view, NULL, do_redraw ? NULL : v->buf, x1, y1, x2, y2);
        v->vwindow->SetOpacity(v->vwindow, 0xFF );

Finally I try and attach the data buffer.

void attach_data(view *cv,buffer *exc){



     cv->ddsc.flags         = DBDESC_MEMORY;
     cv->ddsc.memory.data   = &exc->data;
     cv->ddsc.memory.length = cv->sdesc.width * (cv->sdesc.height - BORDER) * 
4; //hard set for 32 bit

     dfb->CreateDataBuffer( dfb, &cv->ddsc, &cv->buffer );
     cv->buffer->CreateImageProvider( cv->buffer, cv->image_provider );
     //cv->image_provider->RenderTo(cv->image_provider,cv->vsurface,NULL);  


}

The line causes the program to crash.   Any ideas?

Thanks in advance.

--
If you think dogs can't count, try putting three dog biscuits in your pocket 
and then give him only two of them.
**-Phil Pastoret** 

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

Reply via email to