PDA

View Full Version : Cutting a rectangle out of a texture



M.Mortier
06-28-2004, 02:22 PM
Hi,

Here is a screenshot :

http://studwww.ugent.be/~mgmortie/screenshot.png

At first sight, you might think..what the hell is he showing? But if you look closely you'll see that the window in the middle has in fact an opengl quad that is textured with the root desktop, giving the illusion of..transparency.

Now, I have two questions, sorry if they are too noobish for this forum..

I can't use non-power-two textures! I can't use GL_TEXTURE_RECTANGLE_EXT because when I include glext.h I get all sorts of code collision errors, no matter what other header files I exclude. Why? I've got the nvidia-glx header files, having a nvidia card..what's happening?

That doesn't bother me too much though, although I would like to solve it.. What I have now is a 1280*1024 texture that is the rootTexture, and then I slice out a rectangle of that when the window (which is power-2 sized) is moved.
I can't do any itnerpolation because otherwise the transparency illusion is gone.

As you can see from the memcpy code in emacs there, I use my CPU to slice out a rectangle of the texture. It's almost assembly fast of course but I'm planning do load these textures every frame so the user can type things in the background and then everything changes with it.
Can't GL do this more efficiently? Say if I change the rootTexture then a "rectangular view" I put over it automatically changes with it?

Well I'm sure this is a common wonder..thanks for any ideas.

And finally if anyoen has an idea on hwo to *get* the x,y position of an XWindow in a normal manner, please tell me (XGetGeometry does not do that).

Thanks all,

ZbuffeR
06-30-2004, 02:16 PM
The link is broken.

You should post to beginner forum, or even better, the linux forum.

1) compile issues : go to the linux forum
2) What is your second question actually ?