Jump to content
  • Advertisement
Sign in to follow this  
Evan Gordon

Basic SFML problem, graphics

This topic is 1671 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#include <SFML/Window.hpp>
#include <iostream>

using namespace std;

int main()
{
	sf::RenderWindow window;

	window.create(sf::VideoMode(800, 600), "Myne");

	while (window.isOpen())
	{

		sf::Event event;
		while (window.pollEvent(event))
		{

			if (event.type == sf::Event::Closed)
			{
				window.close();
			}

			window.clear(sf::Color::Black);


			window.display();
		}


	} 

ok so im going through the tutorials for SFML on visual studios for windows, trying to figure stuff out as i go. i did the test program, worked. i also did the first window tutorial program, also worked. im tinkering with the graphics stuff, so i can put something simple in my window. but im getting an error 'RenderWindow' is not a member of sf. any help would be appreciated!
 
here's my code, ive googled this and cant really find any answers that work

Share this post


Link to post
Share on other sites
Advertisement

As a side note, you should not be clearing and displaying the window inside the while-loop that you are using to poll events. You should only clear and display once per frame.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!