Fix to delete graphic page
This commit is contained in:
@@ -90,6 +90,10 @@ class Graphic
|
|||||||
}
|
}
|
||||||
void initGraphicPages()
|
void initGraphicPages()
|
||||||
{
|
{
|
||||||
|
if (GRP.length != 0 && GRP[0].glTexture/*TODO:gl texture 0?*/)
|
||||||
|
{
|
||||||
|
oldGRP = GRP;
|
||||||
|
}
|
||||||
GRP = new GraphicPage[6];
|
GRP = new GraphicPage[6];
|
||||||
for(int i = 0; i < 4; i++)
|
for(int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
@@ -204,6 +208,7 @@ class Graphic
|
|||||||
}
|
}
|
||||||
uint gcolor = -1;
|
uint gcolor = -1;
|
||||||
GraphicPage[] GRP;
|
GraphicPage[] GRP;
|
||||||
|
GraphicPage[] oldGRP;
|
||||||
class Paint
|
class Paint
|
||||||
{
|
{
|
||||||
uint[] buffer;
|
uint[] buffer;
|
||||||
@@ -424,6 +429,13 @@ class Graphic
|
|||||||
{
|
{
|
||||||
if (!GRP[0].glTexture)
|
if (!GRP[0].glTexture)
|
||||||
{
|
{
|
||||||
|
if (oldGRP.length)
|
||||||
|
{
|
||||||
|
foreach (i; oldGRP)
|
||||||
|
{
|
||||||
|
i.deleteGL;
|
||||||
|
}
|
||||||
|
}
|
||||||
initGLGraphicPages();
|
initGLGraphicPages();
|
||||||
}
|
}
|
||||||
if(!drawMessageLength) return;
|
if(!drawMessageLength) return;
|
||||||
|
|||||||
@@ -132,6 +132,13 @@ class GraphicPage
|
|||||||
}
|
}
|
||||||
glBindFramebufferEXT(GL_FRAMEBUFFER, old);
|
glBindFramebufferEXT(GL_FRAMEBUFFER, old);
|
||||||
}
|
}
|
||||||
|
void deleteGL()
|
||||||
|
{
|
||||||
|
glDeleteFramebuffersEXT(1, &buffer);
|
||||||
|
glDeleteRenderbuffersEXT(1, &render);
|
||||||
|
glDeleteTextures(1, &glTexture);
|
||||||
|
buffer = render = glTexture = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version(Windows)
|
version(Windows)
|
||||||
|
|||||||
Reference in New Issue
Block a user