#include "BsRenderTarget.h" #include "BsViewport.h" #include "BsException.h" #include "BsRenderAPI.h" #include "BsCoreThread.h" #include "BsFrameAlloc.h" namespace BansheeEngine { RenderTargetCore::RenderTargetCore() { } void RenderTargetCore::setActive(bool state) { RenderTargetProperties& props = const_cast(getProperties()); props.mActive = state; markCoreDirty(); } void RenderTargetCore::setPriority(INT32 priority) { RenderTargetProperties& props = const_cast(getProperties()); props.mPriority = priority; markCoreDirty(); } const RenderTargetProperties& RenderTargetCore::getProperties() const { return getPropertiesInternal(); } void RenderTargetCore::getCustomAttribute(const String& name, void* pData) const { BS_EXCEPT(InvalidParametersException, "Attribute not found."); } RenderTarget::RenderTarget() { // We never sync from sim to core, so mark it clean to avoid overwriting core thread changes markCoreClean(); } void RenderTarget::setPriority(CoreAccessor& accessor, INT32 priority) { std::function, INT32)> windowedFunc = [](SPtr renderTarget, INT32 priority) { renderTarget->setPriority(priority); }; accessor.queueCommand(std::bind(windowedFunc, getCore(), priority)); } SPtr RenderTarget::getCore() const { return std::static_pointer_cast(mCoreSpecific); } const RenderTargetProperties& RenderTarget::getProperties() const { THROW_IF_CORE_THREAD; return getPropertiesInternal(); } void RenderTarget::getCustomAttribute(const String& name, void* pData) const { BS_EXCEPT(InvalidParametersException, "Attribute not found."); } }