Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Producer::RenderSurface Class Reference

A RenderSurface provides a rendering surface for 3D graphics applications. More...

Inheritance diagram for Producer::RenderSurface:

Producer::Referenced List of all members.

Public Types

enum  DrawableType { DrawableType_Window, DrawableType_PBuffer }
enum  BufferType { FrontBuffer, BackBuffer }
enum  RenderToTextureMode { RenderToTextureMode_None, RenderToRGBTexture, RenderToRGBATexture }
enum  RenderToTextureTarget { Texture1D, Texture2D, TextureCUBE }
enum  RenderToTextureOptions { RenderToTextureOptions_Default = 0, RequestSpaceForMipMaps = 1, RequestLargestPBuffer = 2 }
enum  CubeMapFace {
  PositiveX = 0, NegativeX = 1, PositiveY = 2, NegativeY = 3,
  PositiveZ = 4, NegativeZ = 5
}
enum  PixelAttributeName {
  UseGL, BufferSize, Level, RGBA,
  DoubleBuffer, Stereo, AuxBuffers, RedSize,
  GreenSize, BlueSize, AlphaSize, DepthSize,
  StencilSize, AccumRedSize, AccumGreenSize, AccumBlueSize,
  AccumAlphaSize
}

Public Member Functions

 RenderSurface (void)
void setDrawableType (DrawableType)
void setReadDrawable (RenderSurface *)
void setInputRectangle (const InputRectangle &ir)
const InputRectanglegetInputRectangle ()
void bindInputRectangleToWindowSize (bool)
void setHostName (const std::string &)
const std::string & getHostName (void) const
void setDisplayNum (int)
int getDisplayNum (void) const
void setScreenNum (int)
int getScreenNum (void) const
void getScreenSize (unsigned int &width, unsigned int &height) const
void setWindowName (const std::string &)
const std::string & getWindowName (void) const
void setWindowRectangle (int x, int y, unsigned int width, unsigned int height, bool resize=true)
void getWindowRectangle (int &x, int &y, unsigned int &width, unsigned int &height) const
int getWindowOriginX () const
int getWindowOriginY () const
unsigned int getWindowWidth () const
unsigned int getWindowHeight () const
void setDisplay (Display *dpy)
Display * getDisplay (void)
const Display * getDisplay (void) const
void setWindow (const Window win)
Window getWindow (void) const
GLContext getGLContext (void) const
void setParentWindow (Window parent)
Window getParentWindow (void) const
void setVisualChooser (VisualChooser *vc)
VisualChoosergetVisualChooser (void)
const VisualChoosergetVisualChooser (void) const
void setVisualInfo (VisualInfo *vi)
VisualInfo * getVisualInfo (void)
const VisualInfo * getVisualInfo (void) const
bool isRealized (void) const
void useBorder (bool flag)
bool usesBorder ()
void useCursor (bool flag)
void useConfigEventThread (bool flag)
bool realize (VisualChooser *vc=NULL, GLContext shared_context=0)
void addRealizeCallback (Callback *realizeCB)
void setRealizeCallback (Callback *realizeCB)
virtual void swapBuffers (void)
bool makeCurrent (void) const
virtual void sync (int divisor=1)
unsigned int getRefreshRate () const
bool waitForRealize ()
void fullScreen (bool flag)
void setCustomFullScreenRectangle (int x, int y, unsigned int width, unsigned int height)
void useDefaultFullScreenRectangle ()
bool isFullScreen () const
void positionPointer (int x, int y)
void setUseDefaultEsc (bool flag)
bool getUseDefaultEsc ()
void mapWindow ()
void unmapWindow ()
void bindPBufferToTexture (BufferType buffer=FrontBuffer) const
RenderToTextureMode getRenderToTextureMode () const
void setRenderToTextureMode (RenderToTextureMode mode)
RenderToTextureTarget getRenderToTextureTarget () const
void setRenderToTextureTarget (RenderToTextureTarget target)
RenderToTextureOptions getRenderToTextureOptions () const
void setRenderToTextureOptions (RenderToTextureOptions options)
int getRenderToTextureMipMapLevel () const
void setRenderToTextureMipMapLevel (int level)
CubeMapFace getRenderToTextureFace () const
void setRenderToTextureFace (CubeMapFace face)
const std::vector< int > & getPBufferUserAttributes () const
std::vector< int > & getPBufferUserAttributes ()
void addPixelAttribute (PixelAttributeName attribute)
void addPixelAttribute (PixelAttributeName attribute, int parameter)
void addExtendedPixelAttribute (unsigned int attribute)
void addExtendedPixelAttribute (unsigned int attribute, int parameter)
void setSimplePixelConfiguration ()

