GLCtrl: ExecuteGL for GTK, static memory leaks in opengl driver now ignored

git-svn-id: svn://ultimatepp.org/upp/trunk@13533 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2019-08-09 14:19:19 +00:00
parent 1f0052ac12
commit ee08eff11a

View file

@ -33,6 +33,8 @@ EXITBLOCK {
void GLCtrl::Create()
{
MemoryIgnoreLeaksBlock __;
Ctrl *top = GetTopCtrl();
if(!top)
return;
@ -136,11 +138,9 @@ void GLCtrl::State(int reason)
}
}
void GLCtrl::Paint(Draw& w)
void GLCtrl::ExecuteGL(Event<> paint, bool swap_buffers)
{
Size sz = GetSize();
if(!s_GLXContext || sz.cx == 0 || sz.cy == 0)
return;
MemoryIgnoreLeaksBlock __;
glXMakeCurrent(s_Display, win, s_GLXContext);
@ -148,9 +148,9 @@ void GLCtrl::Paint(Draw& w)
glewInit();
}
DoGLPaint();
paint();
if(doubleBuffering)
if(swap_buffers)
glXSwapBuffers(s_Display, win);
else
glFlush();
@ -158,6 +158,15 @@ void GLCtrl::Paint(Draw& w)
glXMakeCurrent(s_Display, None, NULL);
}
void GLCtrl::Paint(Draw& w)
{
Size sz = GetSize();
if(!s_GLXContext || sz.cx == 0 || sz.cy == 0)
return;
ExecuteGL([&] { DoGLPaint(); }, doubleBuffering);
}
}
#endif