本文整理汇总了C++中Dot::getCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ Dot::getCamera方法的具体用法?C++ Dot::getCamera怎么用?C++ Dot::getCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dot
的用法示例。
在下文中一共展示了Dot::getCamera方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blit
bool bScreen::blit(Dot in)
{
SDL_Surface *temp = NULL;
SDL_Surface *nScreen = NULL;
SDL_Rect *player = new SDL_Rect;
SDL_Rect pos;
SDL_Rect offset;
SDL_Rect camera;
bool success = false;
camera = in.getCamera();
offset.x = 0;
offset.y = 0;
pos.x = (in.getx()) - (camera.x);
pos.y = (in.gety())- (camera.y);
temp = in.getPlayerImage(0);
player->x = 10 + ((in.phase/2)*PLAYERSPRITEW);
player->y = 3 + ((in.direction)*PLAYERSPRITEH);
player->w = 20;
player->h = 30;
SDL_BlitSurface(this->background, &camera, this->screen, &offset);
SDL_BlitSurface(temp , player, this->screen, &pos );
//rember to ask about possible memory leak here
// delete temp;
return success;
}