[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenGL texturing



Steve Baker:
> Francesco Orsenigo wrote:
> > How can i load a texture to use within OpenGL calls?
> > Each demo/tutorial i see uses different functions, many of wich are not
> > native OpenGL...
>
> OpenGL doesn't have calls for doing file I/O - it's a graphics API!

Ok, my question was bad expressed.
Let's say i have a texture _already in memory_ in some format OpenGL can 
understand.
Now, i want to feed somewhat that memory texture to OpenGL, and maybe someone 
will return me an integer texture-id... or at least so i expect.

> > I'd need to perform many pixel-by-pixel color transformations: is this
> > possible after the texture is loaded?
>
> Possible - but very slow.  You could use glTexSubImage2D to download
> a 1x1 'rectangle' of texels into the image...but don't try to do hundreds
> of them per frame!
>
> Better to change a large chunk of the texture and download that chunk
> all at once using glTexSubImage2D.

So, no run-time manipulations....
I need to draw the game units with some patches colored with the player 
color... how could be this achieved?
At the time i'm working with single images, but i can split them between the 
part to be transformed and the part to drawn as is.

Francesco Orsenigo