All Projects → naleksiev → Mtlpp

naleksiev / Mtlpp

Licence: mit
C++ Metal wrapper

Projects that are alternatives of or similar to Mtlpp

Bgfx
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+2312.24%)
Mutual labels:  engine, graphics, rendering
Physics3d
A 3D physics engine
Stars: ✭ 101 (-76.24%)
Mutual labels:  engine, graphics, rendering
Renderhelp
⚡️ 可编程渲染管线实现,帮助初学者学习渲染
Stars: ✭ 494 (+16.24%)
Mutual labels:  engine, graphics, rendering
Tinyraycaster
486 lines of C++: old-school FPS in a weekend
Stars: ✭ 1,383 (+225.41%)
Mutual labels:  engine, graphics, rendering
Glumpy
Python+Numpy+OpenGL: fast, scalable and beautiful scientific visualization
Stars: ✭ 882 (+107.53%)
Mutual labels:  game, engine, rendering
Flingengine
A Vulkan game engine with a focus on data oriented design
Stars: ✭ 239 (-43.76%)
Mutual labels:  game, engine, graphics
Vue Babylonjs
A ready-to-go 3d environment for Vue.js using Babylon.js
Stars: ✭ 356 (-16.24%)
Mutual labels:  game, engine, graphics
Tinyrenderer
A brief computer graphics / rendering course
Stars: ✭ 11,776 (+2670.82%)
Mutual labels:  engine, graphics, rendering
Vxr
General purpose engine written in C++ with emphasis on materials rendering (PBR, clear coat, anisotropy, iridescence)
Stars: ✭ 181 (-57.41%)
Mutual labels:  engine, graphics, rendering
Hilo3d
Hilo3d, a WebGL Rendering Engine.
Stars: ✭ 123 (-71.06%)
Mutual labels:  game, graphics, rendering
Open Source Ios Apps
📱 Collaborative List of Open-Source iOS Apps
Stars: ✭ 28,826 (+6682.59%)
Mutual labels:  apple, game, tvos
Enterprisepbrshadingmodel
Stars: ✭ 299 (-29.65%)
Mutual labels:  graphics, rendering
Librelancer
A re-implementation of Freelancer
Stars: ✭ 303 (-28.71%)
Mutual labels:  game, engine
Entwine
Testing tools and utilities for Apple's Combine framework.
Stars: ✭ 306 (-28%)
Mutual labels:  apple, tvos
Friceengine
🎮 JVM game engine based on Swing/JavaFX.
Stars: ✭ 330 (-22.35%)
Mutual labels:  game, engine
Attributedstring
基于Swift插值方式优雅的构建富文本, 支持点击长按事件, 支持不同类型过滤, 支持自定义视图等.
Stars: ✭ 294 (-30.82%)
Mutual labels:  apple, tvos
Candle
C Game Engine
Stars: ✭ 322 (-24.24%)
Mutual labels:  game, engine
3dtilesrendererjs
Renderer for 3D Tiles in Javascript using three.js
Stars: ✭ 333 (-21.65%)
Mutual labels:  graphics, rendering
Glide
Game engine for making 2d games on iOS, macOS and tvOS, with practical examples and tutorials
Stars: ✭ 353 (-16.94%)
Mutual labels:  apple, tvos
Rpt
A physically-based path tracer
Stars: ✭ 296 (-30.35%)
Mutual labels:  graphics, rendering

license Build Status

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.hpp and mtlpp.mm - or use the contents of src/ 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();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].