[fpc-pascal] Moving callbackfunctions to class
dhkblaszyk at zeelandnet.nl
Thu Dec 30 17:34:40 CET 2010
GLut defines callback functions, one of them is the display function, which is defined as:
TGlutVoidCallback = procedure; cdecl;
This is set by calling glutDisplayFunc(@MyDisplayFunc);
As these functions are needed per window, I would like to encapsulate each window in a class something like:
TMyGLutWindow = class
procedure MyDisplayFunc; cdecl;
In the constructor I would like to set the displayfunction. But doing this I get the error:
Error: Incompatible types: got "<procedure variable type of procedure of object;CDecl>" expected "<procedure variable type of procedure;CDecl>"
Though I understand the error, I do not know if there is a way to circumvent this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal