From 8ed00152798954ece1090a71fec969ab69d7b37e Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sat, 20 Aug 2011 16:27:06 +1000 Subject: [PATCH] Attempt to turn on apple GL refresh --- Graphs/graphwindow.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Graphs/graphwindow.cpp b/Graphs/graphwindow.cpp index 9c634b31..bcf9b40b 100644 --- a/Graphs/graphwindow.cpp +++ b/Graphs/graphwindow.cpp @@ -8,6 +8,11 @@ #include #include #include + +#ifdef __APPLE__ +#include +#endif + #include "SleepLib/profiles.h" #include "graphwindow.h" #include "gTitle.h" @@ -808,6 +813,7 @@ void gGraphWindow::initializeGL() } +bool first_draw_event=true; void gGraphWindow::resizeGL(int w, int h) { m_scrX=w; @@ -868,11 +874,16 @@ void gGraphWindow::Render(int w, int h) void gGraphWindow::paintGL() { - if (m_scrX<=0) m_scrX=width(); if (m_scrY<=0) m_scrY=height(); if (m_scrX<=0) return; if (m_scrY<=0) return; +#ifdef __APPLE__ + AGLContext aglContext; + aglContext=aglGetCurrentContext(); + GLint swapInt=1; + aglSetInteger(aglContext, AGL_SWAP_INTERVAL, &swapInt); +#endif //glDisable(GL_DEPTH_TEST); Render(m_scrX,m_scrY);