Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import
- spine,
- frag_spine
- type
- AttachmentLoader* = ref object
- super*: spAttachmentLoader
- atlasAttachmentLoader*: ptr spAtlasAttachmentLoader
- proc createAttachment(loader: ptr spAttachmentLoader, skin: ptr spSkin, `type`: spAttachmentType, name, path: cstring): ptr spAttachment =
- let self = cast[AttachmentLoader](loader)
- spAttachmentLoader_createAttachment(addr(self.atlasAttachmentLoader.super), skin, `type`, name, path)
- proc configureAttachment(loader: ptr spAttachmentLoader, attachment: ptr spAttachment) =
- echo "CONFIGURING ATTACHMENT"
- proc disposeAttachment(loader: ptr spAttachmentLoader, attachment: ptr spAttachment) =
- echo "DISPOSING OF ATTACHMENT"
- proc dispose(loader: ptr spAttachmentLoader) =
- echo "DISPOSING OF ATTACHMENT LOADER"
- proc create*(atlas: ptr spAtlas): AttachmentLoader =
- result = AttachmentLoader()
- spAttachmentLoader_init(addr result.super, dispose, createAttachment, configureAttachment, disposeAttachment)
- result.atlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement