Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. import
  2. spine,
  3. frag_spine
  4.  
  5. type
  6. AttachmentLoader* = ref object
  7. super*: spAttachmentLoader
  8. atlasAttachmentLoader*: ptr spAtlasAttachmentLoader
  9.  
  10. proc createAttachment(loader: ptr spAttachmentLoader, skin: ptr spSkin, `type`: spAttachmentType, name, path: cstring): ptr spAttachment =
  11. let self = cast[AttachmentLoader](loader)
  12. spAttachmentLoader_createAttachment(addr(self.atlasAttachmentLoader.super), skin, `type`, name, path)
  13.  
  14. proc configureAttachment(loader: ptr spAttachmentLoader, attachment: ptr spAttachment) =
  15. echo "CONFIGURING ATTACHMENT"
  16.  
  17. proc disposeAttachment(loader: ptr spAttachmentLoader, attachment: ptr spAttachment) =
  18. echo "DISPOSING OF ATTACHMENT"
  19.  
  20. proc dispose(loader: ptr spAttachmentLoader) =
  21. echo "DISPOSING OF ATTACHMENT LOADER"
  22.  
  23. proc create*(atlas: ptr spAtlas): AttachmentLoader =
  24. result = AttachmentLoader()
  25. spAttachmentLoader_init(addr result.super, dispose, createAttachment, configureAttachment, disposeAttachment)
  26. result.atlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement