SFML community forums
Help => Window => Topic started by: vidjogamer on January 22, 2012, 05:03:56 am
-
Hi, I just started a new project and started with one of the tutorials as a base, except my window title isnt showing up correctly. Its showing as random characters. Any ideas?
Pic: https://legacy.sfmluploads.org/cache/pics/196_Capture.PNG
Code:
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
using namespace std;
int main()
{
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.PollEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
}
// Clear the screen (fill it with black color)
App.Clear();
// Display window contents on screen
App.Display();
}
return EXIT_SUCCESS;
}
-
I had a similar issue once. It was a while back but I'm pretty sure I had messed up my libs somewhere. Might have been debug/release in the wrong build for my project. Otherwise something was wrong with them and a rebuild fixed it.
-
I have this problem too. It has something to do with Debug vs Release. Make sure you linked Debug with your Debug build. I forget the tech reason why this happens. It's nothing to worry about to my knowledge.
-
Thanks I'll try that out. I thought if I linked Release libs it would run faster.
EDIT:
Ok, tried it. Ran it a few times to test, seems like it works. Does anyone know why that causes a problem under the hood? Am I also incorrect for thinking it would be faster to just use the release libs in debug mode?
-
I understand that the definitions of standard objects and functions (std::string, for example) are different in the debug libraries. So the string object expected in the release version of sfml is different from the one expected in the debug version. You were mixing the debug version of std::string with the release version of Window::Create, which expected the release version of std::string. I think that's what happened.
Long and short of it: you can't mix release and debug libs.