Jump to content
  • Advertisement

BirdGB

Member
  • Content count

    36
  • Joined

  • Last visited

Community Reputation

273 Neutral

About BirdGB

  • Rank
    Member

Personal Information

  • Interests
    Art
    Business
    Design
    Programming

Social

  • Steam
    76561198330735543
  1. BirdGB

    use of shared_ptr

    Ok, thanks for the detail explanation and help.
  2. BirdGB

    Error compiling

    I did not changed anything from my side. I used the code::blocks file that you provided and tried to compile it directly. I could compile debug but not release. It is for 32bit.
  3. BirdGB

    use of shared_ptr

    I want only one ownership, that is the scenelist, so that I don't need to bother about other pointers and delete the scenelist when required. But I still need another single pointer that point to any of the element from the scenelist at a time. I have only one question now, a unique_ptr will be deleted automatically even if I forget to delete it myself?
  4. BirdGB

    use of shared_ptr

    I want to avoid memory management by myself. That's why decided to use shared_ptr.
  5. BirdGB

    Error compiling

    Hi, When I tried to compile the code::blocks using gcc 5 angelscript 2.32.2 in release target, I am getting the following error - Error: CFI instruction used without previous .cfi_startproc Debug target compiles fine. How to resolve it?
  6. BirdGB

    use of shared_ptr

    Actually I use foo just to write the example here. My names are mScene and mSceneList of class Scene. Thanks for the input and sorry for the confusion.
  7. BirdGB

    use of shared_ptr

    Thanks for the help.
  8. BirdGB

    use of shared_ptr

    Ok, thanks for the reply and help.
  9. BirdGB

    use of shared_ptr

    Ok, so I should change shared_ptr to weak_ptr? And yes, I don't want ownership in f1, that's why I decided to use shared_ptr. Because I was unsure that f1 was freed properly before closing the application. I am only clearing the foolist.
  10. BirdGB

    use of shared_ptr

    f1 is the pointer for the current object selected and the foolist is the container of the all objects available. So I was a bit confused whether to delete or set null the f1 pointer after deleting or clearing the foolist.
  11. BirdGB

    use of shared_ptr

    Ok, to delete the container I only need to clear foolist, like - foolist.clear() and the f1 will also be cleared automaticaly? Or I should make the f1 null, like - f1 = 0? Or I should iterate through the list and delete each element before closing the application?
  12. BirdGB

    use of shared_ptr

    Hi, I have been trying to use shared_ptr but after searching the net and reading example, I still don't understand how to use std::shared_ptr? Say, I have a class - class foo { public: foo(); ~foo(); void init(); } Now I want to use this in another class - class useme { public: useme(); ~useme(); void init(); private: std::shared_ptr<foo> f1; std::list<shared_ptr<foo>> foolist; } In init() method, how do I create the f1 and push_back it into foolist? I tried like this - foolist.push_back(std::shared_ptr<foo>(new foo())); or f1 = std::make_shared<foo>(new foo()); foolist.push_back(f1); Any help will be appreciated. Thanks in advance.
  13. BirdGB

    Rpg Inventory gui

    That is what I want. I don't want player to be able to carry more items. Else I would like to stick with my present inventory system. Thanks for the reply.
  14. BirdGB

    Rpg Inventory gui

    I am still in theory. I will code some tests and see how it comes out. Thanks for reply.
  15. BirdGB

    Rpg Inventory gui

    I am thinking more like diablo 2. different sizes for different items, from 1x1 to 2x6.   I will do the experiments. Thanks for the replies.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!