Hello , all:

  Now , I'm learning IDirectFBSurface and have a question about 
TextureTriangles ,

  I want to map one texture to surface of layer  and the texture already 
load one picture.  But after use  TextureTriangles (), I can't see any image 
in the screen .

  I don't know how to use this fuction? Hope someone help me .

 The following is my code:
.......

/* the super interface */
static IDirectFB              *dfb;

/* the primary surface (surface of primary layer) */
static IDirectFBSurface       *primary;

/* The texture surface. */
static IDirectFBSurface       *texture;


int main()
{
   float left = 0.0f;
   float right = 256.0f;
   float top = 0.0f;
   float bottom = 256.0f;

   int indices[]={0, 1, 3, 1, 3, 2 };

   static DFBVertex vertices[] = {
       { left,  top,    0.5f, 1.0f, 0.0f, 0.0f }, // x, y, z, rhw, u, v
       { right, top,    0.5f, 1.0f, 1.0f, 0.0f },
       { right, bottom, 0.5f, 1.0f, 1.0f, 1.0f },
       { left,  top,    0.5f, 1.0f, 0.0f, 0.0f},
       { right, bottom, 0.5f, 1.0f, 1.0f, 1.0f },
       { left,  bottom, 0.5f, 1.0f, 0.0f, 1.0f },
  };
  ..................

  dfb->CreateSurface( dfb, &sdsc, &primary );

  dfb->CreateImageProvider( dfb, "texture.png",&pw );

  pw->GetSurfaceDescription (pw, &dsc);

  dfb->CreateSurface (dfb, &dsc, &texture);

  pw->RenderTo( pw, texture, NULL );

  pw->Release (pw);

  primary ->TextureTriangles(primary , texture, vertices,  indices, 6, 
DTTF_LIST );

  primary->Flip( myteprimary , NULL,DSFLIP_WAITFORSYNC );
}

 
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please 
immediately notify the sender by return e-mail, and delete the original message 
and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to