Created
November 11, 2023 06:30
-
-
Save anosatsuk124/942ec5d069920111ffef0c12202b11dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Horrible example of how to interface with a C++ engine ... ;-) | |
{.link: "/usr/lib/libIrrlicht.so".} | |
{.emit: """ | |
using namespace irr; | |
using namespace core; | |
using namespace scene; | |
using namespace video; | |
using namespace io; | |
using namespace gui; | |
""".} | |
const | |
irr = "<irrlicht/irrlicht.h>" | |
type | |
IrrlichtDeviceObj {.header: irr, | |
importcpp: "IrrlichtDevice".} = object | |
IrrlichtDevice = ptr IrrlichtDeviceObj | |
proc createDevice(): IrrlichtDevice {. | |
header: irr, importcpp: "createDevice(@)".} | |
proc run(device: IrrlichtDevice): bool {. | |
header: irr, importcpp: "#.run(@)".} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment