mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-06 12:15:36 +00:00
Implement UI scaling factor
This commit is contained in:
parent
842ff4d874
commit
49df07ea7f
9 changed files with 61 additions and 74 deletions
|
@ -1,6 +1,7 @@
|
||||||
#include "windowbase.hpp"
|
#include "windowbase.hpp"
|
||||||
|
|
||||||
#include <MyGUI_InputManager.h>
|
#include <MyGUI_InputManager.h>
|
||||||
|
#include <MyGUI_RenderManager.h>
|
||||||
|
|
||||||
#include <components/settings/settings.hpp>
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
|
@ -48,11 +49,7 @@ void WindowBase::center()
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
|
|
||||||
// MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
|
MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
// Note by scrawl: The following works more reliably in the case when the window was _just_
|
|
||||||
// resized and MyGUI RenderManager doesn't know about the new size yet
|
|
||||||
MyGUI::IntSize gameWindowSize = MyGUI::IntSize(Settings::Manager::getInt("resolution x", "Video"),
|
|
||||||
Settings::Manager::getInt("resolution y", "Video"));
|
|
||||||
|
|
||||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||||
|
|
|
@ -182,7 +182,8 @@ namespace MWGui
|
||||||
, mFPS(0.0f)
|
, mFPS(0.0f)
|
||||||
, mFallbackMap(fallbackMap)
|
, mFallbackMap(fallbackMap)
|
||||||
{
|
{
|
||||||
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager());
|
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
|
||||||
|
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager(), uiScale);
|
||||||
mGuiPlatform->initialise(resourcePath, logpath);
|
mGuiPlatform->initialise(resourcePath, logpath);
|
||||||
|
|
||||||
mGui = new MyGUI::Gui;
|
mGui = new MyGUI::Gui;
|
||||||
|
@ -1104,6 +1105,13 @@ namespace MWGui
|
||||||
|
|
||||||
void WindowManager::windowResized(int x, int y)
|
void WindowManager::windowResized(int x, int y)
|
||||||
{
|
{
|
||||||
|
mGuiPlatform->getRenderManagerPtr()->setViewSize(x, y);
|
||||||
|
|
||||||
|
// scaled size
|
||||||
|
const MyGUI::IntSize& viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
|
x = viewSize.width;
|
||||||
|
y = viewSize.height;
|
||||||
|
|
||||||
sizeVideo(x, y);
|
sizeVideo(x, y);
|
||||||
|
|
||||||
if (!mHud)
|
if (!mHud)
|
||||||
|
|
|
@ -123,8 +123,8 @@ namespace MWInput
|
||||||
, mGuiCursorEnabled(true)
|
, mGuiCursorEnabled(true)
|
||||||
, mDetectingKeyboard(false)
|
, mDetectingKeyboard(false)
|
||||||
, mOverencumberedMessageDelay(0.f)
|
, mOverencumberedMessageDelay(0.f)
|
||||||
, mMouseX(0)
|
, mGuiCursorX(0)
|
||||||
, mMouseY(0)
|
, mGuiCursorY(0)
|
||||||
, mMouseWheel(0)
|
, mMouseWheel(0)
|
||||||
, mUserFileExists(userFileExists)
|
, mUserFileExists(userFileExists)
|
||||||
, mAlwaysRunActive(Settings::Manager::getBool("always run", "Input"))
|
, mAlwaysRunActive(Settings::Manager::getBool("always run", "Input"))
|
||||||
|
@ -132,13 +132,8 @@ namespace MWInput
|
||||||
, mSneaking(false)
|
, mSneaking(false)
|
||||||
, mAttemptJump(false)
|
, mAttemptJump(false)
|
||||||
, mFakeDeviceID(1)
|
, mFakeDeviceID(1)
|
||||||
|
, mInvUiScalingFactor(1.f)
|
||||||
{
|
{
|
||||||
int w,h;
|
|
||||||
SDL_GetWindowSize(window, &w, &h);
|
|
||||||
|
|
||||||
mMouseX = w / 2.f;
|
|
||||||
mMouseY = h / 2.f;
|
|
||||||
|
|
||||||
mInputManager = new SDLUtil::InputWrapper(window, viewer, grab);
|
mInputManager = new SDLUtil::InputWrapper(window, viewer, grab);
|
||||||
mInputManager->setMouseEventCallback (this);
|
mInputManager->setMouseEventCallback (this);
|
||||||
mInputManager->setKeyboardEventCallback (this);
|
mInputManager->setKeyboardEventCallback (this);
|
||||||
|
@ -193,6 +188,16 @@ namespace MWInput
|
||||||
//ICS_LOG(std::string("Unusable controller plugged in: ")+SDL_JoystickNameForIndex(i));
|
//ICS_LOG(std::string("Unusable controller plugged in: ")+SDL_JoystickNameForIndex(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
|
||||||
|
if (uiScale != 0.f)
|
||||||
|
mInvUiScalingFactor = 1.f / uiScale;
|
||||||
|
|
||||||
|
int w,h;
|
||||||
|
SDL_GetWindowSize(window, &w, &h);
|
||||||
|
|
||||||
|
mGuiCursorX = mInvUiScalingFactor * w / 2.f;
|
||||||
|
mGuiCursorY = mInvUiScalingFactor * h / 2.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputManager::clear()
|
void InputManager::clear()
|
||||||
|
@ -394,7 +399,7 @@ namespace MWInput
|
||||||
//cursor is
|
//cursor is
|
||||||
if( !is_relative && was_relative != is_relative )
|
if( !is_relative && was_relative != is_relative )
|
||||||
{
|
{
|
||||||
mInputManager->warpMouse(static_cast<int>(mMouseX), static_cast<int>(mMouseY));
|
mInputManager->warpMouse(static_cast<int>(mGuiCursorX/mInvUiScalingFactor), static_cast<int>(mGuiCursorY/mInvUiScalingFactor));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +411,7 @@ namespace MWInput
|
||||||
|
|
||||||
mInputManager->capture(disableEvents);
|
mInputManager->capture(disableEvents);
|
||||||
// inject some fake mouse movement to force updating MyGUI's widget states
|
// inject some fake mouse movement to force updating MyGUI's widget states
|
||||||
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mGuiCursorX), int(mGuiCursorY), mMouseWheel);
|
||||||
|
|
||||||
if (mControlsDisabled)
|
if (mControlsDisabled)
|
||||||
{
|
{
|
||||||
|
@ -430,15 +435,15 @@ namespace MWInput
|
||||||
|
|
||||||
// We keep track of our own mouse position, so that moving the mouse while in
|
// We keep track of our own mouse position, so that moving the mouse while in
|
||||||
// game mode does not move the position of the GUI cursor
|
// game mode does not move the position of the GUI cursor
|
||||||
mMouseX += xAxis * dt * 1500.0f;
|
mGuiCursorX += xAxis * dt * 1500.0f * mInvUiScalingFactor;
|
||||||
mMouseY += yAxis * dt * 1500.0f;
|
mGuiCursorY += yAxis * dt * 1500.0f * mInvUiScalingFactor;
|
||||||
mMouseWheel -= static_cast<int>(zAxis * dt * 1500.0f);
|
mMouseWheel -= static_cast<int>(zAxis * dt * 1500.0f);
|
||||||
|
|
||||||
mMouseX = std::max(0.f, std::min(mMouseX, float(viewSize.width)));
|
mGuiCursorX = std::max(0.f, std::min(mGuiCursorX, float(viewSize.width)));
|
||||||
mMouseY = std::max(0.f, std::min(mMouseY, float(viewSize.height)));
|
mGuiCursorY = std::max(0.f, std::min(mGuiCursorY, float(viewSize.height)));
|
||||||
|
|
||||||
MyGUI::InputManager::getInstance().injectMouseMove(static_cast<int>(mMouseX), static_cast<int>(mMouseY), mMouseWheel);
|
MyGUI::InputManager::getInstance().injectMouseMove(static_cast<int>(mGuiCursorX), static_cast<int>(mGuiCursorY), mMouseWheel);
|
||||||
mInputManager->warpMouse(static_cast<int>(mMouseX), static_cast<int>(mMouseY));
|
mInputManager->warpMouse(static_cast<int>(mGuiCursorX/mInvUiScalingFactor), static_cast<int>(mGuiCursorY/mInvUiScalingFactor));
|
||||||
}
|
}
|
||||||
if (mMouseLookEnabled)
|
if (mMouseLookEnabled)
|
||||||
{
|
{
|
||||||
|
@ -741,7 +746,7 @@ namespace MWInput
|
||||||
if (id == SDL_BUTTON_LEFT || id == SDL_BUTTON_RIGHT) // MyGUI only uses these mouse events
|
if (id == SDL_BUTTON_LEFT || id == SDL_BUTTON_RIGHT) // MyGUI only uses these mouse events
|
||||||
{
|
{
|
||||||
guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
guiMode = MyGUI::InputManager::getInstance().injectMousePress(static_cast<int>(mMouseX), static_cast<int>(mMouseY), sdlButtonToMyGUI(id)) && guiMode;
|
guiMode = MyGUI::InputManager::getInstance().injectMousePress(static_cast<int>(mGuiCursorX), static_cast<int>(mGuiCursorY), sdlButtonToMyGUI(id)) && guiMode;
|
||||||
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
|
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
|
||||||
{
|
{
|
||||||
MyGUI::Button* b = MyGUI::InputManager::getInstance ().getMouseFocusWidget ()->castType<MyGUI::Button>(false);
|
MyGUI::Button* b = MyGUI::InputManager::getInstance ().getMouseFocusWidget ()->castType<MyGUI::Button>(false);
|
||||||
|
@ -768,7 +773,7 @@ namespace MWInput
|
||||||
mInputBinder->mouseReleased (arg, id);
|
mInputBinder->mouseReleased (arg, id);
|
||||||
} else {
|
} else {
|
||||||
bool guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
bool guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
guiMode = MyGUI::InputManager::getInstance().injectMouseRelease(static_cast<int>(mMouseX), static_cast<int>(mMouseY), sdlButtonToMyGUI(id)) && guiMode;
|
guiMode = MyGUI::InputManager::getInstance().injectMouseRelease(static_cast<int>(mGuiCursorX), static_cast<int>(mGuiCursorY), sdlButtonToMyGUI(id)) && guiMode;
|
||||||
|
|
||||||
if(mInputBinder->detectingBindingState()) return; // don't allow same mouseup to bind as initiated bind
|
if(mInputBinder->detectingBindingState()) return; // don't allow same mouseup to bind as initiated bind
|
||||||
|
|
||||||
|
@ -786,19 +791,14 @@ namespace MWInput
|
||||||
|
|
||||||
if (mGuiCursorEnabled)
|
if (mGuiCursorEnabled)
|
||||||
{
|
{
|
||||||
const MyGUI::IntSize& viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
|
||||||
|
|
||||||
// We keep track of our own mouse position, so that moving the mouse while in
|
// We keep track of our own mouse position, so that moving the mouse while in
|
||||||
// game mode does not move the position of the GUI cursor
|
// game mode does not move the position of the GUI cursor
|
||||||
mMouseX = static_cast<float>(arg.x);
|
mGuiCursorX = static_cast<float>(arg.x) * mInvUiScalingFactor;
|
||||||
mMouseY = static_cast<float>(arg.y);
|
mGuiCursorY = static_cast<float>(arg.y) * mInvUiScalingFactor;
|
||||||
|
|
||||||
mMouseX = std::max(0.f, std::min(mMouseX, float(viewSize.width)));
|
|
||||||
mMouseY = std::max(0.f, std::min(mMouseY, float(viewSize.height)));
|
|
||||||
|
|
||||||
mMouseWheel = int(arg.z);
|
mMouseWheel = int(arg.z);
|
||||||
|
|
||||||
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX), int(mMouseY), mMouseWheel);
|
MyGUI::InputManager::getInstance().injectMouseMove( int(mGuiCursorX), int(mGuiCursorY), mMouseWheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mMouseLookEnabled && !mControlsDisabled)
|
if (mMouseLookEnabled && !mControlsDisabled)
|
||||||
|
@ -840,7 +840,7 @@ namespace MWInput
|
||||||
guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
if(!mInputBinder->detectingBindingState())
|
if(!mInputBinder->detectingBindingState())
|
||||||
{
|
{
|
||||||
guiMode = MyGUI::InputManager::getInstance().injectMousePress(static_cast<int>(mMouseX), static_cast<int>(mMouseY),
|
guiMode = MyGUI::InputManager::getInstance().injectMousePress(static_cast<int>(mGuiCursorX), static_cast<int>(mGuiCursorY),
|
||||||
sdlButtonToMyGUI((arg.button == SDL_CONTROLLER_BUTTON_B) ? SDL_BUTTON_RIGHT : SDL_BUTTON_LEFT)) && guiMode;
|
sdlButtonToMyGUI((arg.button == SDL_CONTROLLER_BUTTON_B) ? SDL_BUTTON_RIGHT : SDL_BUTTON_LEFT)) && guiMode;
|
||||||
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
|
if (MyGUI::InputManager::getInstance ().getMouseFocusWidget () != 0)
|
||||||
{
|
{
|
||||||
|
@ -872,7 +872,7 @@ namespace MWInput
|
||||||
else if(arg.button == SDL_CONTROLLER_BUTTON_A || arg.button == SDL_CONTROLLER_BUTTON_B)
|
else if(arg.button == SDL_CONTROLLER_BUTTON_A || arg.button == SDL_CONTROLLER_BUTTON_B)
|
||||||
{
|
{
|
||||||
bool guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
bool guiMode = MWBase::Environment::get().getWindowManager()->isGuiMode();
|
||||||
guiMode = MyGUI::InputManager::getInstance().injectMouseRelease(static_cast<int>(mMouseX), static_cast<int>(mMouseY), sdlButtonToMyGUI((arg.button == SDL_CONTROLLER_BUTTON_B) ? SDL_BUTTON_RIGHT : SDL_BUTTON_LEFT)) && guiMode;
|
guiMode = MyGUI::InputManager::getInstance().injectMouseRelease(static_cast<int>(mGuiCursorX), static_cast<int>(mGuiCursorY), sdlButtonToMyGUI((arg.button == SDL_CONTROLLER_BUTTON_B) ? SDL_BUTTON_RIGHT : SDL_BUTTON_LEFT)) && guiMode;
|
||||||
|
|
||||||
if(mInputBinder->detectingBindingState()) return; // don't allow same mouseup to bind as initiated bind
|
if(mInputBinder->detectingBindingState()) return; // don't allow same mouseup to bind as initiated bind
|
||||||
|
|
||||||
|
|
|
@ -187,8 +187,8 @@ namespace MWInput
|
||||||
|
|
||||||
float mOverencumberedMessageDelay;
|
float mOverencumberedMessageDelay;
|
||||||
|
|
||||||
float mMouseX;
|
float mGuiCursorX;
|
||||||
float mMouseY;
|
float mGuiCursorY;
|
||||||
int mMouseWheel;
|
int mMouseWheel;
|
||||||
bool mUserFileExists;
|
bool mUserFileExists;
|
||||||
bool mAlwaysRunActive;
|
bool mAlwaysRunActive;
|
||||||
|
@ -198,7 +198,11 @@ namespace MWInput
|
||||||
|
|
||||||
std::map<std::string, bool> mControlSwitch;
|
std::map<std::string, bool> mControlSwitch;
|
||||||
|
|
||||||
|
float mInvUiScalingFactor;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void convertMousePosForMyGUI(int& x, int& y);
|
||||||
|
|
||||||
MyGUI::MouseButton sdlButtonToMyGUI(Uint8 button);
|
MyGUI::MouseButton sdlButtonToMyGUI(Uint8 button);
|
||||||
|
|
||||||
virtual std::string sdlControllerAxisToString(int axis);
|
virtual std::string sdlControllerAxisToString(int axis);
|
||||||
|
|
|
@ -14,14 +14,14 @@ namespace osgMyGUI
|
||||||
class Platform
|
class Platform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager)
|
Platform(osgViewer::Viewer* viewer, osg::Group* guiRoot, Resource::TextureManager* textureManager, float uiScalingFactor)
|
||||||
: mRenderManager(nullptr)
|
: mRenderManager(nullptr)
|
||||||
, mDataManager(nullptr)
|
, mDataManager(nullptr)
|
||||||
, mLogManager(nullptr)
|
, mLogManager(nullptr)
|
||||||
, mLogFacility(nullptr)
|
, mLogFacility(nullptr)
|
||||||
{
|
{
|
||||||
mLogManager = new MyGUI::LogManager();
|
mLogManager = new MyGUI::LogManager();
|
||||||
mRenderManager = new RenderManager(viewer, guiRoot, textureManager);
|
mRenderManager = new RenderManager(viewer, guiRoot, textureManager, uiScalingFactor);
|
||||||
mDataManager = new DataManager();
|
mDataManager = new DataManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,37 +40,6 @@
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
|
|
||||||
// Proxy to forward an OSG resize event to RenderManager::setViewSize
|
|
||||||
class ResizeHandler : public osgGA::GUIEventHandler {
|
|
||||||
osgMyGUI::RenderManager *mParent;
|
|
||||||
|
|
||||||
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
|
|
||||||
{
|
|
||||||
if(ea.getEventType() == osgGA::GUIEventAdapter::RESIZE)
|
|
||||||
{
|
|
||||||
int width = ea.getWindowWidth();
|
|
||||||
int height = ea.getWindowHeight();
|
|
||||||
mParent->setViewSize(width, height);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
ResizeHandler(osgMyGUI::RenderManager *parent=nullptr) : mParent(parent) { }
|
|
||||||
ResizeHandler(const ResizeHandler ©, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
|
|
||||||
: osg::Object(copy, copyop), osgGA::GUIEventHandler(copy, copyop)
|
|
||||||
, mParent(copy.mParent)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
META_Object(osgMyGUI, ResizeHandler)
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace osgMyGUI
|
namespace osgMyGUI
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -322,13 +291,16 @@ void OSGVertexBuffer::create()
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
RenderManager::RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::TextureManager* textureManager)
|
RenderManager::RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::TextureManager* textureManager, float scalingFactor)
|
||||||
: mViewer(viewer)
|
: mViewer(viewer)
|
||||||
, mSceneRoot(sceneroot)
|
, mSceneRoot(sceneroot)
|
||||||
, mTextureManager(textureManager)
|
, mTextureManager(textureManager)
|
||||||
, mUpdate(false)
|
, mUpdate(false)
|
||||||
, mIsInitialise(false)
|
, mIsInitialise(false)
|
||||||
|
, mInvScalingFactor(1.f)
|
||||||
{
|
{
|
||||||
|
if (scalingFactor != 0.f)
|
||||||
|
mInvScalingFactor = 1.f / scalingFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderManager::~RenderManager()
|
RenderManager::~RenderManager()
|
||||||
|
@ -380,7 +352,6 @@ void RenderManager::initialise()
|
||||||
|
|
||||||
mGuiRoot = camera;
|
mGuiRoot = camera;
|
||||||
mSceneRoot->addChild(mGuiRoot.get());
|
mSceneRoot->addChild(mGuiRoot.get());
|
||||||
mViewer->addEventHandler(new ResizeHandler(this));
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Viewport> vp = mViewer->getCamera()->getViewport();
|
osg::ref_ptr<osg::Viewport> vp = mViewer->getCamera()->getViewport();
|
||||||
setViewSize(vp->width(), vp->height());
|
setViewSize(vp->width(), vp->height());
|
||||||
|
@ -458,7 +429,8 @@ void RenderManager::setViewSize(int width, int height)
|
||||||
if(height < 1) height = 1;
|
if(height < 1) height = 1;
|
||||||
|
|
||||||
mGuiRoot->setViewport(0, 0, width, height);
|
mGuiRoot->setViewport(0, 0, width, height);
|
||||||
mViewSize.set(width, height);
|
|
||||||
|
mViewSize.set(width * mInvScalingFactor, height * mInvScalingFactor);
|
||||||
|
|
||||||
mInfo.maximumDepth = 1;
|
mInfo.maximumDepth = 1;
|
||||||
mInfo.hOffset = 0;
|
mInfo.hOffset = 0;
|
||||||
|
|
|
@ -46,15 +46,19 @@ class RenderManager : public MyGUI::RenderManager, public MyGUI::IRenderTarget
|
||||||
|
|
||||||
osg::ref_ptr<osg::Camera> mGuiRoot;
|
osg::ref_ptr<osg::Camera> mGuiRoot;
|
||||||
|
|
||||||
|
float mInvScalingFactor;
|
||||||
|
|
||||||
void destroyAllResources();
|
void destroyAllResources();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::TextureManager* textureManager);
|
RenderManager(osgViewer::Viewer *viewer, osg::Group *sceneroot, Resource::TextureManager* textureManager, float scalingFactor);
|
||||||
virtual ~RenderManager();
|
virtual ~RenderManager();
|
||||||
|
|
||||||
void initialise();
|
void initialise();
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
||||||
|
void setScalingFactor(float factor);
|
||||||
|
|
||||||
static RenderManager& getInstance() { return *getInstancePtr(); }
|
static RenderManager& getInstance() { return *getInstancePtr(); }
|
||||||
static RenderManager* getInstancePtr()
|
static RenderManager* getInstancePtr()
|
||||||
{ return static_cast<RenderManager*>(MyGUI::RenderManager::getInstancePtr()); }
|
{ return static_cast<RenderManager*>(MyGUI::RenderManager::getInstancePtr()); }
|
||||||
|
|
|
@ -86,7 +86,7 @@ namespace osgMyGUI
|
||||||
if (!mTextureManager)
|
if (!mTextureManager)
|
||||||
throw std::runtime_error("No texturemanager set");
|
throw std::runtime_error("No texturemanager set");
|
||||||
|
|
||||||
mTexture = mTextureManager->getTexture2D(fname, osg::Texture2D::CLAMP, osg::Texture2D::CLAMP);
|
mTexture = mTextureManager->getTexture2D(fname, osg::Texture2D::REPEAT, osg::Texture2D::REPEAT);
|
||||||
|
|
||||||
// FIXME
|
// FIXME
|
||||||
mFormat = MyGUI::PixelFormat::R8G8B8;
|
mFormat = MyGUI::PixelFormat::R8G8B8;
|
||||||
|
|
|
@ -21,6 +21,8 @@ gamma = 1.00
|
||||||
contrast = 1.00
|
contrast = 1.00
|
||||||
|
|
||||||
[GUI]
|
[GUI]
|
||||||
|
scaling factor = 1.0
|
||||||
|
|
||||||
# 1 is fully opaque
|
# 1 is fully opaque
|
||||||
menu transparency = 0.84
|
menu transparency = 0.84
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue