3
I have a simple project on codeblocks (windows), I’m using the library SFML, when trying to call a method I created where I pass the window and any object, in the act of compiling I get the following error:
error: use of Deleted Function 'sf::Window::Window(const sf::Window&)'
I use the following includes:
#include <SFML/Graphics.hpp>
#include <iostream>
Function I created:
bool LimitaMovimento(sf::RenderWindow window,sf::Sprite img){
if(img.getPosition().x >= window.getPosition().x){
return false;
}else{
return true;
}
}
Her call in the method main
:
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) {
if(LimitaMovimento(window,img)){
img.move(-5,0);
}
cout << window.getPosition().x <<endl;
}
*Obs the object window has already been instantiated obviously, without the call of the LimitaMovimento
, works perfectly
It worked perfectly, thank you very much.
– Paiva83