« on: August 06, 2015, 03:59:48 pm »
What I'm using: VS2013, SFML2.3
I'm learning the basics off of the website. and for some reason window.clear() method does not exists?
Is this because the tutorial is out of date?
CODE:
#include <SFML/Graphics.hpp>
#include <iostream>
int main()
{
sf::Window window(sf::VideoMode(800, 600), "Your my Daddy!");
std::cout << "Window Created" << std::endl;
// run the program as long as the window is open
std::cout << "Waiting for events..." << std::endl;
while (window.isOpen())
{
// check all the window's events that were triggered since the last iteration of the loop
sf::Event event;
while (window.pollEvent(event))
{
//Event List
switch (event.type)
{
// window closed
case sf::Event::Closed:
window.close();
break;
// key pressed
case sf::Event::KeyPressed: 'W';
std::cout << "Key: W Pressed." << std::endl;
break;
// we don't process other types of events
default:
break;
}
}
// draw everything here...
// window.draw(...);
window.clear();
sf::RectangleShape rectangle(sf::Vector2f(50, 50));
// end the current frame
window.display();
}
return 0;
« Last Edit: August 11, 2015, 04:20:21 pm by Sanction »
Logged
Knowledge comes, but wisdom lingers. It may not be difficult to store up in the mind a vast quantity of facts within a comparatively short time, but the ability to form judgments requires the severe discipline of hard work and the tempering heat of experience and maturity.