I'm making a multiplayer game right now, and everything is running smoothly, except one thing. I have everyone in a vector with my Player class, and one of the things is a name. I want the name to be displayed above the player, (which is right now just a green square, for testing purposes.) but it's not working. After some testing, I see what is happening. OpenGL is rendering the squares correctly, but the letters that are supposed to be there, are changing into green squares the size of the letters.. It seems like OpenGL and SFML are having conflicts on my screen. The actual drawing part of my game, minus the OpenGL stuff is here:
for(unsigned int a = 0; a < players.size(); a++){
sf::Text Name;
Name.SetString(players.at(a).getName());
Name.SetColor(sf::Color::Black);
Name.SetCharacterSize(14);
Name.SetPosition(players.at(a).getX(), players.at(a).getY() - 20);
Window->Draw(Name);
}
Window->Display();
(Notice that when I actually get rid of the Name.SetColor(sf::Color::Black) part, it changes it to green, but when I put that there, it changes the green square, and the text, to black.
EDIT:Let me also clarify that when I get rid of the Window->Draw(Name) part, it also makes my game look normal. The drawing method is doing weird things to the game..