module Shader (drawShaderLay) where import Control.Lens import Control.Monad.Primitive import qualified Data.Vector.Unboxed.Mutable as UMV import Graphics.GL.Core45 import Shader.Data import Shader.Parameters drawShaderLay :: Int -> UMV.MVector (PrimState IO) Int -> Int -> (Shader, VBO) -> IO () {-# INLINE drawShaderLay #-} drawShaderLay l countsVector shadIn fs = do i <- UMV.read countsVector shadIn glUseProgram (_shaderUINT $ fst fs) glBindVertexArray $ fs ^. _1 . shaderVAO . unVAO glDrawArrays (_unPrimitiveMode $ _shaderPrimitive $ fst fs) (fromIntegral $ l * numSubElements) (fromIntegral i)