Skip to content

Commit

Permalink
less aggressive errors; wait for initialization if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
oatmealine committed Oct 17, 2022
1 parent fbaece4 commit 1086c87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,15 +332,13 @@ local sprite = Sprite('docs/uranium.png')
local shader = Shader('src/shader.frag') -- returns a RageShaderProgram
```

Afterwards, call `setShader` on your actor. _Using `:SetShader` will not work._
Afterwards, call `setShader` on your actor. You can call this outside of `uranium.init`, if you like.

```lua
function uranium.init()
setShader(actor, shader)
-- or
setShaderfuck(shader)
-- (don't forget to clearShaderfuck())
end
setShader(actor, shader)
-- or
setShaderfuck(shader)
-- (don't forget to clearShaderfuck())
```

If you prefer, you can also inline shader code, as long as you don't mix files with inlined code in the same shader:
Expand Down Expand Up @@ -1339,9 +1337,7 @@ void main() {
shader:uniform1f('yo', 1)
shader:uniform1f('scale', 0.25)

function uranium.init()
setShader(sprite, shader)
end
setShader(sprite, shader)

function uranium.update()
shader:uniform1f('tx', t)
Expand Down
2 changes: 1 addition & 1 deletion template
Submodule template updated from 702062 to 9681b0

0 comments on commit 1086c87

Please sign in to comment.