Fixed GpuQuery bug

Also added GpuQuery::GetOpenGLID()


Former-commit-id: 2a5d01a945ffeb576b5dce6756dbffcc511c237c
This commit is contained in:
Lynix 2013-09-06 17:17:47 +02:00
parent cbd7b1c36e
commit 66a64fb71c
2 changed files with 11 additions and 1 deletions

View File

@ -24,10 +24,14 @@ class NAZARA_API NzGpuQuery : NzNonCopyable
bool IsResultAvailable() const;
// Fonctions OpenGL
unsigned int GetOpenGLID() const;
static bool IsModeSupported(nzGpuQueryMode mode);
static bool IsSupported();
private:
nzGpuQueryMode m_mode;
unsigned int m_id;
};

View File

@ -64,6 +64,7 @@ void NzGpuQuery::Begin(nzGpuQueryMode mode)
}
#endif
m_mode = mode;
glBeginQuery(NzOpenGL::QueryMode[mode], m_id);
}
@ -77,7 +78,7 @@ void NzGpuQuery::End()
}
#endif
glEndQuery(GL_SAMPLES_PASSED);
glEndQuery(NzOpenGL::QueryMode[m_mode]);
}
unsigned int NzGpuQuery::GetResult() const
@ -100,6 +101,11 @@ bool NzGpuQuery::IsResultAvailable() const
return available == GL_TRUE;
}
unsigned int NzGpuQuery::GetOpenGLID() const
{
return m_id;
}
bool NzGpuQuery::IsModeSupported(nzGpuQueryMode mode)
{
switch (mode)