Static Public Member Functions

static const std::string & getDefaultWindowName ()
static void InitThreads ()

Static Public Attributes

static const unsigned int UnknownDimension
static const std::string defaultWindowName

Protected Member Functions

virtual ~RenderSurface (void)
void _computeScreenSize (unsigned int &width, unsigned int &height) const
virtual bool _init ()
virtual void _fini ()
virtual void run ()
void _choosePixelFormat (VisualInfo *)
int _adaptPixelAttribute (PixelAttribute &attr, VisualInfo *vinfo)

Protected Attributes

DrawableType _drawableType
std::string _hostname
int _displayNum
float _windowLeft
float _windowRight
float _windowBottom
float _windowTop
int _windowX
int _windowY
unsigned int _windowWidth
unsigned int _windowHeight
unsigned int _screenWidth
unsigned int _screenHeight
bool _useCustomFullScreen
int _customFullScreenOriginX
int _customFullScreenOriginY
unsigned int _customFullScreenWidth
unsigned int _customFullScreenHeight
Display * _dpy
int _screen
Window _win
Window _parent
RenderSurface_readDrawableRenderSurface
unsigned int _parentWindowHeight
bool _realized
ref_ptr< VisualChooser_visualChooser
VisualInfo * _visualInfo
GLContext _glcontext
GLContext _sharedGlcontext
Cursor _nullCursor
bool _decorations
bool _useCursor
std::string _windowName
unsigned int _frameCount
bool _mayFullScreen
bool _isFullScreen
bool _bindInputRectangleToWindowSize
RenderToTextureMode _rtt_mode
RenderToTextureTarget _rtt_target
RenderToTextureOptions _rtt_options
int _rtt_mipmap
CubeMapFace _rtt_face
bool _rtt_dirty_mipmap
bool _rtt_dirty_face
std::vector< int > _user_pbattr
OpenThreads::Barrier * _threadReady
bool _useConfigEventThread
bool _checkOwnEvents
bool _useDefaultEsc
std::vector< Producer::ref_ptr<
Callback > > 
_realizeCallbacks
ref_ptr< Producer::Block_realizeBlock
InputRectangle _inputRectangle
std::vector< PixelAttribute_pixelAttributes

Classes

class  Callback
struct  InputRectangle
struct  PixelAttribute

Detailed Description

A RenderSurface provides a rendering surface for 3D graphics applications.

A RenderSurface creates a window in a windowing system for the purpose of 3D rendering. The focus of a RenderSurface differs from a windowing system window in that it is not a user input/output device, but rather a context and screen area specifically designed for 3D applications. Consequently, a RenderSurface does not provide or impose a requirement on the caller to structure the application around the capturing or handling of events. Further, RenderSurface provides increased control over the quality of pixel formats.


Member Enumeration Documentation

enum Producer::RenderSurface::BufferType
 

Enumerator:
FrontBuffer 
BackBuffer 

enum Producer::RenderSurface::CubeMapFace
 

Enumerator:
PositiveX 
NegativeX 
PositiveY 
NegativeY 
PositiveZ 
NegativeZ 

enum Producer::RenderSurface::DrawableType
 

Enumerator:
DrawableType_Window 
DrawableType_PBuffer 

enum Producer::RenderSurface::PixelAttributeName
 

Enumerator:
UseGL 
BufferSize 
Level 
RGBA 
DoubleBuffer 
Stereo 
AuxBuffers 
RedSize 
GreenSize 
BlueSize 
AlphaSize 
DepthSize 
StencilSize 
AccumRedSize 
AccumGreenSize 
AccumBlueSize 
AccumAlphaSize 

enum Producer::RenderSurface::RenderToTextureMode
 

Enumerator:
RenderToTextureMode_None 
RenderToRGBTexture 
RenderToRGBATexture 

enum Producer::RenderSurface::RenderToTextureOptions
 

