Jump to content

  • Log In with Google      Sign In   
  • Create Account


Visual studio 2010 with sfml 2.0 problem with Window Title


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 BaneTrapper   Members   -  Reputation: 1149

Like
0Likes
Like

Posted 02 October 2012 - 02:05 PM

Hello.
I just downloaded visual studio 2010, so i am kind of new to it.
There is a test program to check if its just working.
But the title of the window is all wrong, and each run gives different resault,
i got these results from 3 runs of the program ("En", "E{", "E3") as the name of the window

Any ideas what i did wrong, cause i redone all linking and stuff, still getting error/title name being wrong.

EDIT:: i did download SFML 2.0 for visual studio 2010

#include <SFML/Graphics.hpp>
int main()
{
	sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
	sf::CircleShape shape(100.f);
	shape.setFillColor(sf::Color::Green);
	while (window.isOpen())
	{
		sf::Event event;
		while (window.pollEvent(event))
		{
			if (event.type == sf::Event::Closed)
				window.close();
		}
		window.clear();
		window.draw(shape);
		window.display();
	}
	return 0;
}

Edited by BaneTrapper, 02 October 2012 - 02:09 PM.

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/


Sponsor:

#2 Sooker   Members   -  Reputation: 299

Like
2Likes
Like

Posted 02 October 2012 - 02:20 PM

The Source code looks fine and it shouldn´t be a character encoding issue (Is Unicode implemented in SFML?)

Do you see the Circle?
Any compiler warnings?

Did you try sf::Window::SetTitle() ?

Edited by Sooker, 02 October 2012 - 02:21 PM.


#3 lride   Members   -  Reputation: 633

Like
2Likes
Like

Posted 02 October 2012 - 02:58 PM

I' once had the exact same problem. The chance is that you are linking against release library when you are actually debugging.

Visit below link

http://en.sfml-dev.o...g60228#msg60228

Edited by lride, 02 October 2012 - 05:29 PM.

An invisible text.

#4 BaneTrapper   Members   -  Reputation: 1149

Like
0Likes
Like

Posted 02 October 2012 - 11:19 PM

The Source code looks fine and it shouldn´t be a character encoding issue (Is Unicode implemented in SFML?)


Did you try sf::Window::SetTitle() ?

I just got another incorrect name

Do you see the Circle?

Yes, even when i rescale and stuff, the displayed is correct.

Any compiler warnings?

I don't think there is error anywhere
1>------ Build started: Project: Adventure, Configuration: Debug Win32 ------
1>  main.cpp
1>  Adventure.vcxproj -> C:\C++ Visual projects\Adventure\Debug\Adventure.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

This is the output after program was closed, its called "Adventure" aniway
The thread 'Win32 Thread' (0x870) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xb2c) has exited with code 0 (0x0).
The program '[1904] Adventure.exe: Native' has exited with code 0 (0x0).

Edited by BaneTrapper, 02 October 2012 - 11:20 PM.

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/


#5 BaneTrapper   Members   -  Reputation: 1149

Like
0Likes
Like

Posted 02 October 2012 - 11:22 PM

I' once had the exact same problem. The chance is that you are linking against release library when you are actually debugging.

Visit below link

http://en.sfml-dev.o...g60228#msg60228

I believe this would do it, but am going to work atm, Thx for help.

EDIT:: SFML WORKS!
Name is fixed, my error was:
while at Project properties, Linker, Input, Aditional dependecies, i did it like this
sfml-window.lib
while debug needs to be
sfml-window-d.lib

Thanks for the help!

Edited by BaneTrapper, 03 October 2012 - 08:24 AM.

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS