Torque2D Reference
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Functions
Viewing Volume Functions

Functions

void dglSetViewport (const RectI &aViewPort)
 sets the viewport for the window More...
 
void dglGetViewport (RectI *outViewport)
 gets the current viewport of the window More...
 
void dglSetFrustum (F64 left, F64 right, F64 bottom, F64 top, F64 nearDist, F64 farDist, bool ortho=false)
 
void dglGetFrustum (F64 *left, F64 *right, F64 *bottom, F64 *top, F64 *nearDist, F64 *farDist)
 
bool dglIsOrtho ()
 returns whether or not the coordinate system is orthographic (if it is not projected) More...
 
void dglSetClipRect (const RectI &clipRect)
 
const RectIdglGetClipRect ()
 

Detailed Description

These functions set up the view cube of the window.

Function Documentation

const RectI& dglGetClipRect ( )

Gets the last clip rect specified by a call to dglSetClipRect

See Also
dglSetClipRect
void dglGetFrustum ( F64 *  left,
F64 *  right,
F64 *  bottom,
F64 *  top,
F64 *  nearDist,
F64 *  farDist 
)

Returns the parameters for the current viewing frustrum

See Also
dglSetFrustrum
void dglGetViewport ( RectI outViewport)

gets the current viewport of the window

bool dglIsOrtho ( )

returns whether or not the coordinate system is orthographic (if it is not projected)

void dglSetClipRect ( const RectI clipRect)

Sets up an orthographical viewport and clipping region. This is best used for guis

Parameters
clipRectThe bounds of the coordinate system
void dglSetFrustum ( F64  left,
F64  right,
F64  bottom,
F64  top,
F64  nearDist,
F64  farDist,
bool  ortho = false 
)

Sets the viewing frustrum. This effectively creates the view volume and sets up the 6 clipping planes (near, far, left, right, top, bottom)

Parameters
leftThis is the position of the left vertical clipping plane
rightThis is the position of the right vertical clipping plane
topThis is the position of the top horizontal clipping plane
bottomThis is the position of the bottom horizontal clipping plane
nearDistThis is the distance between the eye and the near clipping plane
farDistThis is the distance between the eye and the far clipping plane
ortho(optional, default is false) If left false, calling this function will create a projection viewing volume. If true, it will be orthographic
void dglSetViewport ( const RectI aViewPort)

sets the viewport for the window