Aded Renderer::GetMaxTextureSize()
+ minor changes Former-commit-id: 6b80280d018c323ceb393c58aab96d68a15f3ff2
This commit is contained in:
parent
5cbdd8832c
commit
72a24c4d7c
|
|
@ -57,6 +57,7 @@ class NAZARA_API NzRenderer
|
||||||
static nzUInt8 GetMaxAnisotropyLevel();
|
static nzUInt8 GetMaxAnisotropyLevel();
|
||||||
static unsigned int GetMaxColorAttachments();
|
static unsigned int GetMaxColorAttachments();
|
||||||
static unsigned int GetMaxRenderTargets();
|
static unsigned int GetMaxRenderTargets();
|
||||||
|
static unsigned int GetMaxTextureSize();
|
||||||
static unsigned int GetMaxTextureUnits();
|
static unsigned int GetMaxTextureUnits();
|
||||||
static unsigned int GetMaxVertexAttribs();
|
static unsigned int GetMaxVertexAttribs();
|
||||||
static float GetPointSize();
|
static float GetPointSize();
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ namespace
|
||||||
bool s_useVertexArrayObjects;
|
bool s_useVertexArrayObjects;
|
||||||
unsigned int s_maxColorAttachments;
|
unsigned int s_maxColorAttachments;
|
||||||
unsigned int s_maxRenderTarget;
|
unsigned int s_maxRenderTarget;
|
||||||
|
unsigned int s_maxTextureSize;
|
||||||
unsigned int s_maxTextureUnit;
|
unsigned int s_maxTextureUnit;
|
||||||
unsigned int s_maxVertexAttribs;
|
unsigned int s_maxVertexAttribs;
|
||||||
|
|
||||||
|
|
@ -612,6 +613,11 @@ unsigned int NzRenderer::GetMaxRenderTargets()
|
||||||
return s_maxRenderTarget;
|
return s_maxRenderTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int NzRenderer::GetMaxTextureSize()
|
||||||
|
{
|
||||||
|
return s_maxTextureSize;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int NzRenderer::GetMaxTextureUnits()
|
unsigned int NzRenderer::GetMaxTextureUnits()
|
||||||
{
|
{
|
||||||
return s_maxTextureUnit;
|
return s_maxTextureUnit;
|
||||||
|
|
@ -706,19 +712,19 @@ bool NzRenderer::Initialize()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Récupération des capacités d'OpenGL
|
// Récupération des capacités d'OpenGL
|
||||||
s_capabilities[nzRendererCap_AnisotropicFilter] = NzOpenGL::IsSupported(nzOpenGLExtension_AnisotropicFilter);
|
s_capabilities[nzRendererCap_AnisotropicFilter] = NzOpenGL::IsSupported(nzOpenGLExtension_AnisotropicFilter);
|
||||||
s_capabilities[nzRendererCap_ConditionalRendering] = NzOpenGL::IsSupported(nzOpenGLExtension_ConditionalRender);
|
s_capabilities[nzRendererCap_ConditionalRendering] = NzOpenGL::IsSupported(nzOpenGLExtension_ConditionalRender);
|
||||||
s_capabilities[nzRendererCap_FP64] = NzOpenGL::IsSupported(nzOpenGLExtension_FP64);
|
s_capabilities[nzRendererCap_FP64] = NzOpenGL::IsSupported(nzOpenGLExtension_FP64);
|
||||||
s_capabilities[nzRendererCap_HardwareBuffer] = true; // Natif depuis OpenGL 1.5
|
s_capabilities[nzRendererCap_HardwareBuffer] = true; // Natif depuis OpenGL 1.5
|
||||||
s_capabilities[nzRendererCap_Instancing] = NzOpenGL::IsSupported(nzOpenGLExtension_DrawInstanced) && NzOpenGL::IsSupported(nzOpenGLExtension_InstancedArray);
|
s_capabilities[nzRendererCap_Instancing] = NzOpenGL::IsSupported(nzOpenGLExtension_DrawInstanced) && NzOpenGL::IsSupported(nzOpenGLExtension_InstancedArray);
|
||||||
s_capabilities[nzRendererCap_MultipleRenderTargets] = (glBindFragDataLocation != nullptr); // Natif depuis OpenGL 2.0 mais inutile sans glBindFragDataLocation
|
s_capabilities[nzRendererCap_MultipleRenderTargets] = (glBindFragDataLocation != nullptr); // Natif depuis OpenGL 2.0 mais inutile sans glBindFragDataLocation
|
||||||
s_capabilities[nzRendererCap_OcclusionQuery] = true; // Natif depuis OpenGL 1.5
|
s_capabilities[nzRendererCap_OcclusionQuery] = true; // Natif depuis OpenGL 1.5
|
||||||
s_capabilities[nzRendererCap_PixelBufferObject] = NzOpenGL::IsSupported(nzOpenGLExtension_PixelBufferObject);
|
s_capabilities[nzRendererCap_PixelBufferObject] = NzOpenGL::IsSupported(nzOpenGLExtension_PixelBufferObject);
|
||||||
s_capabilities[nzRendererCap_RenderTexture] = NzOpenGL::IsSupported(nzOpenGLExtension_FrameBufferObject);
|
s_capabilities[nzRendererCap_RenderTexture] = NzOpenGL::IsSupported(nzOpenGLExtension_FrameBufferObject);
|
||||||
s_capabilities[nzRendererCap_Texture3D] = true; // Natif depuis OpenGL 1.2
|
s_capabilities[nzRendererCap_Texture3D] = true; // Natif depuis OpenGL 1.2
|
||||||
s_capabilities[nzRendererCap_TextureCubemap] = true; // Natif depuis OpenGL 1.3
|
s_capabilities[nzRendererCap_TextureCubemap] = true; // Natif depuis OpenGL 1.3
|
||||||
s_capabilities[nzRendererCap_TextureMulti] = true; // Natif depuis OpenGL 1.3
|
s_capabilities[nzRendererCap_TextureMulti] = true; // Natif depuis OpenGL 1.3
|
||||||
s_capabilities[nzRendererCap_TextureNPOT] = true; // Natif depuis OpenGL 2.0
|
s_capabilities[nzRendererCap_TextureNPOT] = true; // Natif depuis OpenGL 2.0
|
||||||
|
|
||||||
NzContext::EnsureContext();
|
NzContext::EnsureContext();
|
||||||
|
|
||||||
|
|
@ -762,6 +768,10 @@ bool NzRenderer::Initialize()
|
||||||
else
|
else
|
||||||
s_maxTextureUnit = 1;
|
s_maxTextureUnit = 1;
|
||||||
|
|
||||||
|
GLint maxTextureSize;
|
||||||
|
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
|
||||||
|
s_maxTextureSize = maxTextureSize;
|
||||||
|
|
||||||
GLint maxVertexAttribs;
|
GLint maxVertexAttribs;
|
||||||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
|
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
|
||||||
s_maxVertexAttribs = static_cast<unsigned int>(maxVertexAttribs);
|
s_maxVertexAttribs = static_cast<unsigned int>(maxVertexAttribs);
|
||||||
|
|
@ -1966,7 +1976,8 @@ void NzRenderer::OnTextureReleased(const NzTexture* texture)
|
||||||
{
|
{
|
||||||
if (unit.texture == texture)
|
if (unit.texture == texture)
|
||||||
unit.texture = nullptr;
|
unit.texture = nullptr;
|
||||||
// Inutile de changer le flag pour une texture désactivée
|
|
||||||
|
// Inutile de changer le flag pour une texture désactivée
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue