1
0
Fork 0

source/GraphicsOpenGL.cpp: in getVersion() use std::string for 'prof' variable (gcc throws warnings about char pointer)

This commit is contained in:
Henrik Hautakoski 2019-06-01 18:06:38 +02:00
parent c590b5b16a
commit 179b5c93a0

View file

@ -1,6 +1,7 @@
#include <Spectre/Graphics.h>
#include <Spectre/Graphics/OpenGL.h>
#include <string>
Graphics::Graphics(PlatformApplication *platform)
{
@ -41,10 +42,10 @@ std::string Graphics::getVersion() const
{
char buf[512];
std::string prof = "Compability";
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);
@ -52,7 +53,7 @@ std::string Graphics::getVersion() const
prof = "Core";
}
snprintf(buf, sizeof(buf), "OpenGL %s %s profile - %s %s", ver, prof, ren, ven);
snprintf(buf, sizeof(buf), "OpenGL %s %s profile - %s %s", ver, prof.c_str(), ren, ven);
return std::string(buf);
}