mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-19 15:39:49 +00:00
Log OpenGL Vendor, Renderer and Version on startup
This commit is contained in:
parent
7d3c5f529a
commit
d66907ba67
3 changed files with 48 additions and 1 deletions
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include <components/sceneutil/screencapture.hpp>
|
||||
#include <components/sceneutil/depth.hpp>
|
||||
#include <components/sceneutil/util.hpp>
|
||||
|
||||
#include "mwinput/inputmanagerimp.hpp"
|
||||
|
||||
|
@ -239,6 +240,20 @@ namespace
|
|||
{
|
||||
void operator()(std::string) const {}
|
||||
};
|
||||
|
||||
class IdentifyOpenGLOperation : public osg::GraphicsOperation
|
||||
{
|
||||
public:
|
||||
IdentifyOpenGLOperation() : GraphicsOperation("IdentifyOpenGLOperation", false)
|
||||
{}
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void OMW::Engine::executeLocalScripts()
|
||||
|
@ -643,8 +658,12 @@ void OMW::Engine::createWindow(Settings::Manager& settings)
|
|||
camera->setGraphicsContext(graphicsWindow);
|
||||
camera->setViewport(0, 0, graphicsWindow->getTraits()->width, graphicsWindow->getTraits()->height);
|
||||
|
||||
osg::ref_ptr<SceneUtil::OperationSequence> realizeOperations = new SceneUtil::OperationSequence(false);
|
||||
mViewer->setRealizeOperation(realizeOperations);
|
||||
realizeOperations->add(new IdentifyOpenGLOperation());
|
||||
|
||||
if (Debug::shouldDebugOpenGL())
|
||||
mViewer->setRealizeOperation(new Debug::EnableGLDebugOperation());
|
||||
realizeOperations->add(new Debug::EnableGLDebugOperation());
|
||||
|
||||
mViewer->realize();
|
||||
|
||||
|
|
|
@ -317,4 +317,20 @@ bool attachAlphaToCoverageFriendlyFramebufferToCamera(osg::Camera* camera, osg::
|
|||
return addMSAAIntermediateTarget;
|
||||
}
|
||||
|
||||
OperationSequence::OperationSequence(bool keep)
|
||||
: Operation("OperationSequence", keep)
|
||||
, mOperationQueue(new osg::OperationQueue())
|
||||
{
|
||||
}
|
||||
|
||||
void OperationSequence::operator()(osg::Object* object)
|
||||
{
|
||||
mOperationQueue->runOperations(object);
|
||||
}
|
||||
|
||||
void OperationSequence::add(osg::Operation* operation)
|
||||
{
|
||||
mOperationQueue->add(operation);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,6 +63,18 @@ namespace SceneUtil
|
|||
|
||||
// Alpha-to-coverage requires a multisampled framebuffer, so we need to set that up for RTTs
|
||||
bool attachAlphaToCoverageFriendlyFramebufferToCamera(osg::Camera* camera, osg::Camera::BufferComponent buffer, osg::Texture* texture, unsigned int level = 0, unsigned int face = 0, bool mipMapGeneration = false);
|
||||
|
||||
class OperationSequence : public osg::Operation
|
||||
{
|
||||
public:
|
||||
OperationSequence(bool keep);
|
||||
|
||||
void operator()(osg::Object* object) override;
|
||||
|
||||
void add(osg::Operation* operation);
|
||||
protected:
|
||||
osg::ref_ptr<osg::OperationQueue> mOperationQueue;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue