[gameprogrammer] Re: creating and deleting a class in c++
- From: Kevin Jenkins <gameprogrammer@xxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 19 Dec 2007 14:19:06 -0800
I believe the other posters are not addressing the problem you are
asking. What I believe you are doing is deriving from Ogre::Entity
and for each instance of that you have a pointer to text. And if that
is the case, when what you have said is fine.
Roger D. Vargas wrote:
In my project I have a class that handles text in 3d space. The class
have a problem: it cant be created with an empty string, so I initialize
it with the entity name. Im planning to rewrite the floating text
management, except the class itself that was taken form Ogre wiki to a
system that creates the text when required and destroys it when no
longer displayed.
What I want to know is if the following approach is valid:
in Entity class constructor I assign 0 to floatText
in displayText function, if floatText==0, then floatText= new floating text
when text has expired, delete floatText, asign 0 again to floatTExt
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: creating and deleting a class in c++
- From: ®£$ǖ\"v@M$Ħ ¢© $...........
- [gameprogrammer] Re: creating and deleting a class in c++
- From: Roger D. Vargas
- References:
- [gameprogrammer] creating and deleting a class in c++
- From: Roger D. Vargas
Other related posts:
- » [gameprogrammer] creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
- » [gameprogrammer] Re: creating and deleting a class in c++
What I want to know is if the following approach is valid: in Entity class constructor I assign 0 to floatText in displayText function, if floatText==0, then floatText= new floating text when text has expired, delete floatText, asign 0 again to floatTExt
- [gameprogrammer] Re: creating and deleting a class in c++
- From: ®£$ǖ\"v@M$Ħ ¢© $...........
- [gameprogrammer] Re: creating and deleting a class in c++
- From: Roger D. Vargas
- [gameprogrammer] creating and deleting a class in c++
- From: Roger D. Vargas