The sense is that I have different, drawable classes/object - for
example a simple texture (not clickable) and a button (clickable).
When the user clicks the mouse, the obj-param which is defined by
using draw!(T = void*)(uint zPos, T obj = null) will be saved in a
template-struct which should have the type of obj -> struct myStruct
(T). The advantage is, that I can use the obj referenced in the
struct without any casting.

I just solved the problem by declaring draw() as final-function and
used a new value as callback in the final draw()-function - for
example:

...
private void delegate() drawCallback;

public final void draw(T = void*)(uint zPos, T obj = null) {

        drawCallback();

        // ... do additional work
}

Reply via email to