rendering and… GDB.
today i implemented rendering for tui, tried cleaning up code and documentation, and had trouble with using shared_ptrs to store window references. no lifetime guarantee anymore… i replaced them with regular pointers instead, and ill just give them to the tui, which will also delete them. good for temporary popups and constant visuals! copies or instances within the tui aren’t so robust…
i gotta admit though. figuring out shared_ptrs slice classes took me way. too. LONG. in the image below you can see an accurate depiction of how i felt doing that!
… in more detail though, i intend the tui to store pointers which point to dynamically allocated windows made with new. however, the pointers will be inside a class, and though the class allows full access to the pointer, the destructor makes sure to delete the store pointer. dynamically allocated windows are good because temporary, unimportant windows (like popups, or a dropdown) can be created locally and just added to the tui, they don’t have to be kept in members or vectors, and they’ll stay alive!! yippers! but if you want a pointer in a member or vector, thats no problem! this is much easier than hacky solutions with shared_ptrs, or instances, let alone copies in the tui…
all of that though, just to allow classes which inherit Toluene::Window to override base functions. i think it will be okay, though!
woah, uh, this is a bit of a long devlog. it… may be because i’m really unsure whether this “creative” solution will work… and cuz i’m angry. and tired
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.