so eventually im going to get drawing a lot of sprites at once for example: the environment that the player will be in: the trees, the grass, flowers, etc etc. tilesets in general.
so I thought of going about that through making an std::vector dedicated for holding only sprites and during the main loop there will be a for loop weeding out the sprites and drawing them. But I can't seem to get it to work!
Here's what I've got so far.
defined the vector early on around where i declare the window
std::vector<sf::Sprite> object_list;
then in my main loop its going to call this void im currently working on under a class called Physics which was also declared earlier "myWindow" being the window name.
gamePhysics.draw_objects(&myWindow,&object_list);
and finally the void function itself
void draw_objects(sf::RenderWindow *gameWindow,std::vector<sf::Sprite> *objects){
for(int i = 0;objects->size();i++){
&gameWindow->draw(&objects[i]);
}
};
which keeps throwing this error at me
include\physics.h|19|error: no matching function for call to 'sf::RenderWindow::draw(std::vector<sf::Sprite>*)'|
highlighting this line
&gameWindow->draw(&objects[i]);
and yes im a little knew to C++ programming but on it here and there trying my best lately.
any suggestions would be greatly appreciated!