// // Context.h // MetalRenderer // // Created by Stuart Carnie on 6/9/18. // Copyright © 2018 Stuart Carnie. All rights reserved. // #import #import #import "RendererCommon.h" @interface Texture : NSObject @property (readonly) id texture; @property (readonly) id sampler; @end /*! @brief Context contains the render state used by various components */ @interface Context : NSObject @property (readonly) id device; @property (readonly) id library; /*! @brief Returns the command buffer for the current frame */ @property (readonly) id commandBuffer; @property (readonly) id nextDrawable; @property (readonly) id renderTexture; - (instancetype)initWithDevice:(id)d layer:(CAMetalLayer *)layer library:(id)l; - (Texture *)newTexture:(struct texture_image)image filter:(enum texture_filter_type)filter; - (void)convertFormat:(RPixelFormat)fmt from:(id)src to:(id)dst; /*! @brief begin marks the beginning of a frame */ - (void)begin; /*! @brief end commits the command buffer */ - (void)end; @end