Files
comaps/drape/metal/metal_texture.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

39 lines
1.0 KiB
C++

#pragma once
#import <MetalKit/MetalKit.h>
#include "drape/hw_texture.hpp"
#include "drape/pointers.hpp"
namespace dp
{
namespace metal
{
class MetalTextureAllocator : public HWTextureAllocator
{
public:
drape_ptr<HWTexture> CreateTexture(ref_ptr<dp::GraphicsContext> context) override;
void Flush() override {}
};
class MetalTexture : public HWTexture
{
using Base = HWTexture;
public:
explicit MetalTexture(ref_ptr<MetalTextureAllocator>) {}
void Create(ref_ptr<dp::GraphicsContext> context, Params const & params, ref_ptr<void> data) override;
void UploadData(ref_ptr<dp::GraphicsContext> context, uint32_t x, uint32_t y,
uint32_t width, uint32_t height, ref_ptr<void> data) override;
void Bind(ref_ptr<dp::GraphicsContext> context) const override {}
void SetFilter(TextureFilter filter) override;
bool Validate() const override;
id<MTLTexture> GetTexture() const { return m_texture; }
private:
id<MTLTexture> m_texture;
bool m_isMutable = false;
};
} // namespace metal
} // namespace dp