Path: blob/master/thirdparty/metal-cpp/QuartzCore/CAMetalDrawable.hpp
21059 views
//-------------------------------------------------------------------------------------------------------------------------------------------------------------1//2// QuartzCore/CAMetalDrawable.hpp3//4// Copyright 2020-2024 Apple Inc.5//6// Licensed under the Apache License, Version 2.0 (the "License");7// you may not use this file except in compliance with the License.8// You may obtain a copy of the License at9//10// http://www.apache.org/licenses/LICENSE-2.011//12// Unless required by applicable law or agreed to in writing, software13// distributed under the License is distributed on an "AS IS" BASIS,14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15// See the License for the specific language governing permissions and16// limitations under the License.17//18//-------------------------------------------------------------------------------------------------------------------------------------------------------------1920#pragma once2122//-------------------------------------------------------------------------------------------------------------------------------------------------------------2324#include "../Metal/MTLDrawable.hpp"25#include "../Metal/MTLTexture.hpp"2627#include "CADefines.hpp"28#include "CAPrivate.hpp"2930//-------------------------------------------------------------------------------------------------------------------------------------------------------------3132namespace CA33{34class MetalDrawable : public NS::Referencing<MetalDrawable, MTL::Drawable>35{36public:37class MetalLayer* layer() const;38MTL::Texture* texture() const;39};40}4142//-------------------------------------------------------------------------------------------------------------------------------------------------------------4344_CA_INLINE CA::MetalLayer* CA::MetalDrawable::layer() const45{46return Object::sendMessage<MetalLayer*>(this, _CA_PRIVATE_SEL(layer));47}4849//-------------------------------------------------------------------------------------------------------------------------------------------------------------5051_CA_INLINE MTL::Texture* CA::MetalDrawable::texture() const52{53return Object::sendMessage<MTL::Texture*>(this, _CA_PRIVATE_SEL(texture));54}5556//-------------------------------------------------------------------------------------------------------------------------------------------------------------575859