프로젝트
GitHub에서 보기
naleksiev/mtlpp
소개
C++ Metal 래퍼
디자인 및 미디어What you can do
- 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.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalmtlpp - 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();
관련 프로젝트 살펴보기
불러오는 중…