【发布时间】:2013-10-29 20:03:36
【问题描述】:
我从来没有真正理解过指针/引用,但是在我写的代码中我得到一个错误提示
Invalid arguments '
Candidates are:
int SDL_UpperBlit(SDL_Surface *, SDL_Rect *, SDL_Surface *, SDL_Rect *)
'
我真的应该先了解指针,但有人可以帮助我吗?
void MapManager::draw(SDL_Surface *surface, SDL_Surface &mainSurface, int x, int y){
SDL_BlitSurface(surface, NULL, mainSurface, new SDL_Rect{x, y, 32, 32});
}
用作
draw(img_brickImage, *inDisplay, x * TILE_SIZE, y * TILE_SIZE);
显示:
SDL_Surface* display;
【问题讨论】:
标签: c++ c pointers sdl pass-by-reference