Enumerator:
RenderToTextureOptions_Default 
RequestSpaceForMipMaps 
RequestLargestPBuffer 

enum Producer::RenderSurface::RenderToTextureTarget
 

Enumerator:
Texture1D 
Texture2D 
TextureCUBE 


Constructor & Destructor Documentation

Producer::RenderSurface::RenderSurface void   ) 
 

virtual Producer::RenderSurface::~RenderSurface void   )  [protected, virtual]
 


Member Function Documentation

int Producer::RenderSurface::_adaptPixelAttribute PixelAttribute attr,
VisualInfo *  vinfo
[protected]
 

void Producer::RenderSurface::_choosePixelFormat VisualInfo *   )  [protected]
 

void Producer::RenderSurface::_computeScreenSize unsigned int &  width,
unsigned int &  height
const [protected]
 

virtual void Producer::RenderSurface::_fini  )  [protected, virtual]
 

virtual bool Producer::RenderSurface::_init  )  [protected, virtual]
 

void Producer::RenderSurface::addExtendedPixelAttribute unsigned int  attribute,
int  parameter
 

void Producer::RenderSurface::addExtendedPixelAttribute unsigned int  attribute  ) 
 

void Producer::RenderSurface::addPixelAttribute PixelAttributeName  attribute,
int  parameter
 

void Producer::RenderSurface::addPixelAttribute PixelAttributeName  attribute  ) 
 

void Producer::RenderSurface::addRealizeCallback Callback realizeCB  ) 
 

void Producer::RenderSurface::bindInputRectangleToWindowSize bool   ) 
 

void Producer::RenderSurface::bindPBufferToTexture BufferType  buffer = FrontBuffer  )  const
 

Bind PBuffer content to the currently selected texture. This method affects PBuffer surfaces only.

void Producer::RenderSurface::fullScreen bool  flag  ) 
 

fullScreen(flag). If flag is true, RenderSurface resizes its window to fill the entire screen and turns off the border. If false, the window is returned to a size previously specified. If previous state specified a border around the window, a the border is replaced

static const std::string& Producer::RenderSurface::getDefaultWindowName  )  [static]
 

const Display* Producer::RenderSurface::getDisplay void   )  const
 

Get the const Display. (X11 only).

Display* Producer::RenderSurface::getDisplay void   ) 
 

Get the Display. (X11 only).

int Producer::RenderSurface::getDisplayNum void   )  const
 

Get the number of the display the render surface is to be created on. In XWindows, this is the number of the XServer. Ignored on Win32

GLContext Producer::RenderSurface::getGLContext void   )  const
 

Returns the OpenGL context

const std::string& Producer::RenderSurface::getHostName void   )  const
 

Get the name of the Host the window is to be created on. Ignored on Win32

const InputRectangle& Producer::RenderSurface::getInputRectangle  ) 
 

Window Producer::RenderSurface::getParentWindow void   )  const
 

Get the Windowing system's parent window

std::vector<int>& Producer::RenderSurface::getPBufferUserAttributes  ) 
 

Get the vector of user-defined PBuffer attributes. This vector will be used to initialize the PBuffer's attribute list.

const std::vector<int>& Producer::RenderSurface::getPBufferUserAttributes  )  const
 

Get the (const) vector of user-defined PBuffer attributes.

unsigned int Producer::RenderSurface::getRefreshRate  )  const
 

Where supported, getRefreshRate() will return the frequency in hz of the vertical retrace signal of the graphics display device. If getRefreshRate() returns 0, then the underlying support to get the graphics display device's vertical retrace signal is not present.

CubeMapFace Producer::RenderSurface::getRenderToTextureFace  )  const
 

Get which face on the target cube map texture will be affected by rendering.

int Producer::RenderSurface::getRenderToTextureMipMapLevel  )  const
 

Get which mipmap level on the target texture will be affected by rendering.

RenderToTextureMode Producer::RenderSurface::getRenderToTextureMode  )  const
 

Get the render-to-texture mode (PBuffer drawables only). This method has no effect if it is called after realize()

RenderToTextureOptions Producer::RenderSurface::getRenderToTextureOptions  )  const
 

Get the render-to-texture options (PBuffer drawables only). This method has no effect if it is called after realize().

