A simple function pointer question...
-
Hi I'm havinh real trouble using this one OpenGL function I'm trying to import into my app. The C function is declared as this:- void gluTessCallback(GLUtesselator* obj, GLenum type, void(*fn)()); I know that GLUtesselator* is basically just an IntPtr, as I've imported other functions with it in, and they've worked fine. Similarly, GLenum is just a UInt. But what do I do with the void function pointer? I have declared delegates for all of the possible function types it could be, (depending on the 'type' variable), but I don't know where to go from there. MSDN only has info for function pointers that are always a set type, but with this function, the pointer can be to a number of different types of function. Please help me out here! Thanks in advance Dave Dave Kerr focus_business@hotmail.com www.focus.esmartweb.com
-
Hi I'm havinh real trouble using this one OpenGL function I'm trying to import into my app. The C function is declared as this:- void gluTessCallback(GLUtesselator* obj, GLenum type, void(*fn)()); I know that GLUtesselator* is basically just an IntPtr, as I've imported other functions with it in, and they've worked fine. Similarly, GLenum is just a UInt. But what do I do with the void function pointer? I have declared delegates for all of the possible function types it could be, (depending on the 'type' variable), but I don't know where to go from there. MSDN only has info for function pointers that are always a set type, but with this function, the pointer can be to a number of different types of function. Please help me out here! Thanks in advance Dave Dave Kerr focus_business@hotmail.com www.focus.esmartweb.com
Dave Kerr wrote: declared as this:- void gluTessCallback(GLUtesselator* obj, GLenum type, void(*fn)()); .... I don't know where to go from there. Is C# really that much different from C++??
//declaring three variables GLUtesselator* gPtr =...; GLenum gType =...; void(* gFuncPtr )(void); gFuncPtr = ...; // call the function gluTessCallback(gPtr, gType, gFuncPtr);
wont compile under C#?? -
Hi I'm havinh real trouble using this one OpenGL function I'm trying to import into my app. The C function is declared as this:- void gluTessCallback(GLUtesselator* obj, GLenum type, void(*fn)()); I know that GLUtesselator* is basically just an IntPtr, as I've imported other functions with it in, and they've worked fine. Similarly, GLenum is just a UInt. But what do I do with the void function pointer? I have declared delegates for all of the possible function types it could be, (depending on the 'type' variable), but I don't know where to go from there. MSDN only has info for function pointers that are always a set type, but with this function, the pointer can be to a number of different types of function. Please help me out here! Thanks in advance Dave Dave Kerr focus_business@hotmail.com www.focus.esmartweb.com