On Thu, 2009-02-05 at 01:54 -0800, Peng Liu wrote:

> I am an OpenGL newbie and have a question about texture image. As I
> known, Open GL ES requires the use of "power of 2" sized images. It
> seems that clutter can use any sized images as texture.  How do you
> implement that ?   Resize the image when loading it from a file?  or
> other method?

If non-power-of-two sized textures are not supported then Clutter will
slice up the texture into smaller POT-sized textures and render them
next to each other so they look like one big texture. Therefore one
CoglTexture can represent multiple GL textures.

Scaling the texture to fit a power-of-two size then drawing it at the
original size is also a good idea and has advantages that it would make
it easier to use shaders and the hardware repeat modes of GL. The
disadvantages are that you might get artifacts and it could waste more
memory. You could force Clutter to use this approach scaling the image
to a POT-size outside of Clutter and then forcing the geometry to the
original size with clutter_actor_set_size.

- Neil


-- 
To unsubscribe send a mail to [email protected]

Reply via email to