parent
daefc2567b
commit
e55f5d1fd4
10 changed files with 58 additions and 11 deletions
|
|
@ -1,22 +0,0 @@
|
|||
discard """
|
||||
cmd: "nim cpp $file"
|
||||
"""
|
||||
|
||||
{.emit: """
|
||||
|
||||
namespace System {
|
||||
struct Input {};
|
||||
}
|
||||
|
||||
struct SystemManager {
|
||||
template <class T>
|
||||
static T* getSubsystem() { return new T; }
|
||||
};
|
||||
|
||||
""".}
|
||||
|
||||
type Input {.importcpp: "System::Input".} = object
|
||||
proc getSubsystem*[T](): ptr T {.importcpp: "SystemManager::getSubsystem<'*0>()".}
|
||||
|
||||
let input: ptr Input = getSubsystem[Input]()
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue