
Untitled
By: a guest on
Apr 19th, 2012 | syntax:
None | size: 0.81 KB | hits: 12 | expires: Never
Array Allocation
SDL_Surface* sprites[];
void addNewSprite(SDL_Surface* sprite){
this->sprites[n_sprites+1] = new SDL_Surface;
this->sprites[n_sprites+1] = IMG_Load("spritepath.jpg");
this->n_sprites++;
}
SDL_Surface getSprite(int sprite_index){
return this->sprites[sprite_index];
}
Draw(x_position, y_position, this->sprite->getSprite[0], screen);
E:cGame.cpp|71|error: cannot convert `SDL_Surface' to `SDL_Surface*' for argument `1' to `int SDL_UpperBlit(SDL_Surface*, SDL_Rect*, SDL_Surface*, SDL_Rect*)'|
SDL_Surface* getSprite(int sprite_index){
return this->sprites[sprite_index];
}
this->sprites[n_sprites+1] = new SDL_Surface;
this->sprites[n_sprites+1] = IMG_Load("spritepath.jpg");
SDL_Surface getSprite(int sprite_index)
SDL_Surface* getSprite(int sprite_index)