GL texture problems

Joseph Garvin k04jg02 at
Tue Feb 14 13:12:16 CST 2006

Stefan Dösinger wrote:

>>I've only had a quick look, so I may have overlooked it, but were do
>>you bind the texture?
>Do I need to bind a texture? I create a new texture with glTexImage, upload a 
>texture part with glTexSubImage. AFAIK this should be enought to have the 
>texture available for drawing.

But notice that glTexImage doesn't take any pointers to store the 
texture. If glTexImage did set its result to the current texture, you 
would have to recall it everytime you wanted to use that texture again 
because you couldn't store it. You need to call glBindTexture _before_ 
calling glTexImage, and _again_ before you start drawing the surface 
that is going to have that texture on it (assuming that there's the 
possibility of other things being rendered between when you create the 
texture with glTexImage and when you plan to actually use it). Make sure 
you're using glBindTexture in both places if you're not getting any 
results. Also check the parameters to glTexImage, if they're wrong you 
usually get no texture at all.

More information about the wine-devel mailing list