プロジェクト
概要
C++向けMetalラッパー
デザイン・メディアできること
- Complete API wrapper (iOS 10, tvOS 10, and OS X 10.12).
- Objective-C free headers - allow compiling agains the Metal API on any platform (no linking on platforms without Metal).
- Configurable AVAILABILITY and DEPRECATED validation.
- Amalgamated mtlpp.hpp and mtlpp.mm - or use the contents of src/ folder.
計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナルmtlpp - C++ wrapper around Metal
Complete wrapper around Metal (Apple's low-level graphics API).
#include "mtlpp.hpp"
int main()
{
mtlpp::Device device = mtlpp::Device::CreateSystemDefaultDevice();
mtlpp::CommandQueue commandQueue = device.NewCommandQueue();
mtlpp::CommandBuffer commandBuffer = commandQueue.CommandBuffer();
mtlpp::TextureDescriptor textureDesc = mtlpp::TextureDescriptor::Texture2DDescriptor(
mtlpp::PixelFormat::RGBA8Unorm, 320, 240, false);
textureDesc.SetUsage(mtlpp::TextureUsage::RenderTarget);
mtlpp::Texture texture = device.NewTexture(textureDesc);
// ...
return 0;
}
Main features
- Complete API wrapper (iOS 10, tvOS 10, and OS X 10.12).
- Objective-C free headers - allow compiling agains the Metal API on any platform (no linking on platforms without Metal).
- Configurable AVAILABILITY and DEPRECATED validation.
- Amalgamated
mtlpp.hppandmtlpp.mm- or use the contents ofsrc/folder.
Interop
mtlpp uses Toll-Free Bridging. The example below demonstrates how MTKView (MetalKit) can interop with mtlpp.
MTKView * mtkView;
// Objective-C to C++
mtlpp::Device device = ns::Handle{ (__bridge void*)mtkView.device };
// C++ to Objective-C
mtkView.device = (__bridge id<MTLDevice>)device.GetPtr();
関連プロジェクトを探す
読み込み中…