Frontend and backend communication

Dainius (GreatEmerald) pastas4 at gmail.com
Wed Aug 10 01:35:46 PDT 2011


I seem to have run into a problem with the function pointer method
here. I have this code:

arco.d:

    struct FrontendFunctions {
        void function(SoundTypes) Sound_Play;
        void function() RedrawScreenFull;
        void function(const char*, int) PrecacheCard;
        void function(CardInfo, int) PlayCardAnimation;
    }

cards.d:

    void InitLuaFunctions()
    {
        lua["Damage"] = (int Who, int Amount)
        {
            FrontendFunctions.Sound_Play(SoundTypes.Damage);
        };
    }

Essentially I am trying to get Lua (via LuaD) to call a function in D
that calls a frontend function. But when I compile the code, I get
this: "cards.d(5): Error: 'this' is only defined in non-static member
functions, not __dgliteral14". Why is this and what can I do about it?


More information about the Digitalmars-d-learn mailing list