<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Hi,</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">GLut defines callback functions, one of them is the display function, which is defined as:</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">TGlutVoidCallback = procedure; cdecl;</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">This is set by calling glutDisplayFunc(@MyDisplayFunc);</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> </span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">As these functions are needed per window, I would like to encapsulate each window in a class something like:</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">TMyGLutWindow = class</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> private</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> procedure MyDisplayFunc; cdecl;</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> public</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "> constructor Create;</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">end;</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">In the constructor I would like to set the displayfunction. But doing this I get the error:</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Error: Incompatible types: got "<procedure variable type of procedure of object;CDecl>" expected "<procedure variable type of procedure;CDecl>"</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Though I understand the error, I do not know if there is a way to circumvent this?</span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; "><br></span><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 13px; ">Regards, Darius</span></body></html>