Ejemplo n.º 1
0
// this function blits the given buffer using our blit type method
inline void BlitBuffer(PtWidget_t *win,CoolImage *i)
{
	// For blit type 0, we use PgDrawImagemx(). We have to make sure 
	// to set the region to the windows region first.  Don't forget
	// to flush! :)
	if (blittype==0 || blittype==1)
	{
		PhPoint_t pos={0,0};
		PhDim_t size;
		
		//size.w = 768;
		size.w = m_W;
		size.h = m_H;
		//size.h = 576;

		PgSetRegion(PtWidgetRid(win)); 
		//PgDrawImagemx(i->buffer,Pg_IMAGE_DIRECT_565,&pos,&size,i->pitch,0);
		PgDrawImagemx(i->buffer,Pg_IMAGE_DIRECT_888,&pos,&size,i->pitch,0);

		PgFlush();
	}else
    if (blittype == 2)
	{
		PhRect_t r={{0,0},{i->width,i->height}};
		PgSetRegion(PtWidgetRid(win));
		PgContextBlit(i->ctx,&r,NULL,&r);
		PgFlush();
	}

}
Ejemplo n.º 2
0
void MGLAPI PH_putImage(MGLDC *dc,int left,int top,int right,
    int bottom,int dstLeft,int dstTop,int op,void *surface,
    int bytesPerLine,MGLDC *src)
/****************************************************************************
*
* Function:     PH_putImage
* Parameters:   dc      - Device context
*
* Description:  Blt's a system memory buffer DC of the same pixel depth
*       as the display device context to the display DC.
*
****************************************************************************/
{
    PhPoint_t   pos, size;

    pos.x = dstLeft;
    pos.y = dstTop;
    size.x = right - left;
    size.y = bottom - top;

    PgDrawImagemx(_MGL_pixelAddr2(surface, left, top,
        bytesPerLine, src->mi.bitsPerPixel),
        dc->wm.bitfmt, &pos, &size, bytesPerLine, 0);
}