PDA

View Full Version : get texture size problem



KeithLostracco
12-10-2012, 02:43 PM
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


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);

tonyo_au
12-10-2012, 04:38 PM
Do you have a texture bound when you ask for the sizes - this code doesn't so that