Copyright | (c) 2015 Brian W Bush |
---|---|
License | MIT |
Maintainer | Brian W Bush <consult@brianwbush.info> |
Stability | Stable |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
A simple callback for using DLP stereo with 3-D Ready Sync projectors and OpenGL. See Graphics.Rendering.DLP for more primitive functions for using DLP and for notes on DLP specifications and hardware.
Here is a skeletal example illustrating the use of frame-sequential DLP:
main :: IO () main = do _ <- getArgsAndInitialize initialDisplayMode $= [WithDepthBuffer, DoubleBuffered] _ <- createWindow "DLP Stereo OpenGL Example" depthFunc $= Just Less idleCallback $= Just (postRedisplay Nothing) -- Use frame-sequential DLP encoding. dlpDisplayCallback $= def {dlpEncoding = FrameSequential, doDisplay = display} mainLoop display :: DlpDisplayCallback display eye = do -- Shift the view slightly, depending on for which eye to draw. translate $ Vector3 (if eye == LeftDlp then -0.05 else 0.05 :: GLfloat) 0 0 -- All of the rendering actions go here. renderPrimitive . . .
Callbacks
data DlpDisplay Source #
The type of DLP encoding and the actions associated with the display callback.
DlpDisplay | |
|
type DlpDisplayCallback Source #
= DlpEye | The eye to be displayed. |
-> DisplayCallback | The action to display the view from the eye in question. |
A callback for displaying using DLP.
dlpDisplayCallback :: SettableStateVar DlpDisplay Source #
Set a DLP display callback. Note that preDisplay
is executed first, then doDisplay
is executed to display the views for whichever eye(s) need displaying, and finally postDisplay
is executed before swapBuffers
is executed. The viewport is adjusted appropriately each time before doDisplay
is executed.