Added A8 pixel format

PixelFormat::GetBytesPerPixel() will no longer warn with
less-than-one-byte formats

Former-commit-id: af41f0c2bc7a35c2ee617980878628ff1c8bf868
This commit is contained in:
Lynix
2014-12-07 03:09:39 +01:00
parent 4b2e3370d9
commit d22c4a5ac9
5 changed files with 121 additions and 19 deletions

View File

@@ -1465,6 +1465,9 @@ bool NzOpenGL::TranslateFormat(nzPixelFormat pixelFormat, Format* format, Format
{
switch (pixelFormat)
{
case nzPixelFormat_A8:
return false; ///FIXME: Tester le mode d'OpenGL pour se permettre une fonctionnalité dépréciée ?
case nzPixelFormat_BGR8:
format->dataFormat = GL_BGR;
format->dataType = GL_UNSIGNED_BYTE;

View File

@@ -1272,6 +1272,13 @@ bool NzTexture::IsFormatSupported(nzPixelFormat format)
case nzPixelFormat_RGBA32UI:
return NzOpenGL::GetVersion() >= 300;
// Dépréciés depuis OpenGL 3
///FIXME: Accepter si le contexte OpenGL est de compatibilité/OpenGL 2 ?
case nzPixelFormat_A8:
case nzPixelFormat_L8:
case nzPixelFormat_LA8:
return false;
// Formats de profondeur (Supportés avec les FBOs)
case nzPixelFormat_Depth16:
case nzPixelFormat_Depth24:
@@ -1286,12 +1293,7 @@ bool NzTexture::IsFormatSupported(nzPixelFormat format)
case nzPixelFormat_Stencil16:
return false;
// Dépréciés depuis OpenGL 3
///FIXME: Il doit bien exister des remplaçants (GL_RED ?)
case nzPixelFormat_L8:
case nzPixelFormat_LA8:
return false;
// Formats compressés
case nzPixelFormat_DXT1:
case nzPixelFormat_DXT3:
case nzPixelFormat_DXT5:
@@ -1302,7 +1304,6 @@ bool NzTexture::IsFormatSupported(nzPixelFormat format)
}
NazaraError("Invalid pixel format");
return false;
}