Faster drawing sprite and background
Faster drawing sprite and background
- Subject: Faster drawing sprite and background
- From: jean-michel daix <email@hidden>
- Date: Mon, 08 Oct 2001 13:19:50 +0200
Hi,
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 have try to add a NSImageVIew under my NSView for my background but when
calling [backgroundView setImage:myBackGroundImage] from my NSView it
doesn't work. (I'm using setImage because my Background is created by a part
of the application at the initialisation and is not always the same image)
Should I stop to use NSView to deal with my sprite and trying to use only
NSImageView or someone knows a better way to do that ?
Thanks for your help.
-----------------------------------
jean-michel daix / email@hidden
Sorry, I9m French !
visit <
http://www.adforum.com>