-- | Bind the given renderer to prepare it for rendering.
bind :: StaticProgramUniforms -> StaticModelRenderer -> IO ()
bind (StaticProgramUniforms kaLoc kdLoc ksLoc shiLoc texLoc _ _ _) (StaticModelRenderer model) =
    let (Material _ ka kd ks shi) = material model
    in do
        bindVAO . vao $ model
        bindTexture $ texture model
        activeTexture $= gl_TEXTURE0
        glUniform1i texLoc 0

-- | Render the given renderer.
bind :: StaticProgramUniforms -> StaticModelRenderer -> IO ()
bind (StaticProgramUniforms kaLoc kdLoc ksLoc shiLoc texLoc _ _ _) (StaticModelRenderer model) =
    let (Material _ ka kd ks shi) = material model
    in do
        bindVAO . vao $ model
        bindTexture $ texture model
        activeTexture $= gl_TEXTURE0
        glUniform1i texLoc 0

-- | Render the given renderer.
bind (StaticProgramUniforms kaLoc kdLoc ksLoc shiLoc texLoc _ _ _) (StaticModelRenderer model) =
    let (Material _ ka kd ks shi) = material model
    in do
        bindVAO . vao $ model
        bindTexture $ texture model
        activeTexture $= gl_TEXTURE0
        glUniform1i texLoc 0

-- | Render the given renderer.