Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Funny Window Titles  (Read 3946 times)

0 Members and 1 Guest are viewing this topic.

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Funny Window Titles
« 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:
Code: [Select]


#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;
}

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
Funny Window Titles
« Reply #1 on: January 22, 2012, 06:37:46 am »
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.

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Funny Window Titles
« Reply #2 on: January 22, 2012, 10:29:07 am »
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.
CoderZilla - Everything Programming

vidjogamer

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Funny Window Titles
« Reply #3 on: January 22, 2012, 08:15:28 pm »
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?

JayArby

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Funny Window Titles
« Reply #4 on: January 23, 2012, 03:54:42 am »
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.