Answer the question
In order to leave comments, you need to log in
How to create an sfml stream?
There is such a class:
// maingame.cpp
class MainGame
{
private:
sf::RenderWindow* window;
void logicalThread();
void drawThread();
void run();
}
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 (...)', eg '(... ->* ((sf::priv ::ThreadFunctor*)this)->sf::priv::ThreadFunctor::m_functor) (...)'
virtual void run() {m_functor();}
^
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question