czesc, chcialem zrobic 16 pokoi ktore maja wlasne id i przy rysowaniu kazde z tych id zostaje narysowane, ale tutaj mi wyrzuca blad
Exception thrown at 0x79F949EF (sfml-graphics-d-2.dll) in program.exe: 0xC0000005: Access violation reading location
//klasa board
void Board::draw(RenderWindow& window){
for (Room temp : board) {
window.draw(temp);
window.draw(temp.getText()); //tu wywala blad
}
}
//klasa room
Text Room::getText() { //funkcja getText
return text;
}
Room::Room(int x, int y){ //konstruktor
setSize(Vector2f(100, 50));
setPosition(x, y);
font.loadFromFile("D:fonts/Pulang.ttf");
text.setFont(font);
text.setCharacterSize(30);
text.setString(std::to_string(getId()));
text.setPosition(x + 50, y + 25);
}
jak cos to moge caly kod pokazac