Recent

Author Topic: OpenGL textures  (Read 4097 times)

Imants

  • Full Member
  • ***
  • Posts: 196
OpenGL textures
« on: May 31, 2010, 05:27:15 am »
Is it posible to get my texture width and height after I buit it


glBindTexture(GL_TEXTURE_2D, Texture); //using variable Texture
....
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData) //Get this width and height
....

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: OpenGL textures
« Reply #1 on: May 31, 2010, 06:11:33 am »
AFAIK no, you have to maintain it yourself.

Krom

  • Newbie
  • Posts: 2
Re: OpenGL textures
« Reply #2 on: June 14, 2010, 07:10:27 am »
There's such a function you can use ;)

glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &param);

Similar goes for height and other texture props - see Help on glGetTexLevelParameter

 

TinyPortal © 2005-2018