// // Copyright 2016 Pixar // // Licensed under the terms set forth in the LICENSE.txt file available at // https://opensubdiv.org/license. // #ifndef OPENSUBDIV_EXAMPLES_MTL_HUD_H #define OPENSUBDIV_EXAMPLES_MTL_HUD_H @protocol MTLTexture; @protocol MTLBuffer; @protocol MTLRenderCommandEncoder; @protocol MTLRenderPipelineState; @protocol MTLDevice; @class MTLRenderPipelineDescriptor; @class MTLDepthStencilDescriptor; #include "hud.h" #include "mtlUtils.h" class MTLhud : public Hud { public: MTLhud(); ~MTLhud(); virtual void Init(id device, MTLRenderPipelineDescriptor* parentPipelineDescriptor, MTLDepthStencilDescriptor* depthStencilStateDescriptor, int width, int height, int framebufferWidth, int framebufferHeight); virtual void Rebuild(int width, int height, int framebufferWidth, int framebufferHeight); virtual bool Flush(id encoder); id GetFontTexture() const { return _fontTexture; } void FillBackground(id encoder); float UIScale = 1.0f; private: id _device; id _fontTexture; OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLRingBuffer _staticBuffer; OpenSubdiv::OPENSUBDIV_VERSION::Osd::MTLRingBuffer _dynamicBuffer; id _fgPipelineState, _bgPipelineState; id _depthStencilState; }; #endif //OPENSUBDIV_EXAMPLES_MTL_HUD_H