Bert's question clarified: How to put a pixel into a view??
That's really it! All I need to know is how to put a pixel directly into a view, the fastest way possible. I know this must be a "dumb" question to most of you, but please bear with me!!
Thanks to everyone who responded to my last (first) post. I hope this makes the question clearer.
-- Bert
Thanks to everyone who responded to my last (first) post. I hope this makes the question clearer.
-- Bert
The easiest way is to just use:
This will draw a rect of size w(idth) and h(eight). To draw exactly a single pixel at point (10,20):
The 0.5's are there because of the way the coordinate system works in a default view.
There are moer optimal ways, but this is easiest.
Code:
[NSBezierPath fillRect:NSMakeRect(x, y, w, h)];Code:
[NSBezierPath fillRect:NSMakeRect(10.5, 20.5, 1, 1)];There are moer optimal ways, but this is easiest.
It'd be super slow for more than a couple of pixels too, I'd think.
Bert, you'll have to tell us what you want to do at a little higher level, I think, before we can give you any intelligent advice. For example if you want to display a static image, you could load it up and blit it using those same NS* primitives (and do some 2D things like rotations, etc). If you want to do things more complicated than that, especially if it will involved a *lot* of pixel pushing or complex scenes, the answer is likely "GL".
Bert, you'll have to tell us what you want to do at a little higher level, I think, before we can give you any intelligent advice. For example if you want to display a static image, you could load it up and blit it using those same NS* primitives (and do some 2D things like rotations, etc). If you want to do things more complicated than that, especially if it will involved a *lot* of pixel pushing or complex scenes, the answer is likely "GL".
Yes, Dan, OpenGL would be faster, although it's quite a bit more complicated. 
Incidentally, I forgot to mention NSRectFillList() (not specifically Cocoa, but still callable in Obj-C), that will fill a list, and is quite fast.
Does anyone know if these APIs are sped up to use the video card in Tiger (ie, fast without the openGL)?

Incidentally, I forgot to mention NSRectFillList() (not specifically Cocoa, but still callable in Obj-C), that will fill a list, and is quite fast.
Does anyone know if these APIs are sped up to use the video card in Tiger (ie, fast without the openGL)?
That was rumored to happen in 10.4.1 for cards with the necessary shader support (aka Quartz 2D Extreme) but I'm not sure if it really did (don't have one myself...)
No, Q2DE is not enabled in 10.4.1.
Yes it will be enabled in the future.
So, no, Quartz still renders in software.
But, yes, Quartz software rendering in Tiger is about 5x faster than in Panther.
Yes it will be enabled in the future.
So, no, Quartz still renders in software.
But, yes, Quartz software rendering in Tiger is about 5x faster than in Panther.
---Kelvin--
15.4" MacBook Pro revA
1.83GHz/2GB/250GB

