Foros - Stratos

Programadores => Programación gráfica => Mensaje iniciado por: coolhand en 07 de Febrero de 2007, 10:59:18 AM

Título: OGL y tamaños de texturas
Publicado por: coolhand en 07 de Febrero de 2007, 10:59:18 AM
Se puede usar texturas no cuadradas en opengl?? en caso afirmativo, a partir de qué versión?? (tampoco me vendría mal saber cómo averiguar el tamaño máximo de textura que permita el cliente en tiempo de ejecucion).
Título: OGL y tamaños de texturas
Publicado por: Pogacha en 07 de Febrero de 2007, 12:24:33 PM
Si, desde que se soportan texturas (OpenGL 1.1), pero solo si el hardware lo soporta.

Para determinar si una textura es posible:

glTexImage2D(GL_PROXY_TEXTURE_2D, level, internalFormat,  width, height, border, format, type, NULL);  

GLint width;
glGetTexLevelParameteriv(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
if (width==0) { /* Textura imposible */ }


Para determinar el maximo tamaño de una textura:
GLint texSize;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &texSize);


Fuente (http://www.opengl.org/resources/faq/technical/texture.htm)
Saludos!
Título: OGL y tamaños de texturas
Publicado por: coolhand en 07 de Febrero de 2007, 12:32:50 PM
Ok, muchas gracias.