Lines Matching refs:format
28 : width(0), height(0), dirty(false), surface(NULL), format(GL_NONE)
187 D3DFORMAT format = getD3DFormat();
189 switch(format)
207 // Selects an internal Direct3D 9 format for storing an Image
208 D3DFORMAT Texture::selectFormat(GLenum format, GLenum type)
210 if (format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
211 format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
225 if (format == GL_LUMINANCE && getContext()->supportsLuminanceTextures())
229 else if (format == GL_LUMINANCE_ALPHA && getContext()->supportsLuminanceAlphaTextures())
233 else if (format == GL_RGB)
244 // Store the pixel rectangle designated by xoffset,yoffset,width,height with pixels stored as format/type at input
246 void Texture::loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
249 GLsizei inputPitch = ComputePitch(width, format, type, unpackAlignment);
254 switch (format)
260 loadLuminanceImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, description->Format == D3DFMT_L8);
263 loadLuminanceAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, description->Format == D3DFMT_A8L8);
278 switch (format)
287 switch (format)
296 switch (format)
305 switch (format)
327 switch (format)
424 if (!native) // BGRA8 destination format
434 else // L8 destination format
493 if (!native) // BGRA8 destination format
735 void Texture::createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img)
745 if (IsCompressed(format) && (width % 4 != 0 || height % 4 != 0))
762 HRESULT result = getDevice()->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, NULL, selectFormat(format, type),
780 img->format = format;
783 void Texture::setImage(GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img)
785 createSurface(width, height, format, type, img);
799 loadImageData(0, 0, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits, &description);
809 void Texture::setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img)
811 createSurface(width, height, format, GL_UNSIGNED_BYTE, img);
832 bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img)
842 createSurface(img->width, img->height, format, type, img);
857 loadImageData(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits, &description);
867 bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img)
875 if (format != getFormat())
883 createSurface(img->width, img->height, format, GL_UNSIGNED_BYTE, img);
901 GLsizei inputPitch = ComputeCompressedPitch(width, format);
924 HRESULT result = device->CreateOffscreenPlainSurface(description.Width, description.Height, description.Format, D3DPOOL_SYSTEMMEM, &surface, NULL);
983 switch (description.Format)
1206 return mImageArray[0].format;
1211 // Call this when a particular level of the texture must be defined with a specific format, width and height.
1226 bool textureOkay = (sizeOkay && typeOkay && internalFormat == mImageArray[0].format);
1231 mImageArray[0].format, mWidth, mHeight,
1256 mImageArray[0].format = internalFormat;
1263 void Texture2D::setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1267 Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[level]);
1312 void Texture2D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1314 if (Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, &mImageArray[level]))
1320 void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
1322 if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[level]))
1374 mImageArray[level].format = internalFormat;
1392 bool redefined = redefineTexture(0, mImageArray[0].format, mImageArray[0].width, mImageArray[0].height, mType);
1421 getBlitter()->formatConvert(source->getRenderTarget(), sourceRect, mImageArray[0].format, xoffset, yoffset, dest);
1482 if (mImageArray[level].format != mImageArray[0].format)
1513 D3DFORMAT format = selectFormat(mImageArray[0].format, mType);
1515 HRESULT result = device->CreateTexture(mWidth, mHeight, creationLevels(mWidth, mHeight, 0), 0, format, D3DPOOL_DEFAULT, &texture, NULL);
1564 D3DFORMAT format = selectFormat(mImageArray[0].format, mType);
1566 HRESULT result = device->CreateTexture(mWidth, mHeight, creationLevels(mWidth, mHeight, 0), D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL);
1664 mImageArray[i].format = mImageArray[0].format;
1698 createSurface(mImageArray[i].width, mImageArray[i].height, mImageArray[i].format, mType, &mImageArray[i]);
1774 return mImageArray[0][0].format;
1777 void TextureCubeMap::setImagePosX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1779 setImage(0, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1782 void TextureCubeMap::setImageNegX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1784 setImage(1, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1787 void TextureCubeMap::setImagePosY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1789 setImage(2, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1792 void TextureCubeMap::setImageNegY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1794 setImage(3, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1797 void TextureCubeMap::setImagePosZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1799 setImage(4, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1802 void TextureCubeMap::setImageNegZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1804 setImage(5, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1849 void TextureCubeMap::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1851 if (Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, &mImageArray[faceIndex(target)][level]))
1857 void TextureCubeMap::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
1859 if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[faceIndex(target)][level]))
1922 if (mImageArray[face][level].format != mImageArray[0][0].format)
1949 D3DFORMAT format = selectFormat(mImageArray[0][0].format, mType);
1953 HRESULT result = device->CreateCubeTexture(mWidth, creationLevels(mWidth, 0), 0, format, D3DPOOL_DEFAULT, &texture, NULL);
2005 D3DFORMAT format = selectFormat(mImageArray[0][0].format, mType);
2007 HRESULT result = device->CreateCubeTexture(mWidth, creationLevels(mWidth, 0), D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL);
2074 void TextureCubeMap::setImage(int face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
2078 Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[face][level]);
2109 // Call this when a particular level of the texture must be defined with a specific format, width and height.
2118 bool textureOkay = (sizeOkay && internalFormat == mImageArray[0][0].format);
2123 mImageArray[0][0].format, mImageArray[0][0].width,
2153 mImageArray[0][0].format = internalFormat;
2207 mImageArray[faceindex][level].format = internalFormat;
2259 bool redefined = redefineTexture(0, mImageArray[0][0].format, mImageArray[0][0].width);
2287 getBlitter()->formatConvert(source->getRenderTarget(), sourceRect, mImageArray[0][0].format, xoffset, yoffset, dest);
2303 || mImageArray[f][0].format != mImageArray[0][0].format)
2333 mImageArray[f][i].format = mImageArray[f][0].format;
2369 createSurface(mImageArray[f][i].width, mImageArray[f][i].height, mImageArray[f][i].format, mType, &mImageArray[f][i]);