-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from yukiny0811/feat/ShaderStringBuilder
ShaderStringBuilder
- Loading branch information
Showing
8 changed files
with
83 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Yuki Kuwashima on 2024/01/09. | ||
// | ||
|
||
import Foundation | ||
|
||
@resultBuilder | ||
public struct ShaderStringBuilder { | ||
public static func buildBlock(_ component: String) -> String{ | ||
component | ||
} | ||
public static func buildBlock(_ components: String...) -> String { | ||
components.joined() | ||
} | ||
public static func buildBlock(_ components: [String]) -> String { | ||
components.joined() | ||
} | ||
public static func buildBlock(_ components: [String], _ components2: [String]) -> String { | ||
components.joined() + components2.joined() | ||
} | ||
public static func buildArray(_ components: [String]) -> String { | ||
components.joined() | ||
} | ||
public static func buildArray(_ components: [[String]]) -> String { | ||
components.joined().joined() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters