Fixed GpuQuery bug
Also added GpuQuery::GetOpenGLID() Former-commit-id: 2a5d01a945ffeb576b5dce6756dbffcc511c237c
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user