2018-06-20 21:29:53 -07:00
|
|
|
//
|
|
|
|
// RendererCommon.h
|
|
|
|
// MetalRenderer
|
|
|
|
//
|
|
|
|
// Created by Stuart Carnie on 6/3/18.
|
|
|
|
// Copyright © 2018 Stuart Carnie. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef RendererCommon_h
|
|
|
|
#define RendererCommon_h
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2018-06-23 13:32:46 -07:00
|
|
|
// TODO(sgc): implement triple buffering
|
2018-06-20 21:29:53 -07:00
|
|
|
/*! @brief maximum inflight frames */
|
2018-06-23 13:32:46 -07:00
|
|
|
#define MAX_INFLIGHT 1
|
2018-06-20 21:29:53 -07:00
|
|
|
|
|
|
|
#pragma mark - Pixel Formats
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, RPixelFormat) {
|
2018-06-23 13:32:46 -07:00
|
|
|
|
|
|
|
RPixelFormatInvalid,
|
|
|
|
|
|
|
|
/* 16-bit formats */
|
|
|
|
RPixelFormatBGRA4Unorm,
|
|
|
|
RPixelFormatB5G6R5Unorm,
|
|
|
|
|
|
|
|
RPixelFormatBGRA8Unorm,
|
|
|
|
RPixelFormatBGRX8Unorm, // RetroArch XRGB
|
|
|
|
|
|
|
|
RPixelFormatCount,
|
2018-06-20 21:29:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
extern NSUInteger RPixelFormatToBPP(RPixelFormat format);
|
|
|
|
extern NSString *NSStringFromRPixelFormat(RPixelFormat format);
|
|
|
|
|
|
|
|
typedef NS_ENUM(NSUInteger, RTextureFilter) {
|
2018-06-23 13:32:46 -07:00
|
|
|
RTextureFilterNearest,
|
|
|
|
RTextureFilterLinear,
|
|
|
|
|
|
|
|
RTextureFilterCount,
|
2018-06-20 21:29:53 -07:00
|
|
|
};
|
|
|
|
|
2018-06-23 23:53:45 -07:00
|
|
|
extern matrix_float4x4 matrix_proj_ortho(float left, float right, float top, float bottom);
|
|
|
|
|
2018-06-20 21:29:53 -07:00
|
|
|
#endif /* RendererCommon_h */
|