> - having done 3d programming before, I seem to remember that any texture 
> sizes must be powers of 2?

That was true "back in the day", but...

> I want some potential weird scalings, currently our test setup has for 
> instance 48 by 50 pixels. Could that be handled?

... GL_TEXTURE_2D doesn't need to be a power of two any more (only in GLES, 
like on iOS).  Alternatively, use GL_TEXTURE_RECTANGLE, which also supports 
non-power-of-two dimensions.


> - also, great to have the scaled down version of my image, but now what? How 
> do I read out the pixeldata from scaledTexture?

glReadPixels?  There are probably some other documents on how to do this (there 
may be faster methods nowadays, I haven't needed to use them so I don't have 
good advice for that).


> What is it, by the way, a texture object?


In GL, a "texture" is actually a bit more complicated than most people realize.
A Texture Object is what you get from glGenTexture.  It's the "container" -- 
not the data itself, but all the metadata (the dimensions, all the 
glTexParameter state, etc).  The pixel data that backs the texture is _not_ 
part of the texture object.  This allows you to, for example, purge a texture 
(throw away the pixel data to save memory) without throwing away the entire 
object.  This also allows you to, for example, use an IOSurface as the backing 
(the pixel data is owned by the IOSurface, the GL state is owned by the Texture 
Object).  Normally people create the object and the backing at the same time, 
and they're never dissociated, so they don't have to think about them as 
separate pieces.

--
Christopher Wright
christopher_wri...@apple.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (Quartzcomposer-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to