I’m trying to create an If statement in c++ that will act based on the GL_RENDERER.
In engine.cpp Im trying
Shown here
void operator()(osg::GraphicsContext* graphicsContext) override
{
Log(Debug::Info) << "OpenGL Vendor: " << glGetString(GL_VENDOR);
Log(Debug::Info) << "OpenGL Renderer: " << glGetString(GL_RENDERER);
Log(Debug::Info) << "OpenGL Version: " << glGetString(GL_VERSION);
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &mMaxTextureImageUnits);
glGetString(GL_RENDERER, &mRenderer);
}
int getMaxTextureImageUnits() const
{
if (mMaxTextureImageUnits == 0)
throw std::logic_error("mMaxTextureImageUnits is not initialized");
return mMaxTextureImageUnits;
}
private:
int mMaxTextureImageUnits = 0;
std::string mRenderer = "";
};
then in postprocesser.cpp
Shown here
if (reinterpret_cast<const char*>(GL_RENDERER_INFO) == "GL4ES wrapper") {
mCanvases[frameId]->setTextureDepth(getTexture(Tex_Depth, frameId));
} else {
mCanvases[frameId]->setTextureDepth(getTexture(Tex_OpaqueDepth, frameId));
}
mCanvases[frameId]->setTextureDistortion(getTexture(Tex_Distortion, frameId));
what am I missing here…