Есть такой класс:
// maingame.cpp
class MainGame
{
private:
sf::RenderWindow* window;
void logicalThread();
void drawThread();
void run();
}
// maingame.h
MainGame::MainGame(sf::RenderWindow *window)
{
this->window = window;
}
void MainGame::drawThread()
{
while (window->isOpen())
{
window->clear();
window->display();
}
}
void MainGame::logicalThread()
{
while (window->isOpen())
{
///////////////////////
}
}
void MainGame::run()
{
sf::Thread thread1(&logicalThread);
thread1.launch();
sf::Thread thread2(&drawThread);
thread2.launch();
}
При компиляции, я получаю такую ошибку:
C:\Qt\Tools\mingw530_32\i686-w64-mingw32\include\c++\SFML\System\Thread.inl:39: error: must use '.*' or '->*' to call pointer-to-member function in '((sf::priv::ThreadFunctor*)this)->sf::priv::ThreadFunctor::m_functor (...)', e.g. '(... ->* ((sf::priv::ThreadFunctor*)this)->sf::priv::ThreadFunctor::m_functor) (...)'
virtual void run() {m_functor();}
^