RenderToTextureTarget Producer::RenderSurface::getRenderToTextureTarget  )  const
 

Get the render-to-texture target (PBuffer drawables only). This method has no effect if it is called after realize().

int Producer::RenderSurface::getScreenNum void   )  const
 

Get the number of the screen the render surface is to be created on. In XWindows, this is the number of the XServer. Ignored on Win32

void Producer::RenderSurface::getScreenSize unsigned int &  width,
unsigned int &  height
const
 

Get the size of the screen in pixels the render surface is to be created on.

bool Producer::RenderSurface::getUseDefaultEsc  )  [inline]
 

const VisualChooser* Producer::RenderSurface::getVisualChooser void   )  const
 

VisualChooser* Producer::RenderSurface::getVisualChooser void   ) 
 

const VisualInfo* Producer::RenderSurface::getVisualInfo void   )  const
 

VisualInfo* Producer::RenderSurface::getVisualInfo void   ) 
 

Window Producer::RenderSurface::getWindow void   )  const
 

Returns the Windowing system handle to the window

unsigned int Producer::RenderSurface::getWindowHeight  )  const
 

Get the height of the RenderSurface in windowing system screen coordinates

const std::string& Producer::RenderSurface::getWindowName void   )  const
 

Get the Window system Window name of the Render Surface

int Producer::RenderSurface::getWindowOriginX  )  const
 

Get the X coordinate of the origin of the RenderSurface's window

int Producer::RenderSurface::getWindowOriginY  )  const
 

Get the Y coordinate of the origin of the RenderSurface's window

void Producer::RenderSurface::getWindowRectangle int &  x,
int &  y,
unsigned int &  width,
unsigned int &  height
const
 

Get the windowing system rectangle the RenderSurface will occupy on the screen. The parameters are given as integers in screen space. x and y determine the lower left hand corner of the RenderSurface. Width and height are given in screen coordinates

unsigned int Producer::RenderSurface::getWindowWidth  )  const
 

Get the width of the RenderSurface in windowing system screen coordinates

static void Producer::RenderSurface::InitThreads  )  [static]
 

Where supported, InitThreads will initialize all graphics components for thread safety. InitThreads() should be called before any other calls to Xlib, or OpenGL are made, and should always be called when multi-threaded environments are intended.

bool Producer::RenderSurface::isFullScreen  )  const [inline]
 

isFullScreen() returns true if the RenderSurface's window fills the entire screen and has no border.

bool Producer::RenderSurface::isRealized void   )  const
 

Returns true if the RenderSurface has been realized, false if not.

bool Producer::RenderSurface::makeCurrent void   )  const
 

Makes the graphics context and RenderSurface current for rendering

void Producer::RenderSurface::mapWindow  ) 
 

map and unmap the window

void Producer::RenderSurface::positionPointer int  x,
int  y
 

positionPointer(x,y) places the pointer at window coordinates x, y.

bool Producer::RenderSurface::realize VisualChooser vc = NULL,
GLContext  shared_context = 0
 

Realize the RenderSurface. When realized, all components of the RenderSurface not already configured are configured, a window and a graphics context are created and made current. If an already existing graphics context is passed through "shared_context", then the graphics context created will share certain graphics constructs (such as display lists) with "shared_context".

virtual void Producer::RenderSurface::run  )  [protected, virtual]
 

void Producer::RenderSurface::setCustomFullScreenRectangle int  x,
int  y,
unsigned int  width,
unsigned int  height
 

setCustomFullScreenRencangle(x,y,width,height). Programmer may set a customized rectangle to be interpreted as "fullscreen" when fullscreen(true) is called. This allows configurations that have large virtual screens that span more than one monitor to define a "local" full screen for each monitor.

void Producer::RenderSurface::setDisplay Display *  dpy  ) 
 

Explicitely set the Display variable before realization. (X11 only).

void Producer::RenderSurface::setDisplayNum int   ) 
 

Set the number of the display the render surface is to be created on. In XWindows, this is the number of the XServer. Ignored on Win32

void Producer::RenderSurface::setDrawableType DrawableType   ) 
 

void Producer::RenderSurface::setHostName const std::string &   ) 
 

Set the name of the Host the window is to be created on. Ignored on Win32

void Producer::RenderSurface::setInputRectangle const InputRectangle ir  ) 
 

