need help with a tearing like graphics glitch

Member
Posts: 320
Joined: 2003.06
Post: #16
Quote:You don't need to use setNeedsDisplay, just draw the frame in the timer callback and be done with it. Here's a more elaborate illustration of how to do it:

I found that setNeedsDisplay worked a lot nicer when resizing the window. There didn't seem to be any adverse side effects, and it felt more like the right thing to do.

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #17
Andrew Wrote:please let me know if it does Smile
Yes, it picks up both of them. Now you just need to set up some auto-calibration and you'll be done. You'll have to ask Danlab about how to do that one correctly Wink

reubert, I've noticed the same thing. It can't really hurt to put setNeedsDisplay in there in addition to just drawing the frame, but I think my point was that it shouldn't be the primary drawing path. But still, you're right, it can't hurt.
Quote this message in a reply
Member
Posts: 208
Joined: 2005.04
Post: #18
AnotherJake Wrote:Now you just need to set up some auto-calibration and you'll be done.

Well, I'm already scaling the values of each element against their reported min/max. I'm also cubing the values so that, for example, a joystick that has a resting state which isn't quite zero won't make the cube drift by much. Is calibration really necessary? What kind of calibration are we talking about? Something similar to what HID Utilities does?

edit: Are you getting any drift at rest position with either of your devices?
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #19
Yes they both drift at rest. The saitek drifts up and left, and the macally drifts left. Neither of them want to steer right or down very easily. I meant auto-calibration as in determining min/max/center on the fly like:

if (controlInputX < minX) minX = controlInputX;

etc., etc... Remember I mentioned earlier that they are notoriously difficult? Well this is what I meant. The default values coming from the controllers for min and max are not what you would expect. Here are the sample values out of HID Explorer:

saitek joystick:
left/center/right 13, 84, 161
forward/center/back 9, 80, 158
twistLeft/center/right 12, 97, 185

macally gamepad:
left stick x-axis (left/center/right) 5, 44, 88 (left right for blue cube)
left stick y-axis (forward/center/back) 20, 59, 93 (up down for blue cube)
right stick x-axis (left/center/right) 122, 95, 65 (this is the twist for blue cube)
right stick y-axis (forward/center/back) 1, 37, 79
Quote this message in a reply
Member
Posts: 208
Joined: 2005.04
Post: #20
OMG! That's ridiculous! I had no idea that manufacturers sucked that much!! I now see that calibration (auto or otherwise) is an absolute must.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  iPhone/iPad Audio Glitch - Double Hiss/Static reapz 2 4,946 Dec 8, 2010 06:22 PM
Last Post: reapz
  Visual Tearing Arjan B 11 5,854 Nov 9, 2007 08:47 AM
Last Post: Arjan B
  Weird Windowed Mode GFX Tearing nabobnick 2 2,773 Jul 25, 2005 06:45 PM
Last Post: nabobnick
  nasty tearing when I scroll in openGL Joseph Duchesne 3 3,115 Aug 15, 2004 10:30 PM
Last Post: arekkusu