tobbebex / GPipe-Core

Core library of new GPipe, encapsulating OpenGl and providing a type safe minimal library
158 stars 30 forks source link

Viewport update on window resize #59

Closed Kludgy closed 6 years ago

Kludgy commented 6 years ago

Is there a way to update the viewport without recompiling fragment shaders? (Should there be?)

tobbebex commented 6 years ago

Yes, the Viewport is provided to the rasterize function as a function over the Shader monad environment s. So you can create a CompiledShader that takes the Viewport as argument, eg (ViewPort, SomeOtherDataYouNeedPerFrame) -> Render os ().

Hope that helps!

Kludgy commented 6 years ago

Yes that was the missing piece for me, thank you!