black screen?
This commit is contained in:
parent
2cd26e48d8
commit
d73c854999
3 changed files with 14 additions and 6 deletions
13
app/Main.hs
13
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue