I happened to encounter an unusual thing. I made a Breakout clone, and I wanted to make another game, using the same screens, and changing Texts, etc.
Before I had 3 sf::text and now I want only one. So I erased one(erase all the code concerning that sf::text), and everything works, but when I want to erase the other one it crashes as soon as it loads it. Also, it crashes only on Release mode, so I can't use watches, breakpoints, etc.
This is the error that gives me "Process terminated with status -1073741676", apparently it is a division by 0 error.
Strangely enough, I can remove everything but the .setString() line. Everything else I can remove it and it works, even the window.draw(_textoSetCentradoTitulo) line. (code below)
any ideas?
MenuSeleccion.h
class MenuSeleccion : public GameState{
private:
Text _textoPrimerosPasos;
Text _textoSetCentradoTitulo;
public:
MenuSeleccion();
void eventosYMuevo();
void update();
void render();
};
menuSeleccion.cpp
MenuSeleccion::MenuSeleccion(){
_textoPrimerosPasos.setString("Primeros Pasos:");
_textoPrimerosPasos.setCharacterSize (pantalla_alto * 7 / 120);
_textoPrimerosPasos.setColor(myColor);
_textoPrimerosPasos.setPosition(pantalla_alto * 2 / 15, pantalla_alto / 6);
_textoPrimerosPasos.setFont(myFont);
_textoSetCentradoTitulo.setString("Set Centrado:"); ///I can remove everything but this line
//_textoSetCentradoTitulo.setCharacterSize (pantalla_alto * 7 / 120);
//_textoSetCentradoTitulo.setColor(myColor);
//_textoSetCentradoTitulo.setPosition(pantalla_alto * 2 / 15, pantalla_alto * 17 / 30);
// _textoSetCentradoTitulo.setFont(myFont);
}
...