MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / kill

Method kill

Engine/source/gfx/gfxTextureObject.cpp:157–190  ·  view source on GitHub ↗

----------------------------------------------------------------------------- kill - this function clears out the data in texture object. It's done like this because the texture object needs to release its pointers to textures before the GFXDevice is shut down. The texture objects themselves get deleted by the refcount structure - which may be after the GFXDevice has been destroyed. ------------

Source from the content-addressed store, hash-verified

155// been destroyed.
156//-----------------------------------------------------------------------------
157void GFXTextureObject::kill()
158{
159 if( mDead )
160 return;
161
162#ifdef TORQUE_DEBUG
163 // This makes sure that nobody is forgetting to call kill from the derived
164 // destructor. If they are, then we should get a pure virtual function
165 // call here.
166 pureVirtualCrash();
167#endif
168
169 // If we're a dummy, don't do anything...
170 if( !mDevice || !mDevice->mTextureManager )
171 {
172 mDead = true;
173 return;
174 }
175
176 // Remove ourselves from the texture list and hash
177 mDevice->mTextureManager->deleteTexture(this);
178
179 // Delete the stored bitmap.
180 SAFE_DELETE(mBitmap)
181 SAFE_DELETE(mDDS);
182
183 // Clean up linked list
184 if(mNext)
185 mNext->mPrev = mPrev;
186 if(mPrev)
187 mPrev->mNext = mNext;
188
189 mDead = true;
190}
191
192const String GFXTextureObject::describeSelf() const
193{

Callers 4

~GFXGLDeviceMethod · 0.45
preDestroyMethod · 0.45
ResizeMethod · 0.45

Calls 1

deleteTextureMethod · 0.80

Tested by

no test coverage detected