• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sluggish NSSlider with vsynced opengl
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sluggish NSSlider with vsynced opengl


  • Subject: Re: sluggish NSSlider with vsynced opengl
  • From: "Simon Strandgaard" <email@hidden>
  • Date: Thu, 28 Sep 2006 13:57:36 +0200

On 9/28/06, Simon Strandgaard <email@hidden> wrote:
On 9/28/06, Simon Strandgaard <email@hidden> wrote:
> I have a window containing a NSOpenGLView and a NSSlider.
> opengl is vsynced, running in its own thread.
>
> I am experiencing the slider being sluggish; the mouse-cursor
> can move large distances before the slider is being redrawn.
> plus the slider fires max 30 events per second.
[snip]

on second thought.. if I do vsync in the opengl thread, then how
would cocoa find time to do its own rendering if its also vsynced?

I have tried two configurations:
1. cocoa runs fine, but opengl is sluggish (varies between 20 to 50 Hz)
2. opengl runs fine (75 Hz steady), but cocoa is sluggish.

I am looking for a 3rd configuration where both opengl and cocoa
runs fine. Is this possible or do I have to pick a tradeoff ?


Ok, 3rd time is the lucky time. I have found an acceptable solution.
opengl runs fine (65 to 75 Hz.. and 75 Hz steady when there is
no GUI interaction), cocoa runs fine, slightly more cpu usage 10%..30%.


I did these things:

not using VSync at all.
not using a separate opengl-thread.



I made these modifications to Apples TextureRange example:

I added my NSSlider to the .nib file, so I had something to interact with,
without affecting the behavior of TextureRange.

letting the timer fire its events, while dragging sliders.
[ [ NSRunLoop currentRunLoop ]
   addTimer:timer
   forMode:NSEventTrackingRunLoopMode ];



With this config: 'client storage' + 'texture range'  +
'rectangular texture' + 'shared' + '2 buffers' + '75 Hz'.




Now one can only dream about 75 FPS steady and lower CPU usage.


Thanks everybody :-)

--
Simon Strandgaard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >sluggish NSSlider with vsynced opengl (From: "Simon Strandgaard" <email@hidden>)
 >Re: sluggish NSSlider with vsynced opengl (From: "Simon Strandgaard" <email@hidden>)

  • Prev by Date: Re: sluggish NSSlider with vsynced opengl
  • Next by Date: NSViewAnimation and window alpha value
  • Previous by thread: Re: sluggish NSSlider with vsynced opengl
  • Next by thread: Drag From iTunes in NSView just like iWeb did
  • Index(es):
    • Date
    • Thread