Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Cutting a rectangle out of a texture

  1. #1
    Junior Member Newbie
    Join Date
    May 2004
    Posts
    7

    Cutting a rectangle out of a texture

    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,

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: Cutting a rectangle out of a texture

    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 ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •