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

Author Topic: window is not a member of sf::Window  (Read 2127 times)

0 Members and 1 Guest are viewing this topic.

YouAgain

  • Newbie
  • *
  • Posts: 1
    • View Profile
window is not a member of sf::Window
« on: January 26, 2015, 05:22:59 am »
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Main.hpp>
#include <SFML/System.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Network.hpp>
#include "character.h"
#include "Voids.h"
int main()
{   
   //Window definitions
   sf::Window window(sf::VideoMode(800, 600), "My window");
   window.setPosition(sf::Vector2i(10, 50));
   window.setSize(sf::Vector2u(640, 480));
   window.setTitle("SFML window");
   sf::Style::None;
   sf::Style::Titlebar;
   sf::Style::Resize;
   sf::Style::Close;
   sf::Style::Fullscreen;
   sf::Style::Default;
   //Window definitions

   //textures
   sf::Texture warrior;
   if (!warrior.loadFromFile("download.png"))
   {
      //error
   }
   sf::Texture rouge;

   sf::Texture mage;

   sf::Texture archer;
   //textures

   //sprites
   sf::Sprite warrior1;
   warrior1.setTexture(warrior);
   sf::Sprite rouge1;

   sf::Sprite mage1;

   sf::Sprite archer1;
   //sprites


   //Framerate
   window.setFramerateLimit(60);
   //Framerate

   //While window open
   while (window.isOpen()){

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

         if (event.type == sf::Event::Closed)
            window.close();
      }
      //Close window function

      window.

      //
      window.display();

   }
   //While the window is open

   return 0;
}




And yea thats my problem I don't really get why its popping up since I included everything there is to include and window does have some functions like "Window.display()"

Please help

victorlevasseur

  • Full Member
  • ***
  • Posts: 206
    • View Profile
Re: window is not a member of sf::Window
« Reply #1 on: January 26, 2015, 07:28:40 am »
Hi,

It's sf::RenderWindow, not sf::Window.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: window is not a member of sf::Window
« Reply #2 on: January 26, 2015, 07:48:06 am »
Double-clicking the error messahe should get you there:

window.

      //
      window.display();

... which is obvious enough I think ;)
Laurent Gomila - SFML developer

 

anything