summaryrefslogtreecommitdiffstats
path: root/src/Render.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Render.hs')
-rw-r--r--src/Render.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Render.hs b/src/Render.hs
index e243580..a5f5ae9 100644
--- a/src/Render.hs
+++ b/src/Render.hs
@@ -19,8 +19,8 @@ import qualified Data.Map as M
import Bindings.GLPng
import Graphics.Rendering.OpenGL.GL (($=), GLfloat, GLdouble, Capability(..), Vector3(..))
-import Graphics.Rendering.OpenGL.GL.BeginEnd (renderPrimitive, PrimitiveMode(..))
-import Graphics.Rendering.OpenGL.GL.CoordTrans (matrixMode, MatrixMode(..), viewport, Position(..), Size(..), loadIdentity, preservingMatrix, ortho, translate, rotate)
+import Graphics.Rendering.OpenGL.GL.BeginEnd (unsafeRenderPrimitive, PrimitiveMode(..))
+import Graphics.Rendering.OpenGL.GL.CoordTrans (matrixMode, MatrixMode(..), viewport, Position(..), Size(..), loadIdentity, unsafePreservingMatrix, ortho, translate, rotate)
import Graphics.Rendering.OpenGL.GL.Framebuffer (clear, ClearBuffer(..))
import Graphics.Rendering.OpenGL.GL.PerFragment (blend, blendFunc, BlendingFactor(..))
import Graphics.Rendering.OpenGL.GL.Texturing.Application (texture)
@@ -86,7 +86,7 @@ render = do
texture Texture2D $= Enabled
textureBinding Texture2D $= Just textureWood
- renderPrimitive Quads $ do
+ unsafeRenderPrimitive Quads $ do
texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
vertex $ Vertex2 0 lh
@@ -99,7 +99,7 @@ render = do
texCoord $ TexCoord2 0 (lh/2)
vertex $ Vertex2 (0 :: GLfloat) (0 :: GLfloat)
- forM_ tanklist $ \tank -> preservingMatrix $ do
+ forM_ tanklist $ \tank -> unsafePreservingMatrix $ do
let x = fromReal . tankX $ tank
y = fromReal . tankY $ tank
rotDir = fromReal . tankDir $ tank
@@ -110,7 +110,7 @@ render = do
textureBinding Texture2D $= Just textureTank
- renderPrimitive Quads $ do
+ unsafeRenderPrimitive Quads $ do
texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
vertex $ Vertex2 (-0.5 :: GLfloat) (-0.5 :: GLfloat)
@@ -127,7 +127,7 @@ render = do
textureBinding Texture2D $= Just textureCannon
- renderPrimitive Quads $ do
+ unsafeRenderPrimitive Quads $ do
texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
vertex $ Vertex2 (-0.5 :: GLfloat) (-0.5 :: GLfloat)
@@ -140,7 +140,7 @@ render = do
texCoord $ TexCoord2 (1 :: GLfloat) (0 :: GLfloat)
vertex $ Vertex2 (0.5 :: GLfloat) (-0.5 :: GLfloat)
- forM_ bulletlist $ \bullet -> preservingMatrix $ do
+ forM_ bulletlist $ \bullet -> unsafePreservingMatrix $ do
let x = fromReal . bulletX $ bullet
y = fromReal . bulletY $ bullet
rotDir = fromReal . bulletDir $ bullet
@@ -150,18 +150,18 @@ render = do
textureBinding Texture2D $= Just textureBullet
- renderPrimitive Quads $ do
+ unsafeRenderPrimitive Quads $ do
texCoord $ TexCoord2 (0 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex2 (-0.2 :: GLfloat) (-0.2 :: GLfloat)
+ vertex $ Vertex2 (-0.1 :: GLfloat) (-0.1 :: GLfloat)
texCoord $ TexCoord2 (0 :: GLfloat) (1 :: GLfloat)
- vertex $ Vertex2 (-0.2 :: GLfloat) (0.2 :: GLfloat)
+ vertex $ Vertex2 (-0.1 :: GLfloat) (0.1 :: GLfloat)
texCoord $ TexCoord2 (1 :: GLfloat) (1 :: GLfloat)
- vertex $ Vertex2 (0.2 :: GLfloat) (0.2 :: GLfloat)
+ vertex $ Vertex2 (0.1 :: GLfloat) (0.1 :: GLfloat)
texCoord $ TexCoord2 (1 :: GLfloat) (0 :: GLfloat)
- vertex $ Vertex2 (0.2 :: GLfloat) (-0.2 :: GLfloat)
+ vertex $ Vertex2 (0.1 :: GLfloat) (-0.1 :: GLfloat)
fromReal :: (Real a, Fractional b) => a -> b