Hey, I’ve been trying to create a pbuffer for rendering then copy it to a texture an render it in my main RC. I created a small pbuffer library that seems to work. However, rendering it fails. I either get a black nothing if I used glTexImage2D before glCopyTexImage2D/glCopyTexSubImage2D or a white if I don’t. OpenGL doesn’t flag any errors and GLX doesn’t return any error codes. I’ve been scratching my head over this for a couple of days and would appreciate any help.
I never made any pbuffering yet. Try the linux specific forum: there are no more much people here, but they might find out your post more easily than under this forum (that have many people come here, so posts disappear quiete quickly).
I downloaded your tarball, I’ll see what I can do… But I’m not the best one for that.
If I query the width and height of the pbuffer after creating it, i get 0x0, and my square turns white again. I think it being white means that something went wrong somwhere. I used:
Further, glxReadPixels doesn’t seem to work properly either. I read the pixels, then use glTexImage2D. The result however isn’t entirely black. There are three colored dots in the lower left corner. I think I’m getting some scrap bits from somewhere.
I’ve took a look at your program, I also needed to read the pbuffer spec (can be found on this website).
For testing at least, I recommand you to check almost all what you’re doing (like your sizes, pbuffer state…).
Try first to do a pbuffer with the same context than your drawing context. I don’t remember well how, but it’s also easy to not have the textures shared between two contexts. And I don’t really remember well how to correct that. It might be more difficult with staying with glut. So try a little X11/glx demo and modify some values in order the drawable can hangs both a window and a pbuffer.
I cannot say more.
Hope this helps (a bit).
Try also to post or continue thsi thread on the linux forum.
Most people here don’t give any attention to your thread just because they’re expecting for advanced opengl issues.
Thanks for the suggestions, but I’m still unable to resolve the problem. I’ve seen the thread you linked too and in it you link, indirectly, to some code exactly like mine (glut+glx pbuffer+glcopyteximage2d) that works! Sadly I’m not able to spot the difference.
I’ve taken your advice now and started a sibling thread in the Linux forum.