mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
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:
parent
1f0052ac12
commit
ee08eff11a
1 changed files with 15 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue