68 glDeleteTextures(1, &
m_id);
73 if(!
setupSize(image->getSize(), buildMipmaps))
79 glImage->paste(image);
88 setupPixels(level++, glImage->getSize(), glImage->getPixelData(), glImage->getBpp(), compress);
89 }
while(glImage->nextMipmap());
92 setupPixels(0, glImage->getSize(), glImage->getPixelData(), glImage->getBpp(), compress);
102 glBindTexture(GL_TEXTURE_2D,
m_id);
108 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, screenRect.
x(), screenRect.
y(), screenRect.
width(), screenRect.
height());
123 glGenerateMipmap(GL_TEXTURE_2D);
160 glGenTextures(1, &
m_id);
175 "the maximum size allowed by the graphics card is %dx%d,"
176 "to prevent crashes the texture will be displayed as a blank texture",
191 texParam = GL_CLAMP_TO_EDGE;
193 texParam = GL_REPEAT;
195 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texParam);
196 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, texParam);
204 minFilter =
m_hasMipmaps ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR;
205 magFilter = GL_LINEAR;
207 minFilter =
m_hasMipmaps ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST;
208 magFilter = GL_NEAREST;
210 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minFilter);
211 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magFilter);
238 format = GL_LUMINANCE_ALPHA;
245 GLenum internalFormat = GL_RGBA;
251 internalFormat = GL_COMPRESSED_RGBA;
254 glTexImage2D(GL_TEXTURE_2D, level, internalFormat, size.
width(), size.
height(), 0,
format, GL_UNSIGNED_BYTE, pixels);