// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. #pragma once #include "GPUSamplerDescription.h" #include "../GPUResource.h" /// /// GPU texture sampler object. /// /// API_CLASS(Sealed) class FLAXENGINE_API GPUSampler : public GPUResource { DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUSampler); static GPUSampler* Spawn(const SpawnParams& params); static GPUSampler* New(); protected: GPUSamplerDescription _desc; GPUSampler(); public: /// /// Gets sampler description structure. /// API_PROPERTY() const GPUSamplerDescription& GetDescription() const { return _desc; } public: /// /// Creates new sampler. /// /// The sampler description. /// True if cannot create sampler, otherwise false. API_FUNCTION() bool Init(API_PARAM(Ref) const GPUSamplerDescription& desc); protected: virtual bool OnInit() = 0; public: // [GPUResource] String ToString() const override; GPUResourceType GetResourceType() const final override; protected: // [GPUResource] void OnReleaseGPU() override; };