[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: OpenGL texturing



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!

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.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net>    WorkEmail: <sjbaker@link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
           http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M- V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----