diff --git a/app/Main.hs b/app/Main.hs index a41ba64..2ba1684 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -58,12 +58,15 @@ main = preLoopImpl :: Affection UserData () preLoopImpl = liftIO $ do void $ SDL.setMouseLocationMode SDL.RelativeLocation - -- GL.depthFunc $= Just GL.Less - GL.textureFilter GL.Texture2D $= ((GL.Nearest, Nothing), GL.Nearest) - GLU.texture2DWrap $= (GL.Repeated, GL.ClampToEdge) - GL.texture GL.Texture2D $= GL.Enabled - -- GL.frontFace $= GL.CW + GL.blendFunc $= (GL.SrcAlpha, GL.OneMinusSrcAlpha) + GL.frontFace $= GL.CCW + GL.blend $= GL.Enabled + GL.depthFunc $= Nothing + GL.scissor $= Nothing + GL.viewport $= (GL.Position 0 0, GL.Size 1920 1080) + GL.clearColor $= GL.Color4 1 1 1 1 + loadStateImpl :: IO UserData loadStateImpl = do diff --git a/app/Renderer.hs b/app/Renderer.hs index 5a5eb7c..791a1d3 100644 --- a/app/Renderer.hs +++ b/app/Renderer.hs @@ -149,6 +149,12 @@ loadSprites amount = do -- [ (V2 0 0) -- ] + GL.texture GL.Texture2D $= GL.Enabled + GLU.texture2DWrap $= (GL.Repeated, GL.ClampToEdge) + GL.textureFilter GL.Texture2D $= ((GL.Nearest, Just GL.Nearest), GL.Nearest) + GL.textureWrapMode GL.Texture2D GL.S $= (GL.Repeated, GL.Repeat) + GL.textureWrapMode GL.Texture2D GL.T $= (GL.Repeated, GL.Repeat) + textObj <- initSpriteTextureObjects lookups positions <- replicateM amount $ do diff --git a/app/Types/Sprite.hs b/app/Types/Sprite.hs index cc6f7c1..a30ae27 100644 --- a/app/Types/Sprite.hs +++ b/app/Types/Sprite.hs @@ -42,7 +42,6 @@ instance Renderable Sprite where GL.bindVertexArrayObject $= Just vao GL.activeTexture $= GL.TextureUnit 0 GL.textureBinding GL.Texture2D $= Just texture - GL.clearColor $= GL.Color4 1 1 1 1 -- let projection = ortho (-960) 960 (-540) 540 (-1) 1 :: M44 Float -- GLU.setUniform prog "projection" (projection)