mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-11 13:11:07 +00:00
- added an OnDestroy method to Shape2D so that its users can explicitly free the data it holds.
In this case it is very important to care about management, because this class will hold GPU-side buffers!
This commit is contained in:
parent
3bef08b1aa
commit
9b4a4157b9
2 changed files with 8 additions and 3 deletions
|
@ -528,8 +528,13 @@ void F2DDrawer::AddTexture(FGameTexture* img, DrawParms& parms)
|
|||
offset = osave;
|
||||
}
|
||||
|
||||
DShape2D::~DShape2D() {
|
||||
delete lastParms;
|
||||
void DShape2D::OnDestroy() {
|
||||
if (lastParms) delete lastParms;
|
||||
lastParms = nullptr;
|
||||
mIndices.Reset();
|
||||
mVertices.Reset();
|
||||
mCoords.Reset();
|
||||
buffers.Reset();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -269,7 +269,7 @@ public:
|
|||
bool uploadedOnce = false;
|
||||
DrawParms* lastParms;
|
||||
|
||||
~DShape2D();
|
||||
void OnDestroy() override;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue