Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glutSwapBuffers bug?



SwapBuffers absolutely does an implicit glFlush. It could be that you're running single buffered, which means SwapBuffers does nothing and glFlush pushes the commands to the GPU. I would check if you are double or single buffered.

Calling glFlush after SwapBuffers on a buffered context will do nothing. This is because there would be no commands to flush.

Calling glFlush before SwapBuffers on a buffered context would be redundant since SwapBuffers has an implicit glFlush.

John

On Nov 13, 2004, at 9:35 AM, Kenneth Tilton wrote:

I just discovered that calling glutSwapBuffers at the end of my display callback is not enough to get my drawing commands out; I had to add a glFlush call.

But, from http://www.opengl.org/resources/libraries/glut/spec3/node21.html

"An implicit   <x-tad-bigger> glFlush</x-tad-bigger> is done by <x-tad-bigger> glutSwapBuffers</x-tad-bigger> before it returns. Subsequent OpenGL commands can be issued immediately after calling <x-tad-bigger> glutSwapBuffers</x-tad-bigger>, but are not executed until the buffer exchange is completed."

And earlier at the same link:

"The update typically takes place during the vertical retrace of the monitor, rather than immediately after
<x-tad-bigger> glutSwapBuffers</x-tad-bigger> is called."

Interestingly, the original glut source does not show a call to glFlush. Freeglut calls glFlush before swapping, while Apple's Cocoa Glut calls it after.

Possibly calling after the swap is cool as long as the actual swap is deferred a hair, in which case the glFlush is still operating on the pre-swap buffer. But in my case (specs below), it seems the swap takes immediate effect and the glFlush comes too late.

Bottom line: should Apple's glutSwapBuffers call glFlush before doing the actual swap call?

kenny


set up:


<x-tad-smaller>Machine Model: Power Mac G5
CPU Type: PowerPC G5 (3.0)
Number Of CPUs: 2
CPU Speed: 2 GHz
L2 Cache (per CPU): 512 KB
Memory: 1 GB
Bus Speed: 1 GHz
Boot ROM Version: 5.1.8f5
</x-tad-smaller>


<x-tad-smaller>System Version: Mac OS X 10.3.5 (7P134)
Kernel Version: Darwin 7.5.1

</x-tad-smaller><x-tad-smaller>ATY,R360:

</x-tad-smaller>
<x-tad-smaller> Type: display
Bus: AGP
Slot: SLOT-1
VRAM (Total): 256 MB
Vendor: ATI (0x1002)
Device ID: 0x4e48
Revision ID: 0x0000
ROM Revision: 113-A14404-118

</x-tad-smaller><x-tad-smaller>Display:

</x-tad-smaller>
<x-tad-smaller> Type: display
Display Type: LCD
VRAM (In Use): 256 MB
Resolution: 1680 x 1050
Depth: 32-bit Color
Main Display: Yes
Mirror: Off
Online: Yes
</x-tad-smaller>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden

References: 
 >glutSwapBuffers bug? (From: Kenneth Tilton <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.