Initial Import
[glAntsMech.git] / octanemech / src / MechDisplay.hs
bloba6057a339ac35fa8eb9f204b884294500a3c3506
1 ----------------------------------------
2 {- Module : Display
3 Copyright : BSD License
4 License :
5 Maintainer : Berlin Brown
6 Stability :
7 Portability :
8 Description : Display
9 TODO :
10 Date : 9/20/2007
12 ----------------------------------------
14 module MechDisplay (displayGameLoop, idle) where
16 import Graphics.Rendering.OpenGL
17 import Graphics.UI.GLUT
19 import MechTerrain
20 import BasicMechs
23 -- Core display game loop, including rendering the scene
24 -- and swapping the GL double buffer.
25 displayGameLoop mechObjRef rotationMatrix = do
26 clear [ColorBuffer]
27 curMech <- get mechObjRef
28 prevMatrix <- get rotationMatrix
29 loadIdentity
31 multMatrix prevMatrix
32 curMatrix <- get ((matrix $ Just $ Modelview 0)::StateVar(GLmatrix GLdouble))
34 loadIdentity
35 scale 0.06 0.06 (0.06::GLfloat)
36 multMatrix curMatrix
38 -- Render the terrain, including the flat plain
39 renderTerrain
41 -- Render the Mechs
42 renderBasicMech curMech
44 -- OpenGL, swap buffers
45 swapBuffers
48 -- Idle function, do nothing
49 idle = do
50 postRedisplay Nothing