Fixed GpuQuery bug
Also added GpuQuery::GetOpenGLID() Former-commit-id: 2a5d01a945ffeb576b5dce6756dbffcc511c237c
This commit is contained in:
parent
cbd7b1c36e
commit
66a64fb71c
|
|
@ -24,10 +24,14 @@ class NAZARA_API NzGpuQuery : NzNonCopyable
|
||||||
|
|
||||||
bool IsResultAvailable() const;
|
bool IsResultAvailable() const;
|
||||||
|
|
||||||
|
// Fonctions OpenGL
|
||||||
|
unsigned int GetOpenGLID() const;
|
||||||
|
|
||||||
static bool IsModeSupported(nzGpuQueryMode mode);
|
static bool IsModeSupported(nzGpuQueryMode mode);
|
||||||
static bool IsSupported();
|
static bool IsSupported();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
nzGpuQueryMode m_mode;
|
||||||
unsigned int m_id;
|
unsigned int m_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ void NzGpuQuery::Begin(nzGpuQueryMode mode)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
m_mode = mode;
|
||||||
glBeginQuery(NzOpenGL::QueryMode[mode], m_id);
|
glBeginQuery(NzOpenGL::QueryMode[mode], m_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,7 +78,7 @@ void NzGpuQuery::End()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
glEndQuery(GL_SAMPLES_PASSED);
|
glEndQuery(NzOpenGL::QueryMode[m_mode]);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int NzGpuQuery::GetResult() const
|
unsigned int NzGpuQuery::GetResult() const
|
||||||
|
|
@ -100,6 +101,11 @@ bool NzGpuQuery::IsResultAvailable() const
|
||||||
return available == GL_TRUE;
|
return available == GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int NzGpuQuery::GetOpenGLID() const
|
||||||
|
{
|
||||||
|
return m_id;
|
||||||
|
}
|
||||||
|
|
||||||
bool NzGpuQuery::IsModeSupported(nzGpuQueryMode mode)
|
bool NzGpuQuery::IsModeSupported(nzGpuQueryMode mode)
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue