[orx-shader-phrases] Add ShaderPhraseRegistry

This commit is contained in:
Edwin Jakobs
2021-03-19 20:01:52 +01:00
parent 9396eaa63c
commit 94722ba1f3
5 changed files with 163 additions and 36 deletions

View File

@@ -0,0 +1,23 @@
import org.amshove.kluent.`should be`
import org.openrndr.extra.shaderphrases.ShaderPhrase
import org.openrndr.extra.shaderphrases.ShaderPhraseBook
import org.openrndr.extra.shaderphrases.ShaderPhraseRegistry
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
class TestShaderPhraseBookobject : Spek({
describe("A shader phrase book") {
val book = object:ShaderPhraseBook("testBook") {
val phrase = ShaderPhrase("""
|vec4 test_phrase() {
|}
""".trimMargin() )
}
it("can be registered") {
book.register()
}
it("can be found") {
ShaderPhraseRegistry.findPhrase("testBook.test_phrase") `should be` book.phrase
}
}
})