SFML community forums
Help => System => Topic started by: Richy19 on December 10, 2011, 06:04:15 pm
-
Im trying to integrate a thread into the image loading class, but im getting errors
using this code
class TextureResourceManager
{void LoadFiles();
sf::Thread imgThread;
};
TextureResourceManager::TextureResourceManager():
imgThread(&TextureResourceManager::LoadFiles)
{
}
gives me:
||=== Agame, Debug ===|
/usr/local/include/SFML/System/Thread.inl||In member function ‘void sf::priv::ThreadFunctor<T>::Run() [with T = void (TextureResourceManager::*)()]’:|
/home/richy/codeblocks/Agame/src/TextureResourceManager.cpp:73|1|instantiated from here|
/usr/local/include/SFML/System/Thread.inl|39|error: must use ‘.*’ or ‘->*’ to call pointer-to-member function in ‘((sf::priv::ThreadFunctor<void (TextureResourceManager::*)()>*)this)->sf::priv::ThreadFunctor<void (TextureResourceManager::*)()>::myFunctor (...)’, e.g. ‘(... ->* ((sf::priv::ThreadFunctor<void (TextureResourceManager::*)()>*)this)->sf::priv::ThreadFunctor<void (TextureResourceManager::*)()>::myFunctor) (...)’|
||=== Build finished: 1 errors, 0 warnings ===|
-
you also have to supply the this pointer to the thread object.
-
Read the doc!! :evil:
-
You broke Laurent. Good job.
-
You broke Laurent. Good job
You fixed me, thanks :lol: