Added NzTexture
Added levelCount parameter to NzImageParams Added NzPixelFormat::HasAlpha Reformatted OpenGL debug messages
This commit is contained in:
@@ -31,18 +31,22 @@ enum nzImageType
|
||||
nzImageType_1D,
|
||||
nzImageType_2D,
|
||||
nzImageType_3D,
|
||||
nzImageType_Cubemap
|
||||
nzImageType_Cubemap,
|
||||
|
||||
nzImageType_Count
|
||||
};
|
||||
|
||||
struct NzImageParams
|
||||
{
|
||||
// GCC 4.7 je te veux
|
||||
NzImageParams() :
|
||||
loadFormat(nzPixelFormat_Undefined)
|
||||
loadFormat(nzPixelFormat_Undefined),
|
||||
levelCount(0)
|
||||
{
|
||||
}
|
||||
|
||||
nzPixelFormat loadFormat;
|
||||
nzUInt8 levelCount;
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
|
||||
@@ -53,6 +53,8 @@ class NzPixelFormat
|
||||
|
||||
static nzUInt8 GetBPP(nzPixelFormat format);
|
||||
|
||||
static bool HasAlpha(nzPixelFormat format);
|
||||
|
||||
static bool IsCompressed(nzPixelFormat format);
|
||||
static bool IsConversionSupported(nzPixelFormat srcFormat, nzPixelFormat dstFormat);
|
||||
static bool IsValid(nzPixelFormat format);
|
||||
@@ -65,7 +67,7 @@ class NzPixelFormat
|
||||
static bool Initialize();
|
||||
static void Uninitialize();
|
||||
|
||||
static ConvertFunction s_convertFunctions[nzPixelFormat_Count][nzPixelFormat_Count];
|
||||
static NAZARA_API ConvertFunction s_convertFunctions[nzPixelFormat_Count][nzPixelFormat_Count];
|
||||
};
|
||||
|
||||
#include <Nazara/Utility/PixelFormat.inl>
|
||||
|
||||
@@ -139,6 +139,24 @@ inline nzUInt8 NzPixelFormat::GetBPP(nzPixelFormat format)
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool NzPixelFormat::HasAlpha(nzPixelFormat format)
|
||||
{
|
||||
switch (format)
|
||||
{
|
||||
case nzPixelFormat_BGRA8:
|
||||
case nzPixelFormat_DXT3:
|
||||
case nzPixelFormat_DXT5:
|
||||
case nzPixelFormat_LA8:
|
||||
case nzPixelFormat_RGB5A1:
|
||||
case nzPixelFormat_RGBA4:
|
||||
case nzPixelFormat_RGBA8:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool NzPixelFormat::IsCompressed(nzPixelFormat format)
|
||||
{
|
||||
switch (format)
|
||||
|
||||
Reference in New Issue
Block a user