Im not sure about the correct way to do it, but when I used glCopyTexSubImage2D(), I had to do this:
Initialization:
glGenTextures()
glBindTexture()
glTexImage2D() with texture data all 0’s, i.e. black.
glTexParameteri() for whatever parameters you want, and set generate mipmaps to true
The mipmaps should be regenerated every time you change the level 0 image – regardless of how you modify it. Are you sure you enabled mipmap generation before calling glCopyTexImage2D()?
When this code is run glGetError() returns 0 but all my textured area are blank.
However when I remove the glCopyTexImage2D code the textures are generated normally. However I suspect thats just because no mipmaps are being generated, not that I know how to check this either.
This looks to be what you guys are suggesting, but it still doesn’t work.
I’ve followed up every link in google for ‘GL_GENERATE_MIPMAP_SGIS’ but haven’t found any simple demo’s\code that describe how this is meant to work…
Do you understand that glCopyTexImage2D take it’s data fromt he frame buffer? if it’s blank then the texture will be blank…
What are you trying to do anyway? If you really try to copy your frame buffer into a texture, there is no sense in calling glTexImage2D with real data. Send it NULL instead.
if you use glCopyTexImage to create your texture, why creating it before with glTexImage as well? you just need ONE TIME A TexImage call per texture. ONE TIME. eighter glCopy or just gl. if you use gCopyTexImage, you need data in the screenbuffer (the one you defined to readout).