本文整理汇总了C++中Render::drawAtlas方法的典型用法代码示例。如果您正苦于以下问题:C++ Render::drawAtlas方法的具体用法?C++ Render::drawAtlas怎么用?C++ Render::drawAtlas使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Render
的用法示例。
在下文中一共展示了Render::drawAtlas方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
/*! jesli widoczny to go narysuje
*/
void SpriteCmp::draw( Entity e , const ShapeDef& shapeDef)
{
SpriteInfo * spriteInfo = 0;
if(e.getId() == 0)
{
spriteInfo = &untexturedSprite;
}else{
spriteInfo = BaseType::get( e );
if( ! spriteInfo ) return;
}
Render * r = game->getRender();
if( spriteInfo->visible )
{
Vec2Quad shape;
translateQuad( shapeDef.rect, shapeDef.pos, &shape );
if(shapeDef.angle)
rotateQuad(shape,shapeDef.angle,shapeDef.pos,&shape);
r->drawAtlas( spriteInfo->tex,
spriteInfo->textureNumber, shape,
Render::CoordSpace_e( spriteInfo->coordSpace ),
spriteInfo->color,
shapeDef.depth );
}
}
示例2: drawAll
/*! rysuje tylko widoczne
*/
void SpriteCmp::drawAll()
{
Render * r = game->getRender();
ShapeCmp * shapeCmp = game->getShapeCmp();
FOR_ALL( records, it ) {
SpriteInfo * scd = *it;
ShapeDef * shapeDef = shapeCmp->getSure( scd->shape );
if( scd->visible ) {
Vec2Quad shape;
//rotateQuad(shapeDef->rect,shapeDef->angle,shapeDef->pos,&shape );
//translateQuad( shape, shapeDef->pos, &shape );
translateQuad( shapeDef->rect, shapeDef->pos, &shape );
if(shapeDef->angle)
rotateQuad(shape,shapeDef->angle,shapeDef->pos,&shape);
r->drawAtlas( scd->tex, scd->textureNumber, shape,
Render::CoordSpace_e( scd->coordSpace ), scd->color,
shapeDef->depth );
}
}//koniec for(records)