Niezdefiniowany identyfikator / identyfikatora nie odnaleziono

0

Tak jak w temacie, otrzymuję error w main.cpp "error C3861: "popButton": identyfikatora nie odnaleziono"


//CSButton.h

#pragma once
#include "Object.h"
#include "Helper.h"


class CSButton :
	public Object
{
public:
	CSButton(std::string filename, float x, float y);
	CSButton() = delete;
	~CSButton() = default;
	void popButton(sf::RenderWindow window, CSButton &button1, CSButton &button2, CRed &red, CBlue &blue1, CBlue &blue2, CBlue &blue3);
};

//CSButton.cpp

#include "CSButton.h"



CSButton::CSButton(std::string filename, float x, float y)
{
	texture.loadFromFile(filename);
	sprite.setTexture(texture);
	sprite.setPosition(x, y);
}

void CSButton::popButton(sf::RenderWindow window, CSButton &button1, CSButton &button2, CRed &red, CBlue &blue1, CBlue &blue2, CBlue &blue3)
{
	if (red.colliding == true)
	{
		window.draw(button1);
		if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
		{
			red.colliding = false;
			blue1.colliding = false;
			blue2.colliding = false;
			blue3.colliding = false;
		}
	}
	else if (blue1.colliding == true && blue2.colliding == true && blue3.colliding == true)
	{
		window.draw(button2);
		if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space))
		{
			red.colliding = false;
			blue1.colliding = false;
			blue2.colliding = false;
			blue3.colliding = false;
		}
	}

}

//main.cpp

//przed pętlą główną stworzenie objektów
	CSButton button1("Images/ButtonLose.png", 600, 300);
	CSButton button2("Images/ButtonWin.png", 600, 300);

// potem w pętli, gdzie otrzymuję błąd

popButton(window, button1, button2, red, blue1, blue2, blue3);

Szukałem błędu, ale nie mam już pojęcia gdzie dałem ciała :X

1

popButton jest funkcja w klasie, a Ty próbujesz ja wołać jak zwykła funkcje. Chcesz chyba zrobić button1.popButton czy też button2.popButton.

0

Cholera oczywiście, chwilowy zastój umysłowy :X
Bardzo dziękuję

1 użytkowników online, w tym zalogowanych: 0, gości: 1