platform-independent way of loading images into textures in GLES 2

Hi,

I have a program where i dynamically create images in an offscreen buffer. I was using glDrawPoints to map each image pixel but it is rather slow, so i’m now searching a way to load and draw it into a texture.

I found a couple of programs that does this, but each one is targetted for a platform (ios, windows, android) and each one has an utility function that loads a rgb array representing the image and transforms it into a texture. For example, in windows we have gluBuild2DMipmaps.

Since i’m targetting all oses, i don’t want to use the utility functions. Can someone point me to a code that converts the bitmap into a texture, using OpenGL ES 2?

thanks

guich

For example, in windows we have gluBuild2DMipmaps.

This function is part of GLU, the GL Utility library. It’s old, and may not work with OpenGL ES, but it is platform independent. Also, as it’s name suggests, it does more than just create a texture, it creates a complete mipmap chain.

Can someone point me to a code that converts the bitmap into a texture, using OpenGL ES 2?

glTexImag2D?