[SDL] SDL_CreateThread

Kylotan kylotan at kylotan.eidosnet.co.uk
Tue Jul 16 18:23:01 PDT 2002


nick at emilive.com wrote:
> I have been perusing the libsdl.org documentation regarding
> SDL_CreateThread. The way I understand it, the only way to call a
> member function of a class with SDL_CreateThread is to create a
> global wrapper function.

> This would require a bunch of global functions that I would rather not
> pollute my code with.

Well, they could be global, or they could be declared as static normal
functions (giving them just file scope rather than local scope), or you
could put them in an unnamed namespace (again, giving them file scope),
or you could make them into static member functions. I would choose one
of the last two. I am unsure why you think that making a function a
static member could be a problem - it is essentially the same as a
global function except it gains access to any typedefs or sub-classes
inside that class and you have more control over which other functions
can call it.

--
Kylotan





More information about the SDL mailing list