I'd like to wrap (Facade Pattern
) Allegro's use of threads i.e. install_int_ex(void (__cdecl*)(void), int tick);
and remove_int(void (__cdecl*)(void))
with a class I wrote that uses templates and user-defined Functor Objects
to install interrupts and remove interrupts when the class is created and destroyed.
I keep getting compiler errors: error C2664: 'install_int_ex' : cannot convert parameter 1 from 'void (__thiscall [User-defined FunctorName Here]::* )(void)' to 'void (__cdecl *)(void)'
and similar for remove_int(void (__cdecl*)(void))
This seems to work provided the called function accepts pointers to void*
user data
Unfortunately, Allegro is not this flexible. Is there a way around this limitation or am I going to have to use Windows's CreateThread
(and learn threading "the real way" in the process)?
See Also: Using a C++ Member Function as the Thread's Entry-Point-Function