1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 17:29:55 +00:00
openmw/components/myguiplatform/myguirendermanager.cpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

567 lines
20 KiB
C++
Raw Normal View History

2015-04-24 19:55:30 +00:00
#include "myguirendermanager.hpp"
#include <MyGUI_Timer.h>
#include <osg/Drawable>
#include <osg/TexMat>
2015-04-24 19:55:30 +00:00
#include <osg/Texture2D>
#include <osgViewer/Viewer>
#include <osgGA/GUIEventHandler>
2016-02-05 22:03:53 +00:00
#include <components/resource/imagemanager.hpp>
#include <components/sceneutil/nodecallback.hpp>
2021-07-22 22:55:30 +00:00
#include <components/shader/shadermanager.hpp>
2015-04-24 19:55:30 +00:00
2015-04-30 22:59:41 +00:00
#include "myguitexture.hpp"
2015-04-24 19:55:30 +00:00
#define MYGUI_PLATFORM_LOG_SECTION "Platform"
#define MYGUI_PLATFORM_LOG(level, text) MYGUI_LOGGING(MYGUI_PLATFORM_LOG_SECTION, level, text)
#define MYGUI_PLATFORM_EXCEPT(dest) \
do \
{ \
MYGUI_PLATFORM_LOG(Critical, dest); \
std::ostringstream stream; \
stream << dest << "\n"; \
MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \
} while (0)
2022-09-22 18:26:05 +00:00
2015-04-24 19:55:30 +00:00
#define MYGUI_PLATFORM_ASSERT(exp, dest) \
do \
{ \
if (!(exp)) \
{ \
MYGUI_PLATFORM_LOG(Critical, dest); \
std::ostringstream stream; \
stream << dest << "\n"; \
MYGUI_BASE_EXCEPT(stream.str().c_str(), "MyGUI"); \
} \
} while (0)
2015-04-30 23:15:25 +00:00
namespace osgMyGUI
2015-04-24 19:55:30 +00:00
{
class Drawable : public osg::Drawable
{
osgMyGUI::RenderManager* mParent;
osg::ref_ptr<osg::StateSet> mStateSet;
public:
// Stage 0: update widget animations and controllers. Run during the Update traversal.
class FrameUpdate : public SceneUtil::NodeCallback<FrameUpdate>
{
public:
FrameUpdate()
2015-06-08 01:26:36 +00:00
: mRenderManager(nullptr)
{
}
2021-07-22 22:55:30 +00:00
void setRenderManager(osgMyGUI::RenderManager* renderManager) { mRenderManager = renderManager; }
2020-11-13 07:39:47 +00:00
void operator()(osg::Node*, osg::NodeVisitor*) { mRenderManager->update(); }
2018-11-08 17:10:23 +00:00
private:
osgMyGUI::RenderManager* mRenderManager;
};
2022-09-22 18:26:05 +00:00
2018-11-08 17:10:23 +00:00
// Stage 1: collect draw calls. Run during the Cull traversal.
class CollectDrawCalls : public SceneUtil::NodeCallback<CollectDrawCalls>
2022-09-22 18:26:05 +00:00
{
public:
CollectDrawCalls()
2018-11-08 17:10:23 +00:00
: mRenderManager(nullptr)
{
}
void setRenderManager(osgMyGUI::RenderManager* renderManager) { mRenderManager = renderManager; }
void operator()(osg::Node*, osg::NodeVisitor*) { mRenderManager->collectDrawCalls(); }
2015-05-08 23:06:55 +00:00
private:
osgMyGUI::RenderManager* mRenderManager;
};
// Stage 2: execute the draw calls. Run during the Draw traversal. May run in parallel with the update traversal
// of the next frame.
void drawImplementation(osg::RenderInfo& renderInfo) const override
2022-09-22 18:26:05 +00:00
{
osg::State* state = renderInfo.getState();
state->pushStateSet(mStateSet);
state->apply();
state->disableAllVertexArrays();
state->setClientActiveTextureUnit(0);
glEnableClientState(GL_VERTEX_ARRAY);
2021-07-22 22:55:30 +00:00
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
2015-06-08 01:26:36 +00:00
mReadFrom = (mReadFrom + 1) % sNumBuffers;
const std::vector<Batch>& vec = mBatchVector[mReadFrom];
for (std::vector<Batch>::const_iterator it = vec.begin(); it != vec.end(); ++it)
2022-09-22 18:26:05 +00:00
{
const Batch& batch = *it;
osg::VertexBufferObject* vbo = batch.mVertexBuffer;
2022-09-22 18:26:05 +00:00
if (batch.mStateSet)
2022-09-22 18:26:05 +00:00
{
state->pushStateSet(batch.mStateSet);
state->apply();
2022-09-22 18:26:05 +00:00
}
// A GUI element without an associated texture would be extremely rare.
// It is worth it to use a dummy 1x1 black texture sampler instead of either adding a conditional or
// relinking shaders.
osg::Texture2D* texture = batch.mTexture;
if (texture)
state->applyTextureAttribute(0, texture);
2022-09-22 18:26:05 +00:00
else
state->applyTextureAttribute(0, mDummyTexture);
2022-09-22 18:26:05 +00:00
osg::GLBufferObject* bufferobject = state->isVertexBufferObjectSupported()
2020-11-13 07:39:47 +00:00
? vbo->getOrCreateGLBufferObject(state->getContextID())
: nullptr;
if (bufferobject)
2022-09-22 18:26:05 +00:00
{
state->bindVertexBufferObject(bufferobject);
2022-09-22 18:26:05 +00:00
glVertexPointer(3, GL_FLOAT, sizeof(MyGUI::Vertex), reinterpret_cast<char*>(0));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(MyGUI::Vertex), reinterpret_cast<char*>(12));
glTexCoordPointer(2, GL_FLOAT, sizeof(MyGUI::Vertex), reinterpret_cast<char*>(16));
2022-09-22 18:26:05 +00:00
}
else
{
glVertexPointer(3, GL_FLOAT, sizeof(MyGUI::Vertex),
reinterpret_cast<const char*>(vbo->getArray(0)->getDataPointer()));
glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(MyGUI::Vertex),
reinterpret_cast<const char*>(vbo->getArray(0)->getDataPointer()) + 12);
glTexCoordPointer(2, GL_FLOAT, sizeof(MyGUI::Vertex),
reinterpret_cast<const char*>(vbo->getArray(0)->getDataPointer()) + 16);
2022-09-22 18:26:05 +00:00
}
glDrawArrays(GL_TRIANGLES, 0, batch.mVertexCount);
2022-09-22 18:26:05 +00:00
if (batch.mStateSet)
2022-09-22 18:26:05 +00:00
{
state->popStateSet();
state->apply();
2022-09-22 18:26:05 +00:00
}
}
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
state->popStateSet();
state->unbindVertexBufferObject();
state->dirtyAllVertexArrays();
state->disableAllVertexArrays();
}
2022-09-22 18:26:05 +00:00
public:
Drawable(osgMyGUI::RenderManager* parent = nullptr)
: mParent(parent)
, mWriteTo(0)
, mReadFrom(0)
2022-09-22 18:26:05 +00:00
{
setSupportsDisplayList(false);
2022-09-22 18:26:05 +00:00
osg::ref_ptr<CollectDrawCalls> collectDrawCalls = new CollectDrawCalls;
collectDrawCalls->setRenderManager(mParent);
setCullCallback(collectDrawCalls);
2022-09-22 18:26:05 +00:00
osg::ref_ptr<FrameUpdate> frameUpdate = new FrameUpdate;
frameUpdate->setRenderManager(mParent);
setUpdateCallback(frameUpdate);
2022-09-22 18:26:05 +00:00
mStateSet = new osg::StateSet;
mStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
mStateSet->setTextureMode(0, GL_TEXTURE_2D, osg::StateAttribute::ON);
mStateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
mStateSet->setMode(GL_BLEND, osg::StateAttribute::ON);
2022-09-22 18:26:05 +00:00
2021-07-22 22:55:30 +00:00
mDummyTexture = new osg::Texture2D;
mDummyTexture->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
mDummyTexture->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
2021-07-22 22:55:30 +00:00
mDummyTexture->setInternalFormat(GL_RGB);
mDummyTexture->setTextureSize(1, 1);
2022-09-22 18:26:05 +00:00
// need to flip tex coords since MyGUI uses DirectX convention of top left image origin
osg::Matrix flipMat;
flipMat.preMultTranslate(osg::Vec3f(0, 1, 0));
flipMat.preMultScale(osg::Vec3f(1, -1, 1));
mStateSet->setTextureAttribute(0, new osg::TexMat(flipMat), osg::StateAttribute::ON);
}
Drawable(const Drawable& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY)
: osg::Drawable(copy, copyop)
, mParent(copy.mParent)
, mStateSet(copy.mStateSet)
2015-07-01 01:42:04 +00:00
, mWriteTo(0)
, mReadFrom(0)
2021-07-22 22:55:30 +00:00
, mDummyTexture(copy.mDummyTexture)
2022-09-22 18:26:05 +00:00
{
}
// Defines the necessary information for a draw call
struct Batch
2022-09-22 18:26:05 +00:00
{
// May be empty
osg::ref_ptr<osg::Texture2D> mTexture;
2021-07-22 22:55:30 +00:00
osg::ref_ptr<osg::VertexBufferObject> mVertexBuffer;
// need to hold on to this too as the mVertexBuffer does not hold a ref to its own array
osg::ref_ptr<osg::Array> mArray;
// optional
osg::ref_ptr<osg::StateSet> mStateSet;
2015-06-08 01:26:36 +00:00
size_t mVertexCount;
};
void addBatch(const Batch& batch) { mBatchVector[mWriteTo].push_back(batch); }
2015-06-02 23:18:03 +00:00
void clear()
2022-09-22 18:26:05 +00:00
{
mWriteTo = (mWriteTo + 1) % sNumBuffers;
mBatchVector[mWriteTo].clear();
2022-09-22 18:26:05 +00:00
}
2021-07-22 22:55:30 +00:00
osg::StateSet* getDrawableStateSet() { return mStateSet; }
META_Object(osgMyGUI, Drawable)
2015-04-24 19:55:30 +00:00
2022-09-22 18:26:05 +00:00
private:
2015-04-24 19:55:30 +00:00
// 2 would be enough in most cases, use 4 to get stereo working
static const int sNumBuffers = 4;
// double buffering approach, to avoid the need for synchronization with the draw thread
std::vector<Batch> mBatchVector[sNumBuffers];
int mWriteTo;
mutable int mReadFrom;
2015-04-24 19:55:30 +00:00
osg::ref_ptr<osg::Texture2D> mDummyTexture;
2022-09-22 18:26:05 +00:00
};
2015-04-24 19:55:30 +00:00
class OSGVertexBuffer : public MyGUI::IVertexBuffer
2022-09-22 18:26:05 +00:00
{
osg::ref_ptr<osg::VertexBufferObject> mBuffer[2];
osg::ref_ptr<osg::UByteArray> mVertexArray[2];
size_t mNeedVertexCount;
unsigned int mCurrentBuffer;
bool mUsed; // has the mCurrentBuffer been submitted to the rendering thread
2015-04-24 19:55:30 +00:00
void destroy();
osg::UByteArray* create();
2015-04-24 19:55:30 +00:00
2022-09-22 18:26:05 +00:00
public:
2015-04-24 19:55:30 +00:00
OSGVertexBuffer();
virtual ~OSGVertexBuffer() {}
2015-04-24 19:55:30 +00:00
void markUsed();
2015-04-24 19:55:30 +00:00
osg::Array* getVertexArray();
osg::VertexBufferObject* getVertexBuffer();
2015-04-24 19:55:30 +00:00
void setVertexCount(size_t count) override;
size_t getVertexCount() const override;
MyGUI::Vertex* lock() override;
void unlock() override;
};
2021-12-16 18:48:10 +00:00
OSGVertexBuffer::OSGVertexBuffer()
2015-04-24 19:55:30 +00:00
: mNeedVertexCount(0)
, mCurrentBuffer(0)
, mUsed(false)
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
}
void OSGVertexBuffer::markUsed()
{
mUsed = true;
}
2022-09-22 18:26:05 +00:00
void OSGVertexBuffer::setVertexCount(size_t count)
{
if (count == mNeedVertexCount)
return;
2022-09-22 18:26:05 +00:00
mNeedVertexCount = count;
}
2022-09-22 18:26:05 +00:00
size_t OSGVertexBuffer::getVertexCount() const
{
return mNeedVertexCount;
}
MyGUI::Vertex* OSGVertexBuffer::lock()
2022-09-22 18:26:05 +00:00
{
if (mUsed)
2022-09-22 18:26:05 +00:00
{
mCurrentBuffer = (mCurrentBuffer + 1) % 2;
2015-04-24 19:55:30 +00:00
mUsed = false;
2022-09-22 18:26:05 +00:00
}
osg::UByteArray* array = mVertexArray[mCurrentBuffer];
if (!array)
2022-09-22 18:26:05 +00:00
{
array = create();
2022-09-22 18:26:05 +00:00
}
else if (array->size() != mNeedVertexCount * sizeof(MyGUI::Vertex))
2022-09-22 18:26:05 +00:00
{
array->resize(mNeedVertexCount * sizeof(MyGUI::Vertex));
2015-04-24 19:55:30 +00:00
}
return (MyGUI::Vertex*)&(*array)[0];
2015-04-24 19:55:30 +00:00
}
void OSGVertexBuffer::unlock()
2015-04-24 19:55:30 +00:00
{
mVertexArray[mCurrentBuffer]->dirty();
mBuffer[mCurrentBuffer]->dirty();
2022-09-22 18:26:05 +00:00
}
osg::UByteArray* OSGVertexBuffer::create()
2022-09-22 18:26:05 +00:00
{
mVertexArray[mCurrentBuffer] = new osg::UByteArray(mNeedVertexCount * sizeof(MyGUI::Vertex));
mBuffer[mCurrentBuffer] = new osg::VertexBufferObject;
mBuffer[mCurrentBuffer]->setDataVariance(osg::Object::DYNAMIC);
mBuffer[mCurrentBuffer]->setUsage(GL_DYNAMIC_DRAW);
// NB mBuffer does not own the array
mBuffer[mCurrentBuffer]->setArray(0, mVertexArray[mCurrentBuffer].get());
2015-04-24 19:55:30 +00:00
return mVertexArray[mCurrentBuffer];
}
2015-04-24 19:55:30 +00:00
osg::Array* OSGVertexBuffer::getVertexArray()
{
return mVertexArray[mCurrentBuffer];
2015-04-24 19:55:30 +00:00
}
osg::VertexBufferObject* OSGVertexBuffer::getVertexBuffer()
2022-09-22 18:26:05 +00:00
{
return mBuffer[mCurrentBuffer];
2022-09-22 18:26:05 +00:00
}
2015-04-24 19:55:30 +00:00
// ---------------------------------------------------------------------------
2022-09-22 18:26:05 +00:00
RenderManager::RenderManager(
osgViewer::Viewer* viewer, osg::Group* sceneroot, Resource::ImageManager* imageManager, float scalingFactor)
2015-04-24 19:55:30 +00:00
: mViewer(viewer)
, mSceneRoot(sceneroot)
, mImageManager(imageManager)
2015-04-24 19:55:30 +00:00
, mUpdate(false)
, mIsInitialise(false)
2015-05-14 22:41:21 +00:00
, mInvScalingFactor(1.f)
2018-10-09 06:21:12 +00:00
, mInjectState(nullptr)
2015-04-24 19:55:30 +00:00
{
2015-05-14 22:41:21 +00:00
if (scalingFactor != 0.f)
mInvScalingFactor = 1.f / scalingFactor;
2015-04-24 19:55:30 +00:00
}
RenderManager::~RenderManager()
{
MYGUI_PLATFORM_LOG(Info, "* Shutdown: " << getClassTypeName());
if (mGuiRoot.valid())
mSceneRoot->removeChild(mGuiRoot.get());
mGuiRoot = nullptr;
mSceneRoot = nullptr;
mViewer = nullptr;
MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully shutdown");
mIsInitialise = false;
}
void RenderManager::initialise()
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
MYGUI_PLATFORM_ASSERT(!mIsInitialise, getClassTypeName() << " initialised twice");
MYGUI_PLATFORM_LOG(Info, "* Initialise: " << getClassTypeName());
mVertexFormat = MyGUI::VertexColourType::ColourABGR;
mUpdate = false;
mDrawable = new Drawable(this);
osg::ref_ptr<osg::Camera> camera = new osg::Camera();
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
2015-04-24 19:55:30 +00:00
camera->setProjectionResizePolicy(osg::Camera::FIXED);
camera->setProjectionMatrix(osg::Matrix::identity());
camera->setViewMatrix(osg::Matrix::identity());
camera->setRenderOrder(osg::Camera::POST_RENDER);
camera->setClearMask(GL_NONE);
mDrawable->setCullingActive(false);
camera->addChild(mDrawable.get());
2015-04-24 19:55:30 +00:00
mGuiRoot = camera;
2016-03-10 12:17:01 +00:00
mSceneRoot->addChild(mGuiRoot.get());
2015-04-24 19:55:30 +00:00
osg::ref_ptr<osg::Viewport> vp = mViewer->getCamera()->getViewport();
setViewSize(vp->width(), vp->height());
2015-04-24 19:55:30 +00:00
MYGUI_PLATFORM_LOG(Info, getClassTypeName() << " successfully initialized");
mIsInitialise = true;
2022-09-22 18:26:05 +00:00
}
2015-04-24 19:55:30 +00:00
void RenderManager::shutdown()
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
mGuiRoot->removeChildren(0, mGuiRoot->getNumChildren());
mSceneRoot->removeChild(mGuiRoot);
}
2015-04-28 14:02:29 +00:00
void RenderManager::enableShaders(Shader::ShaderManager& shaderManager)
{
2023-02-25 19:03:39 +00:00
auto program = shaderManager.getProgram("gui");
2015-04-28 14:02:29 +00:00
2021-07-22 22:55:30 +00:00
mDrawable->getDrawableStateSet()->setAttributeAndModes(program, osg::StateAttribute::ON);
mDrawable->getDrawableStateSet()->addUniform(new osg::Uniform("diffuseMap", 0));
2022-09-22 18:26:05 +00:00
}
2021-07-22 22:55:30 +00:00
MyGUI::IVertexBuffer* RenderManager::createVertexBuffer()
2022-09-22 18:26:05 +00:00
{
2021-07-22 22:55:30 +00:00
return new OSGVertexBuffer();
}
2015-04-24 19:55:30 +00:00
void RenderManager::destroyVertexBuffer(MyGUI::IVertexBuffer* buffer)
{
delete buffer;
}
void RenderManager::begin()
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
mDrawable->clear();
// variance will be recomputed based on textures being rendered in this frame
mDrawable->setDataVariance(osg::Object::STATIC);
}
void RenderManager::doRender(MyGUI::IVertexBuffer* buffer, MyGUI::ITexture* texture, size_t count)
2022-09-22 18:26:05 +00:00
{
Drawable::Batch batch;
batch.mVertexCount = count;
batch.mVertexBuffer = static_cast<OSGVertexBuffer*>(buffer)->getVertexBuffer();
batch.mArray = static_cast<OSGVertexBuffer*>(buffer)->getVertexArray();
static_cast<OSGVertexBuffer*>(buffer)->markUsed();
2015-04-24 19:55:30 +00:00
if (OSGTexture* osgtexture = static_cast<OSGTexture*>(texture))
2022-09-22 18:26:05 +00:00
{
batch.mTexture = osgtexture->getTexture();
if (batch.mTexture->getDataVariance() == osg::Object::DYNAMIC)
mDrawable->setDataVariance(osg::Object::DYNAMIC); // only for this frame, reset in begin()
if (!mInjectState && osgtexture->getInjectState())
batch.mStateSet = osgtexture->getInjectState();
2015-04-24 19:55:30 +00:00
}
if (mInjectState)
batch.mStateSet = mInjectState;
2015-04-24 19:55:30 +00:00
mDrawable->addBatch(batch);
2022-09-22 18:26:05 +00:00
}
void RenderManager::setInjectState(osg::StateSet* stateSet)
{
mInjectState = stateSet;
}
2015-04-24 19:55:30 +00:00
void RenderManager::end() {}
void RenderManager::update()
2015-04-24 19:55:30 +00:00
{
static MyGUI::Timer timer;
static unsigned long last_time = timer.getMilliseconds();
unsigned long now_time = timer.getMilliseconds();
unsigned long time = now_time - last_time;
onFrameEvent((float)((double)(time) / (double)1000));
last_time = now_time;
}
2015-04-24 19:55:30 +00:00
void RenderManager::collectDrawCalls()
{
begin();
2015-04-24 19:55:30 +00:00
onRenderToTarget(this, mUpdate);
end();
2015-04-24 19:55:30 +00:00
mUpdate = false;
}
void RenderManager::setViewSize(int width, int height)
{
if (width < 1)
width = 1;
if (height < 1)
height = 1;
mGuiRoot->setViewport(0, 0, width, height);
2015-05-14 22:41:21 +00:00
mViewSize.set(width * mInvScalingFactor, height * mInvScalingFactor);
2015-04-24 19:55:30 +00:00
mInfo.maximumDepth = 1;
mInfo.hOffset = 0;
mInfo.vOffset = 0;
mInfo.aspectCoef = float(mViewSize.height) / float(mViewSize.width);
mInfo.pixScaleX = 1.0f / float(mViewSize.width);
mInfo.pixScaleY = 1.0f / float(mViewSize.height);
2015-04-24 21:30:30 +00:00
2015-04-24 19:55:30 +00:00
onResizeView(mViewSize);
mUpdate = true;
}
bool RenderManager::isFormatSupported(MyGUI::PixelFormat /*format*/, MyGUI::TextureUsage /*usage*/)
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
return true;
2022-09-22 18:26:05 +00:00
}
2015-04-24 19:55:30 +00:00
MyGUI::ITexture* RenderManager::createTexture(const std::string& name)
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
const auto it = mTextures.insert_or_assign(name, OSGTexture(name, mImageManager)).first;
return &it->second;
}
void RenderManager::destroyTexture(MyGUI::ITexture* texture)
{
if (texture == nullptr)
return;
2015-04-24 19:55:30 +00:00
const auto item = mTextures.find(texture->getName());
MYGUI_PLATFORM_ASSERT(item != mTextures.end(), "Texture '" << texture->getName() << "' not found");
mTextures.erase(item);
2022-09-22 18:26:05 +00:00
}
2015-04-24 19:55:30 +00:00
MyGUI::ITexture* RenderManager::getTexture(const std::string& name)
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
if (name.empty())
return nullptr;
const auto item = mTextures.find(name);
if (item == mTextures.end())
2022-09-22 18:26:05 +00:00
{
2015-04-24 19:55:30 +00:00
MyGUI::ITexture* tex = createTexture(name);
2015-05-02 16:06:54 +00:00
tex->loadFromFile(name);
2018-10-09 06:21:12 +00:00
return tex;
2022-09-22 18:26:05 +00:00
}
2022-07-18 19:14:39 +00:00
return &item->second;
2022-09-22 18:26:05 +00:00
}
2015-05-02 16:06:54 +00:00
2015-04-24 19:55:30 +00:00
bool RenderManager::checkTexture(MyGUI::ITexture* _texture)
{
// We support external textures that aren't registered via this manager, so can't implement this method
// sensibly.
2015-04-24 19:55:30 +00:00
return true;
}
void RenderManager::registerShader(
const std::string& _shaderName, const std::string& _vertexProgramFile, const std::string& _fragmentProgramFile)
{
MYGUI_PLATFORM_LOG(Warning, "osgMyGUI::RenderManager::registerShader is not implemented");
}
2015-04-24 19:55:30 +00:00
}