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

Author Topic: error C2661: 'sf::RenderTarget::draw' : no overloaded function t  (Read 1533 times)

0 Members and 1 Guest are viewing this topic.

aslo

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Hey guys,
this is my first time I write in forum i have the problem: if i always want to draw something there comes the error: 1>main.cpp(21): error C2661: 'sf::RenderTarget::draw' : no overloaded function takes 0 arguments

i know im a newbie with programing

#include <iostream>
#include <SFML\Graphics.hpp>




int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600, 32), "JaR", sf::Style::Titlebar);
        sf::Event mainEvent;
       
        sf::Texture texture;
       
        if (!texture.loadFromFile("nicogang.png"))
        { /*----*/ }


        while (window.isOpen())
        {
                while (window.pollEvent(mainEvent))
                {/*-----*/}
               
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
                {return 0;}

                window.clear();
                window.draw(texture);
                window.display();

        }

        return 0;
}

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: error C2661: 'sf::RenderTarget::draw' : no overloaded function t
« Reply #1 on: August 14, 2015, 11:12:58 pm »
You need to have sf::Sprite to draw a texture, have a look at the tutorials of SFML:
http://www.sfml-dev.org/tutorials/2.3/graphics-sprite.php


AlexAUT

 

anything