38#include <OgreRectangle2D.h>
39#include <OgreOverlay.h>
40#include <OgreOverlaySystem.h>
41#include <OgreOverlayElement.h>
42#include <OgreOverlayManager.h>
43#include <OgrePanelOverlayElement.h>
50 public Ogre::ManualResourceLoader
96 const bool isOverlayed;
102 Ogre::TextureUnitState* ogreTargetTextureUnit;
103 Ogre::Pass* ogreTargetMaterialPass;
104 Ogre::Overlay* ogreOverlay;
105 Ogre::PanelOverlayElement* ogreOverlayPanel;
106 Ogre::Rectangle2D* ogre2dRect;
107 Ogre::SceneNode* ogre2dNode;
108 Ogre::MaterialPtr ogreOverlayMaterial;
111 Ogre::MaterialPtr ogreTargetMaterial;
112 Ogre::TextureUnitState* ogreOriginalTextureUnit;
117 std::vector<int> inputIndexes;
118 Ogre::TextureUnitState* renderingTextureUnit;
123 bool transparentIgnorePixels;
124 bool updateOnFocusOnly;
131 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);
136 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);
141 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);
154 std::string GetType();
158 unsigned short GetWidth();
162 unsigned short GetHeight();
170 void SetSize(
const unsigned short& newWidth,
const unsigned short& newHeight);
178 float GetTextureRatio();
182 void SetTextureRatio(
const float& newRatio);
194 void SetStereoEye(
bool isleft =
true);
204 void SetPosition(
const int& xPos,
const int& yPos);
219 void SetCurrentViewport(Ogre::Viewport* vp);
224 void SetScale(
const float width,
const float height);
234 void SetLeftOffset(
const float left);
239 void SetTopOffset(
const float top);
263 virtual void InjectMouseWheel(
const int& scrollX,
const int& scrollY,
const int& relativeScroll)=0;
287 virtual void InjectTouchAdd(
const int& xPos,
const int& yPos,
const int& touchid) = 0;
303 virtual void InjectTouchUpdate(
const int& xPos,
const int& yPos,
const int& vx,
const int& vy,
const int& touchid) = 0;
307 virtual void InjectKeyEvent(
const UINT& msg,
const ScolWindowHandle& hwnd,
const WPARAM& wParam,
const LPARAM& lParam) = 0;
319 void Show(
const bool& fade=
false,
const unsigned short& fadeDurationMS=300);
327 void Hide(
const bool& fade=
false,
const unsigned short& fadeDurationMS=300);
337 void SetTransparency(
const bool& enableTransparency);
342 bool GetTransparency();
347 void SetOpacity(
const float& widgetOpacity);
357 void SetIgnoreTransparentPixels(
const bool& widgetIgnoreTransparentPixels,
const float& tresholdColor=0.0f);
362 bool GetIgnoreTransparentPixels();
367 float GetIgnoreTransparentPixelsTreshold();
372 virtual void LoadURL(
const std::string& url)=0;
383 void SetZOrder(
const unsigned short& newWidgetOrder);
388 unsigned short GetZOrder();
408 void SetKeyboardEnable(
const bool& enableKeyboardOnWidget);
413 bool GetKeyboardEnable();
418 void SetMouseEnable(
const bool& enableMouseOnWidget);
423 bool GetMouseEnable();
431 bool GetInputOver(
int id);
435 void SetInputOver(
int id,
bool state);
440 void SetForeground(
const bool& enableWidgetForeground);
445 bool GetForeground();
450 void SetTopOnFocus(
const bool& enableWidgetTopOnFocus);
455 bool GetTopOnFocus();
460 virtual void RunScriptFunction(
const std::string& functionName,
const std::vector<std::string>& argumentList)=0;
465 virtual void loadResource(Ogre::Resource* resource);
474 bool GetUpdateOnFocusOnly();
478 void SetUpdateOnFocusOnly(
const bool& activate);
482 bool GetIsOverlayed();
492 virtual HCURSOR GetCurrentMouseCursor();
496 bool IsCompensateNPOT()
const;
501 void CreateTexture(
bool alpha =
true);
506 std::string CheckUrl(
const std::string& url);
528 virtual void SetSizeImpl(
const unsigned short& newWidth,
const unsigned short& newHeight)=0;
538 void 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);
544 void _SetOgreOverlayZOrder(
const unsigned short& overlayZOrder);
549 void DestroyTexture();
554 void CreateMaterial();
559 void DestroyMaterial();
563 void ApplyMaterialParameters(Ogre::Pass* materialPassToModify, Ogre::TextureUnitState* materialTextureUnitToModify);
568 void CreateOverlay();
573 void DestroyOverlay();