Results 1 to 5 of 5

Thread: texture dimensions from texture handle

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    .dk
    Posts
    134

    texture dimensions from texture handle

    Is it possible to get the dimensions of a texture, having only the texture-id? (handle, object...)

    The reason why I need this, is because I can only access the texture-handle from an FBO, not the texture target (GL_TEXTURE_2D etc). It just returns GL_TEXTURE or GL_RENDERBUFFER etc. So maybe I'm missing something there.

    Thanks

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2009
    Posts
    126

    Re: texture dimensions from texture handle

    What kind of image do you load ?
    You could get the dimensions by there.


    ^^


  3. #3
    Senior Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: texture dimensions from texture handle

    Quote Originally Posted by Mikkel Gjoel
    So maybe I'm missing something there.
    Thanks
    Yea one thing, you don't have to get something you already have, just save away the dimensions or whatever data you need when you load/create the texture or when you otherwise tell openGL what it does, and there you go.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    .dk
    Posts
    134

    Re: texture dimensions from texture handle

    Thanks for the replies. zeaoverlord - yea, doing that already. This is for debugging to see if everything is setup as it should be. Problem only arises if I am checking FBO-attachments - I can check that it's a texture using GetFramebufferAttachmentParameter... but not which kind (texture2d, rectangle etc.).

    Horribly embarrassed even asking about this
    (but then I remembered, there are no stupid questions... only stupid people )

  5. #5
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    .dk
    Posts
    134

    Re: texture dimensions from texture handle

    Specifically the problem is the following statement in the framebuffer extension:
    If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE at a particular attachment point is TEXTURE, the sizes may be determined by calling GetTexParameter, as described in section 6.1.3.
    Section 6.1.3 uses GetTexParameter which requires a target (tex2d/rect...) that doesn't seem obtainable from an FBO alone. It does seem the intention was to make texture-state for fbo queryable using regular texture functions.

Similar Threads

  1. Texture dimensions not power of 2
    By sam_thedancer in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-22-2013, 04:33 AM
  2. Texture dimensions
    By NekoChan in forum OpenGL: macOS
    Replies: 6
    Last Post: 07-17-2008, 04:24 AM
  3. Largest texture map dimensions?
    By Adrian67 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-28-2003, 01:59 AM
  4. Texture dimensions
    By iNsaNEiVaN in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-06-2002, 07:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean