[vtkusers] OpenGL Backbuffer on Mac

Michael Rice marice at knology.net
Mon May 29 15:42:00 EDT 2006


On May 29, 2006, at 11:41 AM, Sean McBride wrote:

> On 2006-05-26 06:46, Michael Rice said:
>
>> The vtkRenderWindow::SwapBuffersOff() method turns off swapping the
>> backbuffer to the frontbuffer.
>>
>> On Windows, the vtkWin32OpenGLRenderWindow::Frame() method checks  
>> this flag
>> and does not do the swap if it swapping is turned off. The same is  
>> true for
>> vtkXOpenGLRenderWindow::Frame().
>>
>> However, on Mac, neither the vtkCarbonRenderWindow::Frame() or
>> vtkCocoaRenderWindow::Frame() methods check this flag before doing  
>> the swap.
>>
>> Is there a reason for this?
>
> Since no one else answered... It could simply be an oversight.  Did  
> you
> try changing the method on the Mac to behave more like the other two
> OSes?  What happened?
>

I changed vtkCarbonRenderWindow to include the check and it works  
fine - at least on my systems. I just thought that maybe someone  
might know if the check was intentionally left out.

Here's the diff for vtkCarbonRenderWindow.cxx:

@@ -636,7 +636,7 @@
// End the rendering process and display the image.
void vtkCarbonRenderWindow::Frame()
{
-  if (!this->AbortRender && this->DoubleBuffer)
+  if (!this->AbortRender && this->DoubleBuffer && this->SwapBuffers)
      {
      aglSwapBuffers(this->ContextId);
      vtkDebugMacro(<< " SwapBuffers\n");





More information about the vtkusers mailing list