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

OpenGLViewportC Class Reference

Device interface for OpenGL. More...

#include <OpenGLViewportC.h>

Inheritance diagram for OpenGLViewportC:

GraphicsViewportI DeviceInterfaceI DataBlockI List of all members.

Public Methods

virtual Edit::DataBlockIcreate ()
 Creates new datablock.

virtual PluginClass::ClassIdC get_class_id () const
 Returns class ID.

virtual const char * get_class_name ()
 Returns device's class name as NULL terminated string.

virtual void set_perspective (const PajaTypes::BBox2C &rBBox, PajaTypes::float32 f32FOV, PajaTypes::float32 f32Aspect, PajaTypes::float32 f32ZNear, PajaTypes::float32 f32ZFar)
 Sets perspective viewport and projection matrix.

virtual void set_ortho (const PajaTypes::BBox2C &rBBox, PajaTypes::float32 f32Left, PajaTypes::float32 f32Right, PajaTypes::float32 f32Top, PajaTypes::float32 f32Bottom, PajaTypes::float32 f32ZNear=-1, PajaTypes::float32 f32ZFar=1)
 Sets orthographic viewport and projection matrix.

virtual void set_ortho_pixel (const PajaTypes::BBox2C &rBBox, PajaTypes::float32 f32ZNear=-1, PajaTypes::float32 f32ZFar=1)
 Sets orthographic viewport and projection matrix.

virtual PajaTypes::Vector2C client_to_layout (const PajaTypes::Vector2C &rVec)
 Converts positions in screen pixels to the layout coordinate system.

virtual PajaTypes::Vector2C layout_to_client (const PajaTypes::Vector2C &rVec)
 Converts positions in layout coordinate system uints to the screen pixels.

virtual PajaTypes::Vector2C delta_client_to_layout (const PajaTypes::Vector2C &rVec)
 Converts delta values of screen pixels to the layout coordinate system.

virtual PajaTypes::Vector2C delta_layout_to_client (const PajaTypes::Vector2C &rVec)
 Converts delta values layout coordinate system uints to the screen pixels.

virtual const PajaTypes::BBox2Cget_viewport ()
 Returns the viewport (visible are of the demo).

virtual const PajaTypes::BBox2Cget_layout ()
 Returns the layout (rendering are of the demo).

virtual PajaTypes::int32 get_width ()
 Returns the width of the screen in pixels.

virtual PajaTypes::int32 get_height ()
 Returns the height of the screen in pixels.

virtual PajaTypes::float32 get_pixel_aspect_ratio ()
 Returns the pixel aspect ratio.

virtual void set_pixel_aspect_ratio (PajaTypes::float32 f32PixelAspect)
 Sets the pixel aspect ratio (height per width).

virtual void set_dimension (PajaTypes::int32 i32PosX, PajaTypes::int32 i32PosY, PajaTypes::int32 i32Width, PajaTypes::int32 i32Height)
 Sets the dimension of the OpenGL rendering are in pixels (used internally).

virtual void set_viewport (const PajaTypes::BBox2C &rViewport)
 Sets the viewport (used internally).

virtual void set_layout (const PajaTypes::BBox2C &rLayout)
 Sets the layout (used internally).

virtual void activate ()
 Resets the last set viewport to the device.


Static Public Methods

OpenGLViewportC * create_new ()

Protected Methods

 OpenGLViewportC ()
 Default constructor (used internally).

virtual ~OpenGLViewportC ()
 Default destructor.


Detailed Description

Device interface for OpenGL.

The purpose of the device interface for OpenGL is to setup the area where an effect can draw and to convert coordinates from screen (pixel) coordinates to the layout.


Constructor & Destructor Documentation

OpenGLViewportC   [protected]
 

Default constructor (used internally).

virtual ~OpenGLViewportC   [protected, virtual]
 

Default destructor.


Member Function Documentation

virtual void activate   [virtual]
 

Resets the last set viewport to the device.

Implements GraphicsViewportI.

virtual PajaTypes::Vector2C client_to_layout const PajaTypes::Vector2C   rVec [virtual]
 

Converts positions in screen pixels to the layout coordinate system.

Implements GraphicsViewportI.

virtual Edit::DataBlockI* create   [virtual]
 

Creates new datablock.

The create method of data block class creates new instance of the same class the data block is.

Example implementation:

            DataBlockI*
            TGAImportC::create()
            {
                return new TGAImportC;
            }

Returns :
Pointer to a new instance of this class.

Implements DataBlockI.

virtual PajaTypes::Vector2C delta_client_to_layout const PajaTypes::Vector2C   rVec [virtual]
 