void Producer::RenderSurface::setParentWindow Window  parent  ) 
 

Set the Windowing system's parent window

void Producer::RenderSurface::setReadDrawable RenderSurface  ) 
 

void Producer::RenderSurface::setRealizeCallback Callback realizeCB  )  [inline]
 

void Producer::RenderSurface::setRenderToTextureFace CubeMapFace  face  ) 
 

Select which face on the target cube map texture will be affected by rendering. This method can be called after the PBuffer has been realized.

void Producer::RenderSurface::setRenderToTextureMipMapLevel int  level  ) 
 

Select which mipmap level on the target texture will be affected by rendering. This method can be called after the PBuffer has been realized.

void Producer::RenderSurface::setRenderToTextureMode RenderToTextureMode  mode  ) 
 

Set the render-to-texture mode (PBuffer drawables only). You can pass int values different from the constants defined by RenderToTextureMode, in which case they will be applied directly as parameters to the WGL_TEXTURE_FORMAT attribute. This method has no effect if it is called after realize().

void Producer::RenderSurface::setRenderToTextureOptions RenderToTextureOptions  options  ) 
 

Set the render-to-texture options (PBuffer drawables only). You can pass any combination of the constants defined in enum RenderToTextureOptions. This method has no effect if it is called after realize().

void Producer::RenderSurface::setRenderToTextureTarget RenderToTextureTarget  target  ) 
 

Set the render-to-texture target (PBuffer drawables only). You can pass int values different from the constants defined by RenderToTextureTarget, in which case they will be applied directly as parameters to the WGL_TEXTURE_TARGET attribute. This method has no effect if it is called after realize().

void Producer::RenderSurface::setScreenNum int   ) 
 

Set the number of the screen the render surface is to be created on. In XWindows, this is the number of the XServer. Ignored on Win32

void Producer::RenderSurface::setSimplePixelConfiguration  ) 
 

void Producer::RenderSurface::setUseDefaultEsc bool  flag  )  [inline]
 

set/getUseDefaultEsc is deprecated

void Producer::RenderSurface::setVisualChooser VisualChooser vc  ) 
 

void Producer::RenderSurface::setVisualInfo VisualInfo *  vi  ) 
 

void Producer::RenderSurface::setWindow const Window  win  ) 
 

Explicitely set the Windowing system window before realization.

void Producer::RenderSurface::setWindowName const std::string &   ) 
 

Set the Window system Window name of the Render Surface

void Producer::RenderSurface::setWindowRectangle int  x,
int  y,
unsigned int  width,
unsigned int  height,
bool  resize = true
 

Set the windowing system rectangle the RenderSurface will occupy on the screen. The parameters are given as integers in screen space. x and y determine the lower left hand corner of the RenderSurface. Width and height are given in screen coordinates

virtual void Producer::RenderSurface::swapBuffers void   )  [virtual]
 

Swaps buffers if RenderSurface quality attribute is DoubleBuffered

virtual void Producer::RenderSurface::sync int  divisor = 1  )  [virtual]
 

Where supported, sync() will synchronize with the vertical retrace signal of the graphics display device. divisor specifies the number of vertical retace signals to allow before returning.

void Producer::RenderSurface::unmapWindow  ) 
 

void Producer::RenderSurface::useBorder bool  flag  ) 
 

Request the use of a window border. If flag is false, no border will appear after realization. If flag is true, the windowing system window will be created in default state.

void Producer::RenderSurface::useConfigEventThread bool  flag  ) 
 

Specify whether the RenderSurface should use a separate thread for window configuration events. If flag is set to true, then the RenderSurface will spawn a new thread to manage events caused by resizing the window, mapping or destroying the window.

void Producer::RenderSurface::useCursor bool  flag  ) 
 

Request whether the window should have a visible cursor. If true, the windowing system's default cursur will be assigned to the window. If false the window will not have a visible cursor.

void Producer::RenderSurface::useDefaultFullScreenRectangle  ) 
 

useDefaultFullScreenRetangle(). Sets the application back to using the default screen size as fullscreen rather than the custom full screen rectangle

bool Producer::RenderSurface::usesBorder  ) 
 

bool Producer::RenderSurface::waitForRealize  ) 
 

Where supported, InitThreads will initialize all graphics components for thread Puts the calling thread to sleep until the RenderSurface is realized. Returns true if for success and false for failure.


Member Data Documentation

bool Producer::RenderSurface::_bindInputRectangleToWindowSize [protected]
 

bool Producer::RenderSurface::_checkOwnEvents [protected]
 

unsigned int Producer::RenderSurface::_customFullScreenHeight [protected]
 

int Producer::RenderSurface::_customFullScreenOriginX [protected]
 

int Producer::RenderSurface::_customFullScreenOriginY [protected]
 

unsigned int Producer::RenderSurface::_customFullScreenWidth [protected]
 

bool Producer::RenderSurface::_decorations [protected]
 

int Producer::RenderSurface::_displayNum [protected]
 

Display* Producer::RenderSurface::_dpy [protected]
 

DrawableType Producer::RenderSurface::_drawableType [protected]
 

unsigned int Producer::RenderSurface::_frameCount [protected]
 

GLContext Producer::RenderSurface::_glcontext [protected]
 

std::string Producer::RenderSurface::_hostname [protected]
 

InputRectangle Producer::RenderSurface::_inputRectangle [protected]
 

bool Producer::RenderSurface::_isFullScreen [protected]
 

bool Producer::RenderSurface::_mayFullScreen [protected]
 

Cursor Producer::RenderSurface::_nullCursor [protected]
 

Window Producer::RenderSurface::_parent [protected]
 

unsigned int Producer::RenderSurface::_parentWindowHeight [protected]
 

std::vector<PixelAttribute> Producer::RenderSurface::_pixelAttributes [protected]
 

RenderSurface* Producer::RenderSurface::_readDrawableRenderSurface [protected]
 

ref_ptr< Producer::Block > Producer::RenderSurface::_realizeBlock [protected]
 

std::vector<Producer::ref_ptr<Callback> > Producer::RenderSurface::_realizeCallbacks [protected]
 

bool Producer::RenderSurface::_realized [protected]
 

bool Producer::RenderSurface::_rtt_dirty_face [protected]
 

bool Producer::RenderSurface::_rtt_dirty_mipmap [protected]
 

CubeMapFace Producer::RenderSurface::_rtt_face [protected]
 

int Producer::RenderSurface::_rtt_mipmap [protected]
 

RenderToTextureMode Producer::RenderSurface::_rtt_mode [protected]
 

RenderToTextureOptions Producer::RenderSurface::_rtt_options [protected]
 

RenderToTextureTarget Producer::RenderSurface::_rtt_target [protected]
 

int Producer::RenderSurface::_screen [protected]
 

unsigned int Producer::RenderSurface::_screenHeight [protected]
 

unsigned int Producer::RenderSurface::_screenWidth [protected]
 

GLContext Producer::RenderSurface::_sharedGlcontext [protected]
 

OpenThreads::Barrier* Producer::RenderSurface::_threadReady [protected]
 

bool Producer::RenderSurface::_useConfigEventThread [protected]
 

bool Producer::RenderSurface::_useCursor [protected]
 

bool Producer::RenderSurface::_useCustomFullScreen [protected]
 

bool Producer::RenderSurface::_useDefaultEsc [protected]
 

std::vector<int> Producer::RenderSurface::_user_pbattr [protected]
 

ref_ptr< VisualChooser > Producer::RenderSurface::_visualChooser [protected]
 

VisualInfo* Producer::RenderSurface::_visualInfo [protected]
 

Window Producer::RenderSurface::_win [protected]
 

float Producer::RenderSurface::_windowBottom [protected]
 

unsigned int Producer::RenderSurface::_windowHeight [protected]
 

float Producer::RenderSurface::_windowLeft [protected]
 

std::string Producer::RenderSurface::_windowName [protected]
 

float Producer::RenderSurface::_windowRight [protected]
 

float Producer::RenderSurface::_windowTop [protected]
 

unsigned int Producer::RenderSurface::_windowWidth [protected]
 

int Producer::RenderSurface::_windowX [protected]
 

int Producer::RenderSurface::_windowY [protected]
 

const std::string Producer::RenderSurface::defaultWindowName [static]
 

Default window name

const unsigned int Producer::RenderSurface::UnknownDimension [static]
 


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 11:10:07 2005 for producer by  doxygen 1.4.4