G
Guest
I’m developing script system based on C# script for a game engine.
Scripts are written in C# and compiled at run time by a C# class library.
The native C++ game code accesses the script compiler class library through
a COM interface. Compile scripts are passed back to the native C++ game code
as COM interfaces as well. To run a script the game calls
pScript->Run(pGameInterface). The pGameInterface is another COM object
written in C# that is used to pass context data to the scripts.
What I would really like to do is allow the scripts to call a method on the
game interface object and have that object either fire an event handled by
the C++ game code or call a function in the C++ game code (maybe using
connection points).
Pseudo code:
pGameInterface.CreateInstance(CLSID)
pGameInterface.SetCallback(&CallBackHandler)
pScript->Run(pGameInterface)
Two important requirements are that the C++ code not use ATL or managed C++.
Anyone have suggestions on what would be the best and simplest solution.
Scripts are written in C# and compiled at run time by a C# class library.
The native C++ game code accesses the script compiler class library through
a COM interface. Compile scripts are passed back to the native C++ game code
as COM interfaces as well. To run a script the game calls
pScript->Run(pGameInterface). The pGameInterface is another COM object
written in C# that is used to pass context data to the scripts.
What I would really like to do is allow the scripts to call a method on the
game interface object and have that object either fire an event handled by
the C++ game code or call a function in the C++ game code (maybe using
connection points).
Pseudo code:
pGameInterface.CreateInstance(CLSID)
pGameInterface.SetCallback(&CallBackHandler)
pScript->Run(pGameInterface)
Two important requirements are that the C++ code not use ATL or managed C++.
Anyone have suggestions on what would be the best and simplest solution.