Create Terrain2 app, using Xcode's boilerplate
This commit is contained in:
parent
df0a4ca6fc
commit
a771c2622a
14 changed files with 1493 additions and 0 deletions
49
Terrain2/ShaderTypes.h
Normal file
49
Terrain2/ShaderTypes.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// ShaderTypes.h
|
||||
// Terrain2
|
||||
//
|
||||
// Created by Eryn Wells on 11/3/18.
|
||||
// Copyright © 2018 Eryn Wells. All rights reserved.
|
||||
//
|
||||
|
||||
//
|
||||
// Header containing types and enum constants shared between Metal shaders and Swift/ObjC source
|
||||
//
|
||||
#ifndef ShaderTypes_h
|
||||
#define ShaderTypes_h
|
||||
|
||||
#ifdef __METAL_VERSION__
|
||||
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
|
||||
#define NSInteger metal::int32_t
|
||||
#else
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <simd/simd.h>
|
||||
|
||||
typedef NS_ENUM(NSInteger, BufferIndex)
|
||||
{
|
||||
BufferIndexMeshPositions = 0,
|
||||
BufferIndexMeshGenerics = 1,
|
||||
BufferIndexUniforms = 2
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, VertexAttribute)
|
||||
{
|
||||
VertexAttributePosition = 0,
|
||||
VertexAttributeTexcoord = 1,
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSInteger, TextureIndex)
|
||||
{
|
||||
TextureIndexColor = 0,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
matrix_float4x4 projectionMatrix;
|
||||
matrix_float4x4 modelViewMatrix;
|
||||
} Uniforms;
|
||||
|
||||
#endif /* ShaderTypes_h */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue