//////////////////////////////////////////////////////////////////////////////////////////////////// // NoesisGUI - http://www.noesisengine.com // Copyright (c) 2013 Noesis Technologies S.L. All Rights Reserved. //////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef __GUI_TEXTURESOURCE_H__ #define __GUI_TEXTURESOURCE_H__ #include #include #include #include namespace Noesis { class Texture; NS_WARNING_PUSH NS_MSVC_WARNING_DISABLE(4251 4275) //////////////////////////////////////////////////////////////////////////////////////////////////// /// Defines a BitmapSource constructed from a Texture. //////////////////////////////////////////////////////////////////////////////////////////////////// class NS_GUI_CORE_API TextureSource: public BitmapSource { public: /// Constructor TextureSource(); TextureSource(Texture* texture); /// Destructor ~TextureSource(); /// Gets or sets texture //@{ Texture* GetTexture() const; void SetTexture(Texture* texture); //@} // Hides Freezable methods for convenience //@{ Ptr Clone() const; Ptr CloneCurrentValue() const; //@} /// From IRenderProxyCreator //@{ void CreateRenderProxy(RenderTreeUpdater& updater, uint32_t proxyIndex) override; void UpdateRenderProxy(RenderTreeUpdater& updater, uint32_t proxyIndex) override; void UnregisterRenderer(ViewId viewId) override; //@} protected: /// From Freezable //@{ void CloneCommonCore(const Freezable* source) override; Ptr CreateInstanceCore() const override; //@} /// From BitmapSource //@{ float GetDpiXCore() const override; float GetDpiYCore() const override; int32_t GetPixelWidthCore() const override; int32_t GetPixelHeightCore() const override; //@} private: ProxyFlags mUpdateFlags; enum UpdateFlags { UpdateFlags_Texture }; Ptr mTexture; NS_DECLARE_REFLECTION(TextureSource, BitmapSource) }; NS_WARNING_POP } #endif