mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[iOS] merge shader header and disable cpp-interp in example project (#2808)
* [iOS] disable objc-interp in example project & reuse struct header inside shader * [iOS] support sharing Shader Header on both cocoapods and SPM
This commit is contained in:
parent
e10a9f04c5
commit
88230582c2
@ -18,7 +18,8 @@ Spine runtimes for iOS.
|
|||||||
s.platform = :ios, '13.0'
|
s.platform = :ios, '13.0'
|
||||||
|
|
||||||
s.xcconfig = {
|
s.xcconfig = {
|
||||||
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp/include" "$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp-lite"'
|
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp/include" "$(PODS_ROOT)/SpineCppLite/spine-cpp/spine-cpp-lite"',
|
||||||
|
'MTL_HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/SpineShadersStructs"'
|
||||||
}
|
}
|
||||||
|
|
||||||
s.resource_bundles = {
|
s.resource_bundles = {
|
||||||
|
|||||||
@ -462,7 +462,7 @@
|
|||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Spine iOS Example/Spine iOS Example-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Spine iOS Example/Spine iOS Example-Bridging-Header.h";
|
||||||
SWIFT_OBJC_INTEROP_MODE = objcxx;
|
SWIFT_OBJC_INTEROP_MODE = objc;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
@ -506,7 +506,7 @@
|
|||||||
SUPPORTS_MACCATALYST = NO;
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Spine iOS Example/Spine iOS Example-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Spine iOS Example/Spine iOS Example-Bridging-Header.h";
|
||||||
SWIFT_OBJC_INTEROP_MODE = objcxx;
|
SWIFT_OBJC_INTEROP_MODE = objc;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,27 +2,15 @@
|
|||||||
#include <simd/simd.h>
|
#include <simd/simd.h>
|
||||||
using namespace metal;
|
using namespace metal;
|
||||||
|
|
||||||
typedef enum SpineVertexInputIndex {
|
#if __has_include("spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h")
|
||||||
SpineVertexInputIndexVertices = 0,
|
// Cocoapods Target
|
||||||
SpineVertexInputIndexTransform = 1,
|
#include "spine-ios/Sources/SpineShadersStructs/SpineShadersStructs.h"
|
||||||
SpineVertexInputIndexViewportSize = 2,
|
#elif __has_include("../../SpineShadersStructs/SpineShadersStructs.h")
|
||||||
} SpineVertexInputIndex;
|
// Swift Package target
|
||||||
|
#include "../../SpineShadersStructs/SpineShadersStructs.h"
|
||||||
typedef enum SpineTextureIndex {
|
#else
|
||||||
SpineTextureIndexBaseColor = 0,
|
#error "Header not found. Please correct Header search path"
|
||||||
} SpineTextureIndex;
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
simd_float2 position;
|
|
||||||
simd_float4 color;
|
|
||||||
simd_float2 uv;
|
|
||||||
} SpineVertex;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
simd_float2 translation;
|
|
||||||
simd_float2 scale;
|
|
||||||
simd_float2 offset;
|
|
||||||
} SpineTransform;
|
|
||||||
|
|
||||||
struct RasterizerData {
|
struct RasterizerData {
|
||||||
simd_float4 position [[position]];
|
simd_float4 position [[position]];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user