SO3Engine
|
SO3Widget.cpp
Go to the documentation of this file.
63 SWidget::SWidget(SScene* targetScene, const std::string& widgetName, const int& xPos, const int& yPos, const unsigned short& widgetWidth, const unsigned short& widgetHeight, SViewPort* targetViewport, const unsigned int& widgetZOrder, const std::string& widgetType) : SData(widgetName), isOverlayed(true), is2DRect(false)
73 SWidget::SWidget(SScene* targetScene, const std::string& widgetName, const int& xPos, const int& yPos, const unsigned short& widgetWidth, const unsigned short& widgetHeight, SViewPort* targetViewport, const std::string& widgetType) : SData(widgetName), isOverlayed(false), is2DRect(true)
84 SWidget::SWidget(SScene* targetScene, const std::string& widgetName, const unsigned short& widgetWidth, const unsigned short& widgetHeight, SMaterial* targetMaterial, const unsigned short& targetTechnique, const unsigned short& targetPass, const unsigned short& targetTextureUnit, const std::string& widgetType) : SData(widgetName), isOverlayed(false), is2DRect(false)
116 void SWidget::StandardConstructor(SScene* targetScene, const int& xPos, const int& yPos, const unsigned short& widgetWidth, const unsigned short& widgetHeight, const unsigned int& widgetZOrder, SViewPort* targetViewport, const std::string& widgetType)
191 ogreTargetTextureUnit->setAlphaOperation(bmode.operation, bmode.source1, bmode.source2, bmode.alphaArg1, bmode.alphaArg2, bmode.factor);
192 ogreTargetTextureUnit->setTextureFiltering(ogreOriginalTextureUnit->getTextureFiltering(Ogre::FT_MIN), ogreOriginalTextureUnit->getTextureFiltering(Ogre::FT_MAG), ogreOriginalTextureUnit->getTextureFiltering(Ogre::FT_MIP));
230 SWidgetManager::getSingleton().UpdateWidgetsZOrder(); // Recalculate zOrder of all widgets without this one.
354 rpos.x = leftPos + (static_cast<int>((float)(currentViewport->getActualWidth() <= 1) ? 1.0f : currentViewport->getActualWidth() * widthScale * leftOffset)) + ((width - static_cast<int>((float)width * widthScale)) / 2);
355 rpos.y = topPos + (static_cast<int>((float)(currentViewport->getActualHeight() <= 1) ? 1.0f : currentViewport->getActualHeight() * heightScale * topOffset)) + ((height - static_cast<int>((float)height * heightScale)) / 2);
511 const Ogre::RenderSystemCapabilities* caps = SRoot::getSingleton().GetOgreRenderSystem()->getCapabilities();
520 mTextureWidth = Ogre::Bitwise::firstPO2From(static_cast <unsigned short>(width * textureRatio)) / 2;
521 mTextureHeight = Ogre::Bitwise::firstPO2From(static_cast <unsigned short>(height * textureRatio)) / 2;
533 mTextureWidth = Ogre::Bitwise::firstPO2From(static_cast <unsigned short>(mTextureWidth * textureRatio));
534 mTextureHeight = Ogre::Bitwise::firstPO2From(static_cast <unsigned short>(mTextureHeight * textureRatio));
570 Ogre::PixelFormat format = ((alpha == false) && Ogre::TextureManager::getSingleton().isFormatSupported(Ogre::TEX_TYPE_2D, Ogre::PF_BYTE_RGB, Ogre::TU_DYNAMIC)) ? Ogre::PF_BYTE_RGB : Ogre::PF_BYTE_RGBA;
572 Ogre::PixelFormat format = ((alpha == false) && Ogre::TextureManager::getSingleton().isFormatSupported(Ogre::TEX_TYPE_2D, Ogre::PF_BYTE_BGR, Ogre::TU_DYNAMIC)) ? Ogre::PF_BYTE_BGR : Ogre::PF_BYTE_BGRA;
574 std::string grpName = (ogreTargetTextureUnit != 0) ? ogreTargetTextureUnit->getParent()->getResourceGroup() : SO3_INTERNAL_RESOURCE_GROUP;
575 renderingTexture = Ogre::TextureManager::getSingleton().createManual(baseResourceName + "/Texture/" + name, grpName, Ogre::TEX_TYPE_2D, mTextureWidth, mTextureHeight, 0, format, Ogre::TU_DYNAMIC, this);
579 Ogre::LogManager::getSingleton().getDefaultLog()->logMessage("An exception has occurred: " + e.getDescription());
643 ogreOverlayMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTexture(renderingTexture);
656 // Tell the texture manager that we want to unload the texture, and set the shared pointer to null ask for texture total destruction.
670 ogreOverlayPanel = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", baseResourceName + "/Overlays/Panels/" + name));
675 ogreOverlay = Ogre::OverlayManager::getSingleton().create(baseResourceName + "/Overlays/" + name);
720 ogre2dNode = scene->GetOgreScenePointer()->getRootSceneNode()->createChildSceneNode(baseResourceName + "/Background/" + name);
748 ogreOverlayMaterial = Ogre::MaterialManager::getSingleton().create(baseResourceName + "/Overlays/Panels/Materials/" + name, SO3_INTERNAL_RESOURCE_GROUP);
802 // Tell the material manager that we want to unload the material, and set the shared pointer to null ask for material total destruction.
810 void SWidget::ApplyMaterialParameters(Ogre::Pass* materialPassToModify, Ogre::TextureUnitState* materialTextureUnitToModify)
814 if (isOverlayed || is2DRect || ((isTransparent || (opacity != 1.0f)) && (materialPassToModify->getTextureUnitStateIndex(materialTextureUnitToModify) == 0)))
818 materialPassToModify->setSceneBlending(Ogre::SBF_SOURCE_ALPHA, Ogre::SBF_ONE_MINUS_SOURCE_ALPHA);
825 materialPassToModify->setSceneBlending((isTransparent || (opacity != 1.0f)) ? Ogre::SBT_TRANSPARENT_ALPHA : Ogre::SBT_REPLACE);
839 materialTextureUnitToModify->setTextureFiltering(Ogre::FO_LINEAR, Ogre::FO_LINEAR, Ogre::FO_NONE);
842 materialTextureUnitToModify->setTextureFiltering(Ogre::FO_LINEAR, Ogre::FO_LINEAR, Ogre::FO_NONE);
852 Ogre::GpuProgramParametersSharedPtr fparams = materialPassToModify->getFragmentProgramParameters();
865 materialTextureUnitToModify->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_TEXTURE, Ogre::LBS_CURRENT);
1013 ogreTargetTextureUnit->setAlphaOperation(bmode.operation, bmode.source1, bmode.source2, bmode.alphaArg1, bmode.alphaArg2, bmode.factor);
1061 ogreTargetTextureUnit->setAlphaOperation(bmode.operation, bmode.source1, bmode.source2, bmode.alphaArg1, bmode.alphaArg2, bmode.factor);
1173 void SWidget::SetIgnoreTransparentPixels(const bool& widgetIgnoreTransparentPixels, const float& tresholdColor)
1249 ogre2dRect->setUVs(Ogre::Vector2(0.0f, 0.0f), Ogre::Vector2(0.0f, 1.0f), Ogre::Vector2(0.5f, 0.0f), Ogre::Vector2(0.5f, 1.0f));
1251 ogre2dRect->setUVs(Ogre::Vector2(0.5f, 0.0f), Ogre::Vector2(0.5f, 1.0f), Ogre::Vector2(1.0f, 0.0f), Ogre::Vector2(1.0f, 1.0f));
1266 ogre2dRect->setUVs(Ogre::Vector2(0.0f, 0.0f), Ogre::Vector2(0.0f, 0.5f), Ogre::Vector2(1.0f, 0.0f), Ogre::Vector2(1.0f, 0.5f));
1268 ogre2dRect->setUVs(Ogre::Vector2(0.0f, 0.5f), Ogre::Vector2(0.0f, 1.0f), Ogre::Vector2(1.0f, 0.5f), Ogre::Vector2(1.0f, 1.0f));
1283 ogre2dRect->setUVs(Ogre::Vector2(0.0f, 0.5f), Ogre::Vector2(0.0f, 1.0f), Ogre::Vector2(1.0f, 0.5f), Ogre::Vector2(1.0f, 1.0f));
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
Definition SO3DataScol.h:41
Definition SO3Material.h:43
void SetAssociatedWidget(SWidget *newAssociatedWidget)
Definition SO3Material.cpp:227
void CleanUpGeneratedTechniques()
Definition SO3Material.cpp:400
Ogre::MaterialPtr getOgreMaterialPointer()
Definition SO3Material.cpp:157
Definition SO3Point.h:37
bool GetRttPixelFormat(Ogre::PixelFormat &format, bool alpha=false, bool floattex=false)
Definition SO3Root.cpp:650
void RemoveGeneratedMaterial(Ogre::Material *mat)
Definition SO3Root.cpp:2343
Definition SO3Scene.h:125
Ogre::SceneManager * GetOgreScenePointer()
Definition SO3Scene.cpp:449
Definition SO3ViewPort.h:56
Ogre::Viewport * GetOgreViewPortPointer()
Definition SO3ViewPort.cpp:98
Ogre::SceneBlendFactor oSceneBlendingD
Definition SO3Widget.h:68
Ogre::SceneBlendFactor oSceneBlendingS
Definition SO3Widget.h:67
virtual void SetSizeImpl(const unsigned short &newWidth, const unsigned short &newHeight)=0
void SetScale(const float width, const float height)
Definition SO3Widget.cpp:473
virtual void loadResource(Ogre::Resource *resource)
Definition SO3Widget.cpp:870
virtual void SetMouseEnableImpl(const bool &enableMouseOnWidget)=0
virtual void SetTransparencyImpl(const bool &enableTransparency)=0
void SetUpdateOnFocusOnly(const bool &activate)
Definition SO3Widget.cpp:1194
void Show(const bool &fade=false, const unsigned short &fadeDurationMS=300)
Definition SO3Widget.cpp:990
float GetIgnoreTransparentPixelsTreshold()
Definition SO3Widget.cpp:1184
void SetMouseEnable(const bool &enableMouseOnWidget)
Definition SO3Widget.cpp:1136
void Hide(const bool &fade=false, const unsigned short &fadeDurationMS=300)
Definition SO3Widget.cpp:1043
void SetTransparency(const bool &enableTransparency)
Definition SO3Widget.cpp:1100
void SetKeyboardEnable(const bool &enableKeyboardOnWidget)
Definition SO3Widget.cpp:1125
void SetTopOnFocus(const bool &enableWidgetTopOnFocus)
Definition SO3Widget.cpp:889
void SetPosition(const int &xPos, const int &yPos)
Definition SO3Widget.cpp:332
void SetTextureRatio(const float &newRatio)
Definition SO3Widget.cpp:456
bool compensateNPOT
Use to indicate if the texture size has be rounded to an exact pow2.
Definition SO3Widget.h:91
void SetZOrder(const unsigned short &newWidgetOrder)
Definition SO3Widget.cpp:492
bool GetIgnoreTransparentPixels()
Definition SO3Widget.cpp:1179
void SetForeground(const bool &enableWidgetForeground)
Definition SO3Widget.cpp:899
virtual void SetKeyboardEnableImpl(const bool &enableKeyboardOnWidget)=0
void SetSize(const unsigned short &newWidth, const unsigned short &newHeight)
Definition SO3Widget.cpp:270
void SetCurrentViewport(Ogre::Viewport *vp)
Definition SO3Widget.cpp:235
virtual HCURSOR GetCurrentMouseCursor()
Definition SO3Widget.cpp:1291
SPoint< unsigned short > GetRealPixelSize()
Definition SO3Widget.cpp:365
void SetIgnoreTransparentPixels(const bool &widgetIgnoreTransparentPixels, const float &tresholdColor=0.0f)
Definition SO3Widget.cpp:1173
void UpdateWidgetsZOrder()
Definition SO3WidgetManager.cpp:633
void UpdateFocusedWidget(SWidget *focusTargetedWidget)
Definition SO3WidgetManager.cpp:723
static SWidgetManager & getSingleton()
Definition SO3WidgetManager.cpp:53
Definition OgreNewt_Debugger.h:21
Definition SO3DataScol.h:38
Generated by 1.9.8