31
Graphics / How do I display a variable?
« on: June 28, 2011, 09:01:59 pm »
Sorry, my mistake. How embarassing - I linked to the documentation and I hadn't even read it properly :oops:
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
sf::Window::Close()
, sf::Window::IsOpened()
will stop returning true
and execution will leave your loop naturally.
std::ostringstream oss;
// etc
oss.str("");
changing str() to string()
The program can't start because sfml-system.dll is missing from your computer. Try reinstalling the program to fix this problem.
#include <SFML/Graphics.hpp>
int main()
{
sf::Text text("Hobo!");
sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Hello World!");
while (Window.IsOpened())
{
sf::Event Event;
while (Window.PollEvent(Event))
{
switch (Event.Type)
{
case sf::Event::Closed:
Window.Close();
break;
default:
break;
}
}
Window.Clear();
Window.Draw(text);
Window.Display();
}
return 0;
}
Also a small c++ question, I thought this :
Code:
sf::RenderWindow &GetWindow() {return RenderWindow;}
Would give a reference of the window and that I had to access its members with -> but it seems I have to do
I hadn't really thought about it. Would there be any point?
.zip is just the most common
Unicode filenames