Weird Windowed Mode GFX Tearing

nabobnick
Unregistered
 
Post: #1
In my experimentation I've come across a weird problem that I'd like to know if it's avoidable or if it's something you have to live with. I started out wanting to follow the examples in the "Tricks of the 3D Game Programming Gurus" book. So I started off with a memory buffer blitted to a 640x480 window using DrawPixels. I noticed some tearing not the weird kind mentioned in the title though, this was just because DrawPixels is obviously slow.

Next I tried modifying the Apple Fast-Texture example so that I would blit from a memory buffer to a window sized texture. Still slow still no weird tearing yet. The weirdness started in the base Fast-Texture example project from Apple. When moving the texture back and forth across the screen with the mouse I would notice there would be one horizontal line on the screen that if the texture was anywhere on this line it would tear horribly. If the texture was not on this one singular line it wouldn't tear at all, just ghost a bit due to my LCD screen.

I thought it might be performance related so I created an app that does the most basic OpenGL rendering, one that couldn't possibly (as far as I can tell) be affected by bad performance. I still get the same tearing, the line sometimes moves up or down but if you are over that line your graphics are torn to shreads. Any ideas? Can I get some people to run this on other Mac hardware and report their findings?

Example App (just wave the mouse back and forth horizontally):
GameEngine.zip
Quote this message in a reply
Moderator
Posts: 771
Joined: 2003.04
Post: #2
Look for "Frame Tears" and "VBL syncing" here
Quote this message in a reply
nabobnick
Unregistered
 
Post: #3
Wacko

A very simple answer, thanks! I knew about VBL syncing but didn't realize it would fix this particular problem. Also I thought it was just weird that on the entire screen it would always tear at approximately the same location but never above or below that location.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Mac OS X. Switching between fullscreen and windowed mode. e40pud 2 4,276 Jan 25, 2010 12:01 PM
Last Post: OneSadCookie
  Visual Tearing Arjan B 11 6,055 Nov 9, 2007 08:47 AM
Last Post: Arjan B
  Problems trying to fade in windowed mode Wowbagger 4 3,828 Aug 13, 2007 12:11 PM
Last Post: Wowbagger
  need help with a tearing like graphics glitch Andrew 19 7,955 Jun 9, 2005 09:41 AM
Last Post: Andrew
  Fullscreen windowed OpenGL mode maaaaark 8 5,181 Mar 11, 2005 12:34 PM
Last Post: maaaaark