You have the right way to make a pointer to a function in a struct
(so thatβs enough for this, so many people are wrong).
However, you swapped drawFunc
and *
in the definition of your function, which is one of the reasons the compiler complains. Another reason is that you have the same identifier, which is used as a type and a variable. You have to choose different identifiers for two different things.
Use this instead:
void glesRegisterDrawFunction(glesContext *cntxt, void(*drawFunc)(glesContext*)); ^^^^^^^^^ note here
source share