I need to create a public function that runs through an array of sprites and draws them if they are not null, however if you create an array of sprites I have no clue what null is. So I figured I'll just make a blank sprite, name it null, populate the array with that, and use it as null. However when I try to compare the value in a point of the array to (well anything really, but in this case) the null sprite, it tells me "no match for 'operator==' (operand types are 'sf::Sprite' and 'sf::Sprite')" which I assume means that because I'm not comparing a typical data type the operators mean nadda.
This is my code so far, it's at the top of the page(after all the #include's)
sf::Texture img_null;
sf::Sprite spr_null(img_null);
sf::Sprite draw_cue[35][25] = {spr_null};
void draw_sprites(){
if(draw_cue[1][1]==spr_null){
cout<<"null"<<endl;
}
for(i=0;i<875;i++){
}
}
If you didn't already guess, I'm making a game where the sprites will overlap, and I would like those with a lower y value to be drawn first, so that those that are closer to the "camera" will be drawn over those "farther away". I tried googling how to do this, but the only thing I found was a lot of people asking for a z axis to be implemented in sfml, and others responding that that would be inefficient and to do this instead. Problem is, everyone's so quick to tell people off but nobody actually wants to actually help or give any idea how to do it.