Archived

This topic is now archived and is closed to further replies.

krakrazor

Creating textures on the fly

Recommended Posts

As yall know i did gldrawpixel and i got it working... but now i got an idea... is there anyway i can make a texture on the fly every frame that contains the graphics using my pixelinfo and then put the texture on the screen?

Share this post


Link to post
Share on other sites
I think what you're looking for is the glTexSubImage2D function. It allows you to "overwrite" a current texture with the contents of a memory location (ie. another image). You might also be interested in glCopyTexImage2D, which allows you to create a texture from the current read buffer, like the colour buffer, or depth buffer. This NeHe tutorial uses one of these functions to create a radial blur effect. What you're effectively doing is rendering to a texture, but I believe there are better ways of doing that than glCopyTexImage2D these days. Anyone care to elaborate?


Windows 95 - 32 bit extensions and a graphical shell for a 16 bit patch
to an 8 bit operating system originally coded for a 4 bit microprocessor,
written by a 2 bit company that can't stand 1 bit of competition.


[edited by - iNsAn1tY on March 18, 2004 6:53:15 AM]

Share this post


Link to post
Share on other sites