Classes | Typedefs | Functions | Variables

Viewport
[Wavepacket GLUT Libraries]


This library defines objects to help clients manage multiple viewports on a single window or screen. More...

Collaboration diagram for Viewport:

Classes

struct  view::render_info_t
class  view::Host
 If you are creating viewports, you'll need an object that supports this interface to handle the per-viewport callbacks for display. More...
class  view::Manager
 This object will let you create/destroy viewports as needed. More...

Typedefs

typedef rect2d_t< int > view::recti_t

Functions

void view::render_info_t::clear (void) throw ()
void view::render_info_t::dump (const char *txt) const throw ()
bool view::render_info_t::isValid (void) const throw ()
virtual void view::Host::render3D (int id, const render_info_t &ri)=0
 host is being called to render this viewport's 3D scene
virtual void view::Host::render2D (int id, const render_info_t &ri)=0
 host is being called to render this viewport's 2D overlay.
virtual int view::Manager::getViewportCount (void) const =0
virtual void view::Manager::render (int windowWidth, int windowHeight)=0
 render all viewports.
virtual int view::Manager::getOwnerOfCoordinate (int x, int y, int width, int height, int &ownerX, int &ownerY)=0
 given an x/y coordinate, who owns it? Returns -1 if no one owns if someone owns, returns the x and y coordinates relative to the viewport of that owner.
virtual bool view::Manager::createViewport (int id, smart_ptr< Host > host)=0
 caller can request a new viewport be created.
virtual bool view::Manager::removeViewport (int id)=0
 remove the specified viewport.
static smart_ptr< Manager > view::Manager::create (void)

Variables

int view::render_info_t::width
 viewport width (pixels)
int view::render_info_t::height
 viewport height (pixels)

Detailed Description


This library defines objects to help clients manage multiple viewports on a single window or screen.

A common use case is a client wanting to present multiple different 3D scenes on the same window.


Typedef Documentation

typedef rect2d_t<int> view::recti_t

Definition at line 61 of file viewport.h.


Function Documentation

void view::render_info_t::clear ( void   )  throw () [inline, inherited]

Definition at line 66 of file viewport.h.

void view::render_info_t::dump ( const char *  txt  )  const throw () [inline, inherited]

Definition at line 69 of file viewport.h.

bool view::render_info_t::isValid ( void   )  const throw () [inline, inherited]

Definition at line 72 of file viewport.h.

virtual void view::Host::render3D ( int  id,
const render_info_t ri 
) [pure virtual, inherited]

host is being called to render this viewport's 3D scene

virtual void view::Host::render2D ( int  id,
const render_info_t ri 
) [pure virtual, inherited]

host is being called to render this viewport's 2D overlay.

The OpenGL drawing context has already been set for 2D drawing. 2D coordinates are relative to the viewport (so 0,0 is the top left of the viewport). Reminder: this library uses the wavepacket 2D coordinate convention, where y=0 is the top of the screen, and positive y is down. This is opposite to the usual OpenGL convention.

virtual int view::Manager::getViewportCount ( void   )  const [pure virtual, inherited]
virtual void view::Manager::render ( int  windowWidth,
int  windowHeight 
) [pure virtual, inherited]

render all viewports.

The Manager will make two passes: first all viewports will be called on Host::render3D(), then 2D context will be set up, and then all viewports will be called on Host::render2D().

virtual int view::Manager::getOwnerOfCoordinate ( int  x,
int  y,
int  width,
int  height,
int &  ownerX,
int &  ownerY 
) [pure virtual, inherited]

given an x/y coordinate, who owns it? Returns -1 if no one owns if someone owns, returns the x and y coordinates relative to the viewport of that owner.

virtual bool view::Manager::createViewport ( int  id,
smart_ptr< Host host 
) [pure virtual, inherited]

caller can request a new viewport be created.

Caller is responsible for providing the ID of the new viewport. Returns false on failure (fails if ID is already in use). Viewport IDs must be greater than zero.

virtual bool view::Manager::removeViewport ( int  id  )  [pure virtual, inherited]

remove the specified viewport.

Returns false on failure (no viewport with the specified ID found).

smart_ptr< Manager > view::Manager::create ( void   )  [static, inherited]

Definition at line 466 of file viewport.cpp.


Variable Documentation

int view::render_info_t::width [inherited]

viewport width (pixels)

Definition at line 77 of file viewport.h.

int view::render_info_t::height [inherited]

viewport height (pixels)

Definition at line 78 of file viewport.h.