|
|
KBatch can accelerate blitting operations under directX.
By grouping all your blits ( from the same texture ) in one list , directX performs one "big" operation instead of several small ones.
Blitting commands are named the same as KGraphic. ( blitAlphaRect and blitAlphaRectFx are currently supported. ).
|
bool allocateBuffer( long quadCount )
|
Allocates the memory for a batching session.
quadCount represents the mamimum number of quads the buffer can hold.
If you fill more quads than the buffer can hold then it gets processed and new quads are appended again.
Example :
KBatch *mybatch ;
mybatch = KPTK::createKBatch( ) ;
myBatch->allocateBuffer( 500 ) ; // 500 quads in our buffer
myBatch->beginBatch( surf_image) ;. //attaches a surface to our batch
myBatch->blitAlphaRectFx(50,50,100,100,32,1,1) ; //adds a few blits
myBatch->endBatch( ) ; //flushes and draw
|
|
void beginBatch( KGraphic *surface )
|
Begins a batching session.
|
|
void endBatch( void )
|
Ends and flushes a batch.
|
|