Removed support for OpenGL 2

Former-commit-id: e796c333d6c2ef0550ff4427d36dcfbaf00ef924
This commit is contained in:
Lynix
2015-01-30 15:39:25 +01:00
parent 993b2e4145
commit db4a499151
30 changed files with 160 additions and 1151 deletions

View File

@@ -163,12 +163,12 @@ bool NzTexture::Create(nzImageType type, nzPixelFormat format, unsigned int widt
}
m_impl = new NzTextureImpl;
m_impl->depth = GetValidSize(depth);
m_impl->depth = depth;
m_impl->format = format;
m_impl->height = GetValidSize(height);
m_impl->height = height;
m_impl->levelCount = levelCount;
m_impl->type = type;
m_impl->width = GetValidSize(width);
m_impl->width = width;
glGenTextures(1, &m_impl->id);
NzOpenGL::BindTexture(m_impl->type, m_impl->id);
@@ -1038,20 +1038,6 @@ unsigned int NzTexture::GetOpenGLID() const
return m_impl->id;
}
unsigned int NzTexture::GetValidSize(unsigned int size)
{
if (NzRenderer::HasCapability(nzRendererCap_TextureNPOT))
return size;
else
{
unsigned int pot = 1;
while (pot < size)
pot <<= 1;
return pot;
}
}
bool NzTexture::IsFormatSupported(nzPixelFormat format)
{
switch (format)
@@ -1104,14 +1090,14 @@ bool NzTexture::IsFormatSupported(nzPixelFormat format)
case nzPixelFormat_RGBA32F:
case nzPixelFormat_RGBA32I:
case nzPixelFormat_RGBA32UI:
return NzOpenGL::GetVersion() >= 300;
return true;
// Formats de profondeur (Supportés avec les FBOs)
case nzPixelFormat_Depth16:
case nzPixelFormat_Depth24:
case nzPixelFormat_Depth32:
case nzPixelFormat_Depth24Stencil8:
return NzOpenGL::IsSupported(nzOpenGLExtension_FrameBufferObject);
return true;
// Formats de stencil (Non supportés pour les textures)
case nzPixelFormat_Stencil1:
@@ -1144,14 +1130,12 @@ bool NzTexture::IsTypeSupported(nzImageType type)
switch (type)
{
case nzImageType_1D:
case nzImageType_1D_Array:
case nzImageType_2D:
case nzImageType_2D_Array:
case nzImageType_3D:
case nzImageType_Cubemap:
return true; // Tous supportés nativement dans OpenGL 2
case nzImageType_1D_Array:
case nzImageType_2D_Array:
return NzOpenGL::IsSupported(nzOpenGLExtension_TextureArray);
return true; // Tous supportés nativement dans OpenGL 3
}
NazaraError("Image type not handled (0x" + NzString::Number(type, 16) + ')');