source/GraphicsOpenGL.cpp: implement getVersion()
This commit is contained in:
parent
a0949b981f
commit
03e692cd50
1 changed files with 20 additions and 0 deletions
|
|
@ -37,6 +37,26 @@ void Graphics::shutdown()
|
|||
m_display->destroy();
|
||||
}
|
||||
|
||||
std::string Graphics::getVersion() const
|
||||
{
|
||||
char buf[512];
|
||||
|
||||
char *ver = (char*) glGetString(GL_VERSION);
|
||||
char *ven = (char*) glGetString(GL_VENDOR);
|
||||
char *ren = (char*) glGetString(GL_RENDERER);
|
||||
char *prof = "Compability";
|
||||
GLint flags;
|
||||
|
||||
glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &flags);
|
||||
if (flags & GL_CONTEXT_CORE_PROFILE_BIT) {
|
||||
prof = "Core";
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "OpenGL %s %s profile - %s %s", ver, prof, ren, ven);
|
||||
|
||||
return std::string(buf);
|
||||
}
|
||||
|
||||
void Graphics::setDisplayMode(Display::Mode mode)
|
||||
{
|
||||
m_display->setVideoMode(mode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue