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: get texture size problem

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2012
    Posts
    3

    get texture size problem

    Hello I'm just learning OpenGL and am starting to write some FFGL plugins. I need to get the texture width and height of the incoming texture but I'm only getting a value of 0 returned by the following functions. Any ideas what I'm doing wrong?

    thanks
    keith

    Code :
      GLint width = 0;
      GLint height = 0;
      glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
      glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height);
      m_extensions.glUniform1iARB(m_resolutionXLocation, width);
      m_extensions.glUniform1iARB(m_resolutionYLocation, height);

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,117
    Do you have a texture bound when you ask for the sizes - this code doesn't so that

Posting Permissions

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