|
|
|
| Description |
| OpenGL support, including Vertex, TexCoord, etc instances for Vec2, Vec3 and Vec4.
|
|
| Synopsis |
|
| type GLflt = GLfloat | | | glflt :: Float -> GLflt | | | unflt :: GLflt -> Float | | | class ToOpenGLMatrix m where | | | | class FromOpenGLMatrix m where | | | | setMatrix :: ToOpenGLMatrix m => Maybe MatrixMode -> m -> IO () | | | getMatrix :: FromOpenGLMatrix m => Maybe MatrixMode -> IO m | | | matrix :: (ToOpenGLMatrix m, FromOpenGLMatrix m) => Maybe MatrixMode -> StateVar m | | | currentMatrix :: (ToOpenGLMatrix m, FromOpenGLMatrix m) => StateVar m | | | multMatrix :: ToOpenGLMatrix m => m -> IO () | | | radianToDegrees :: RealFrac a => a -> a | | | degreesToRadian :: Floating a => a -> a | | | glRotate :: Float -> Vec3 -> IO () | | | glTranslate :: Vec3 -> IO () | | | glScale3 :: Vec3 -> IO () | | | glScale :: Float -> IO () | | | orthoMatrix :: (Float, Float) -> (Float, Float) -> (Float, Float) -> Mat4 | | | orthoMatrix2 :: Vec3 -> Vec3 -> Mat4 | | | frustumMatrix :: (Float, Float) -> (Float, Float) -> (Float, Float) -> Mat4 | | | frustumMatrix2 :: Vec3 -> Vec3 -> Mat4 | | | inverseFrustumMatrix :: (Float, Float) -> (Float, Float) -> (Float, Float) -> Mat4 | | | class VertexAttrib' a where | |
|
|
| Documentation |
|
|
|
|
|
|
|
| class ToOpenGLMatrix m where | Source |
|
There should be a big warning here about the different conventions,
hidden transpositions, and all the confusion this will inevitably cause...
As it stands,
glRotate t1 axis1 >> glRotate t2 axis2 >> glRotate t3 axis3
has the same result as
multMatrix (rotMatrixProj4 t3 axis3 .*. rotMatrixProj4 t2 axis2 .*. rotMatrixProj4 t1 axis1)
because at the interface of OpenGL and this library there is a transposition
to compensate for the different conventions. (This transposition is implicit
in the code, because the way the matrices are stored in the memory is also
different: OpenGL stores them column-major, and we store them row-major).
| | | Methods | | | Instances | |
|
|
| class FromOpenGLMatrix m where | Source |
|
| | Methods | | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| The angle is in radians. (WARNING: OpenGL uses degrees!)
|
|
|
|
|
|
|
|
|
| :: (Float, Float) | (left,right)
| | -> (Float, Float) | (bottom,top)
| | -> (Float, Float) | (near,far)
| | -> Mat4 | | | "Orthogonal projecton" matrix, a la OpenGL
(the corresponding functionality is removed in OpenGL 3.1)
|
|
|
|
| :: Vec3 | (left,top,near)
| | -> Vec3 | (right,bottom,far)
| | -> Mat4 | | | The same as orthoMatrix, but with a different parametrization.
|
|
|
|
| :: (Float, Float) | (left,right)
| | -> (Float, Float) | (bottom,top)
| | -> (Float, Float) | (near,far)
| | -> Mat4 | | | "Perspective projecton" matrix, a la OpenGL
(the corresponding functionality is removed in OpenGL 3.1).
|
|
|
|
|
|
|
|
|
| class VertexAttrib' a where | Source |
|
| | Methods | | | Instances | |
|
|
| Produced by Haddock version 2.4.1 |