Converts delta values of screen pixels to the layout coordinate system.

Implements GraphicsViewportI.

virtual PajaTypes::Vector2C delta_layout_to_client const PajaTypes::Vector2C   rVec [virtual]
 

Converts delta values layout coordinate system uints to the screen pixels.

Implements GraphicsViewportI.

virtual PluginClass::ClassIdC get_class_id   const [virtual]
 

Returns class ID.

Implements DeviceInterfaceI.

virtual const char* get_class_name   [virtual]
 

Returns device's class name as NULL terminated string.

Implements DeviceInterfaceI.

virtual PajaTypes::int32 get_height   [virtual]
 

Returns the height of the screen in pixels.

Implements GraphicsViewportI.

virtual const PajaTypes::BBox2C& get_layout   [virtual]
 

Returns the layout (rendering are of the demo).

Implements GraphicsViewportI.

virtual PajaTypes::float32 get_pixel_aspect_ratio   [virtual]
 

Returns the pixel aspect ratio.

Implements GraphicsViewportI.

virtual const PajaTypes::BBox2C& get_viewport   [virtual]
 

Returns the viewport (visible are of the demo).

Implements GraphicsViewportI.

virtual PajaTypes::int32 get_width   [virtual]
 

Returns the width of the screen in pixels.

Implements GraphicsViewportI.

virtual PajaTypes::Vector2C layout_to_client const PajaTypes::Vector2C   rVec [virtual]
 

Converts positions in layout coordinate system uints to the screen pixels.

Implements GraphicsViewportI.

virtual void set_dimension PajaTypes::int32    i32PosX,
PajaTypes::int32    i32PosY,
PajaTypes::int32    i32Width,
PajaTypes::int32    i32Height
[virtual]
 

Sets the dimension of the OpenGL rendering are in pixels (used internally).

Implements GraphicsViewportI.

virtual void set_layout const PajaTypes::BBox2C   rLayout [virtual]
 

Sets the layout (used internally).

Implements GraphicsViewportI.

virtual void set_ortho const PajaTypes::BBox2C   rBBox,
PajaTypes::float32    f32Left,
PajaTypes::float32    f32Right,
PajaTypes::float32    f32Top,
PajaTypes::float32    f32Bottom,
PajaTypes::float32    f32ZNear = -1,
PajaTypes::float32    f32ZFar = 1
[virtual]
 

Sets orthographic viewport and projection matrix.

Parameters:
rBBox  the bounding box of the effect.
f32Width  Width of the viewport.
f32Height  Height of the viewport.
f32ZNear  Near clipping plane.
f32ZFar  Far clipping plane.
This method is a replacement for glOrtho. Scrissor testing is enabled and the bounding box is used to define the scissor box.

Implements GraphicsViewportI.

virtual void set_ortho_pixel const PajaTypes::BBox2C   rBBox,
PajaTypes::float32    f32ZNear = -1,
PajaTypes::float32    f32ZFar = 1
[virtual]
 

Sets orthographic viewport and projection matrix.

Parameters:
rBBox  the bounding box of the effect.
f32ZNear  Near clipping plane.
f32ZFar  Far clipping plane.
This method sets the orthographic projection to match the pixel dimensions of the current rendering output. The origin is set to the lower left corner of the whole rendering area.

This method is equivalent to call glOrtho with: glOrtho( 0, <viewport width>, 0, <viewport height>, f32ZNear, f32ZFar );

Scrissor testing is enabled and the bounding box is used to define the scissor box.

Implements GraphicsViewportI.

virtual void set_perspective const PajaTypes::BBox2C   rBBox,
PajaTypes::float32    f32FOV,
PajaTypes::float32    f32Aspect,
PajaTypes::float32    f32ZNear,
PajaTypes::float32    f32ZFar
[virtual]
 

Sets perspective viewport and projection matrix.

Parameters:
rBBox  the bounding box of the effect.
f32FOV  FOV on x-axis.
f32Aspect  Aspect ration of the viewport.
f32ZNear  Near clipping plane.
f32ZFar  Far clipping plane.
This method is a replacement for gluPerspective. Note that the FOV is different. Scrissor testing is enabled and the bounding box is used to define the scissor box.

Implements GraphicsViewportI.

virtual void set_pixel_aspect_ratio PajaTypes::float32    f32PixelAspect [virtual]
 

Sets the pixel aspect ratio (height per width).

Implements GraphicsViewportI.

virtual void set_viewport const PajaTypes::BBox2C   rViewport [virtual]
 

Sets the viewport (used internally).

Implements GraphicsViewportI.


Moppi Demopaja SDK Documentation -- Copyright © 2000-2002 Moppi Productions