mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +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;
|
offset = osave;
|
||||||
}
|
}
|
||||||
|
|
||||||
DShape2D::~DShape2D() {
|
void DShape2D::OnDestroy() {
|
||||||
delete lastParms;
|
if (lastParms) delete lastParms;
|
||||||
|
lastParms = nullptr;
|
||||||
|
mIndices.Reset();
|
||||||
|
mVertices.Reset();
|
||||||
|
mCoords.Reset();
|
||||||
|
buffers.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -269,7 +269,7 @@ public:
|
||||||
bool uploadedOnce = false;
|
bool uploadedOnce = false;
|
||||||
DrawParms* lastParms;
|
DrawParms* lastParms;
|
||||||
|
|
||||||
~DShape2D();
|
void OnDestroy() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue