mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
* includes rgui * shader support This is a work-in-progress and there are some bugs and visual artifacts still to be fixed.
38 lines
1.0 KiB
Objective-C
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
|