handa-opengl-0.1.13.0: Utility functions for OpenGL and GLUT

Copyright(c) 2015 Brian W Bush
LicenseMIT
MaintainerBrian W Bush <consult@brianwbush.info>
StabilityStable
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Graphics.UI.Handa.Setup

Contents

Description

Functions for setting up GLUT applications.

Synopsis

Functions

data Setup a Source

The configuration for setting up the display.

Constructors

Setup 

Fields

stereo :: Stereo

The type of stereo.

switchEyes :: Bool

Whether to switch the left and right eyes.

viewer :: Either (ViewerParameters a) Viewer

The viewer information.

fullscreen :: Bool

Whether to display full screen.

Instances

data Stereo Source

The type of stereo.

Constructors

DLP

Frame-sequential DLP 3D ReadySync stereo.

QuadBuffer

Quad buffer stereo.

Cardboard

Google Cardboard stereo.

Mono

No stereo.

data Viewer Source

The viewer information.

Constructors

Phone

A typical phone.

Laptop

A typical laptop.

Desktop

A typical desktop display.

Projector

A typical projector.

Glasses

Typical VR glasses.

setup Source

Arguments

:: (AdditiveGroup a, MatrixComponent a, RealFloat a, Storable a) 
=> String

The window title.

-> String

The program name.

-> [String]

The X11 arguments.

-> Setup a

The setup configuration.

-> IO (DlpEncoding, ViewerParameters a, [String])

An action returing the DLP encoding requested, the viewer parameters, and the uninterpretted arguments.

Set up a window with basic callbacks. This creates a double-buffered window with a depth buffer, a transparency blending function, a generic reshaping callback, and a redisplaying idle function. See handleArguments for information on how command-line arguments are interpretted.

handleArguments Source

Arguments

:: [String]

The arguments.

-> (Setup a, [String])

The setup configuration and the remaining, uninterpretted, arguments.

Act on command-line arguments.

  • "--dlp" puts the application in frame-sequential DLP (3D ReadySync) stereo mode.
  • "--quadbuffer" puts the application in quad-buffer stereo mode.
  • "--cardboard" puts the application in side-by-side (Google Cardboard) stereo mode.
  • "--switchEyes" swaps the views of the left and right eyes.
  • "--phone" sets the frustum for a typical smartphone.
  • "--laptop" sets the frustum for a typical laptop.
  • "--desktop" sets the frustum for a typical desktop monitor.
  • "--projection" sets the frustum for a typical projector.
  • "--fullscreen" puts the application in full screen mode.

idle :: IdleCallback Source

An idle callback that simply posts a request for redisplay.