Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

sglView Class Reference

#include <sglView.hpp>

List of all members.

Public Methods

 sglView ()
virtual ~sglView ()
void setClearColor (const sglVec4f &color)
void setClearColor (float r, float g, float b, float a)
const sglVec4f& getClearColor () const
void setClearDepth (double depth)
double getClearDepth () const
void setViewport (int origin_x, int origin_y, unsigned int width, unsigned int height)
void getViewport (int &origin_x, int &origin_y, unsigned int &width, unsigned int &height)
void setScene (sglScene *root)
sglScenegetScene () const
void setViewPlatform (sglViewPlatform *view_platform)
sglViewPlatformgetViewPlatform () const
void setScene (sglScene *root, sglViewPlatform *view_platform)
void setTraversalType (bool dp_flag, bool stats_flag)
bool getDPTraversalFlag () const
bool getStatsFlag () const
void enableFrameRateOutput (bool on)
bool getFrameRateOutputFlag () const
void setStatsInterval (double seconds)
double getStatsInterval () const
void setOverrideStatelets (const deque< const sglStatelet *> &statelets)
void setDiscriminatorMask (unsigned int mask)
unsigned int getDiscriminatorMask () const
void setStateMask (unsigned int mask)
unsigned int getStateMask () const
void setDrawCallback (sglCallbackFunc callback, void *data)
sglCallbackFunc getDrawCallback () const
void* getDrawCallbackData () const
void cullAndDraw ()
void cullAndDraw (const sglTimespec &frame_time, unsigned int frame_count)
void setLightProcessor (sglLightProcessor *light_processor)
sglLightProcessorgetLightProcessor () const

Protected Methods

void outputFramerate ()
void preDraw (const sglTimespec &frame_time, unsigned int frame_count)
void preDraw ()
void cull ()
void draw ()


Detailed Description

Encapsulate view port, fov, and other miscellaneous functionality that SGL proper does not deal with (for quick prototyping).

Definition at line 55 of file sglView.hpp.


Constructor & Destructor Documentation

sglView::sglView ( )
 

Must be constructed after sgl::initialized() is called.


Member Function Documentation

void sglView::setClearColor ( const sglVec4f & color )
 

Color buffer clear color default: black (0, 0, 0, 1)

void sglView::setClearDepth ( double depth )
 

Depth buffer clear value default: 1.0

void sglView::setViewport ( int origin_x,
int origin_y,
unsigned int width,
unsigned int height )
 

The viewport default: origin = 0, 0; width = 640; height = 480

void sglView::setScene ( sglScene * root )
 

Specify the scene graph. Must be set before rendering can take place.

void sglView::setViewPlatform ( sglViewPlatform * view_platform )
 

Specify the view platform used to specify the view location. Must be set before rendering can take place.

void sglView::setScene ( sglScene * root,
sglViewPlatform * view_platform )
 

Specify the scene graph and view platform both must be set by the user before rendering can take place. This function is deprecated.

void sglView::setTraversalType ( bool dp_flag,
bool stats_flag )
 

Specify the traversal type: single or double precision AND whether or not stats collection is enabled. default: dp_flag = false, stats_flag = false

void sglView::enableFrameRateOutput ( bool on ) [inline]
 

configure statistics default: false (off)

Definition at line 122 of file sglView.hpp.

void sglView::setStatsInterval ( double seconds ) [inline]
 

when stats collection is enabled, this sets the output rate default: 2.0 seconds (0.5 Hz)

Definition at line 129 of file sglView.hpp.

void sglView::setOverrideStatelets ( const deque< const sglStatelet *> & statelets ) [inline]
 

specify arguments to the traversal.

Definition at line 134 of file sglView.hpp.

void sglView::setDiscriminatorMask ( unsigned int mask ) [inline]
 

the traversal discriminator mask default: ~0x0 (all bits on)

Definition at line 142 of file sglView.hpp.

void sglView::setStateMask ( unsigned int mask ) [inline]
 

the traversal state mask default: 0x0 (default states)

Definition at line 149 of file sglView.hpp.

void sglView::setDrawCallback ( sglCallbackFunc callback,
void * data ) [inline]
 

set the pre-draw callback function. If non-NULL, then the view port clearing must be performed by the user. Only the viewport size, color and depth clear values and projection matrix and view matrix will be set before this is called. (NOTE: do I need to set up the lights as well?)

Definition at line 159 of file sglView.hpp.

sglCallbackFunc sglView::getDrawCallback ( ) const [inline]
 

get the pre-draw callback function.

Definition at line 165 of file sglView.hpp.

void * sglView::getDrawCallbackData ( ) const [inline]
 

get the pre-draw callback data.

Definition at line 167 of file sglView.hpp.

void sglView::cullAndDraw ( ) [inline]
 

cull and draw the scene -- OpenGL gfx context must be current.

Definition at line 170 of file sglView.hpp.

void sglView::cullAndDraw ( const sglTimespec & frame_time,
unsigned int frame_count ) [inline]
 

cull and draw the scene with user specified frame time and frame count.

Definition at line 173 of file sglView.hpp.

void sglView::setLightProcessor ( sglLightProcessor * light_processor )
 

Set the light processor.

Parameters:
light_processor   A pointer to an object that will sort and apply the lights in view. If NULL, the processor will revert to the default processor, sglDefaultLightProcessor(). If the reference count of the old light processor goes to zero, it will be deleted.

sglLightProcessor * sglView::getLightProcessor ( ) const
 

Query the current light processor object.

Returns:
Pointer to current light processor object.


The documentation for this class was generated from the following file:
Generated at Mon Jul 1 18:00:11 2002 for SGL by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001