Re: Faster drawing sprite and background
Re: Faster drawing sprite and background
- Subject: Re: Faster drawing sprite and background
- From: rsharp <email@hidden>
- Date: Mon, 8 Oct 2001 07:19:08 -0500 (CDT)
On Mon, 8 Oct 2001, jean-michel daix wrote:
>
I'm using a NSView based Cocoa application basicely drawing a background and
>
a sprite. My problem is "drawRect". My background is a 640x480 image and so
>
it can only be drawed about 12 time by second on my G4 400 (12 fps). I don't
>
want to redraw all my background all the time for sure, I just want to
>
redraw the sprite and a part of the background. But, tell me if I'm wrong,
>
"drawRect" is made to redraw all the content of the NSView.
I think its parameter though is the dirty bounds that needs to be redrawn,
so that would be at least one for of optimization. If your drawRect
method also draws all of the view's contents, then override the isOpaque
method and return YES.
Although, if you need high fps rates, I strongly suggest looking into
OpenGL...it's not just for 3D.
HTH,
Rick Sharp
Instant Interactive(tm)