Stuart Carnie 411bcf8bdd feat(apple): Metal support for macOS
* includes rgui
* shader support

This is a work-in-progress and there are some bugs and visual artifacts
still to be fixed.
2018-06-20 21:33:45 -07:00

38 lines
1.0 KiB
Objective-C

//
// Context.h
// MetalRenderer
//
// Created by Stuart Carnie on 6/9/18.
// Copyright © 2018 Stuart Carnie. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Metal/Metal.h>
NS_ASSUME_NONNULL_BEGIN
@interface Context : NSObject
@property (readonly) id<MTLDevice> device;
@property (readonly) id<MTLLibrary> library;
@property (readonly) id<MTLCommandQueue> commandQueue;
/*! @brief Returns the command buffer for the current frame */
@property (readonly) id<MTLCommandBuffer> commandBuffer;
@property (readonly) id<CAMetalDrawable> nextDrawable;
@property (readonly) id<MTLTexture> renderTexture;
+ (instancetype)newContextWithDevice:(id<MTLDevice>)d
layer:(CAMetalLayer *)layer
library:(id<MTLLibrary>)l
commandQueue:(id<MTLCommandQueue>)q;
/*! @brief begin marks the beginning of a frame */
- (void)begin;
/*! @brief end commits the command buffer */
- (void)end;
@end
NS_ASSUME_NONNULL_END