Eidolon
Public Member Functions | Private Attributes | List of all members
RenderScene Class Reference

#include <RenderTypes.h>

Inheritance diagram for RenderScene:
Inheritance graph
Collaboration diagram for RenderScene:
Collaboration graph

Public Member Functions

 RenderScene ()
 
virtual ~RenderScene ()
 
virtual CameracreateCamera (const char *name, real left=0.0f, real top=0.0f, real width=1.0f, real height=1.0f) throw (RenderException)
 
virtual void setAmbientLight (const color &c)
 Set the scene ambient light to the given color value. More...
 
virtual void addResourceDir (const char *dir)
 Add a directory to search for resources in. More...
 
virtual void initializeResources ()
 Onces all resource directories are added, initialize the internal resource system. More...
 
virtual MaterialcreateMaterial (const char *name) throw (RenderException)
 Create a material object of the given name. More...
 
virtual FigurecreateFigure (const char *name, const char *mat, FigureType type) throw (RenderException)
 Create a figure of the given name, with material named by `mat', and type `type'. More...
 
virtual LightcreateLight () throw (RenderException)
 Create a light object. More...
 
virtual ImageloadImageFile (const std::string &filename) throw (RenderException)
 Load an image from the given filename. More...
 
virtual TexturecreateTexture (const char *name, sval width, sval height, sval depth, TextureFormat format) throw (RenderException)
 Create a 3D texture with the given name, dimensions, and format. Textures are always 3D but a `depth' value of 1 produces the equivalent of a 2D texture. More...
 
virtual TextureloadTextureFile (const char *name, const char *absFilename) throw (RenderException)
 Load a texture of the given name from the image absolute path filename. More...
 
virtual GPUProgramcreateGPUProgram (const char *name, ProgramType ptype, const char *language) throw (RenderException)
 Load a GPU program (shader) of the given name, type, and language (ie. Cg). More...
 
virtual void saveScreenshot (const char *filename, Camera *c=NULL, int width=0, int height=0, real stereoOffset=0.0, TextureFormat tf=TF_RGB24) throw (RenderException)
 Save a screenshot to the given filename taken from the given camera, or of the whole 3D window if this isn't provided. More...
 
virtual ConfiggetConfig () const
 Returns the Config object used to define properties for the scene. More...
 
virtual void logMessage (const char *msg)
 Log a message to the renderer log file. More...
 
virtual void setBGObject (color col, bool enabled)
 Set the background skybox to the given color if `enabled' is true, otherwise disable it. More...
 
void setRenderHighQuality (bool val)
 Set whether rendering should be done using high quality passes or not. More...
 
void setAlwaysHighQuality (bool val)
 Set whether to force high quality rendering. More...
 
bool getRenderHighQuality () const
 Returns whether the next render operation will be in high quality mode. More...
 
bool getAlwaysHighQuality () const
 Returns whether to always render in high quality mode. More...
 

Private Attributes

bool renderHighQuality
 
bool alwaysHighQuality
 

Detailed Description

This class represents the rendering scene and the factory for all render-related objects including cameras, lights, figures, and materials. It also is responsible for loading textures and other properties (more to be added later). Only one instance should ever exist which is created by the RenderAdapter instance. None of the methods of this type should be considered thread-safe.

Constructor & Destructor Documentation

◆ RenderScene()

RenderScene ( )
inline

◆ ~RenderScene()

virtual ~RenderScene ( )
inlinevirtual

Member Function Documentation

◆ addResourceDir()

virtual void addResourceDir ( const char *  dir)
inlinevirtual

Add a directory to search for resources in.

Reimplemented in OgreRenderScene.

◆ createCamera()

virtual Camera* createCamera ( const char *  name,
real  left = 0.0f,
real  top = 0.0f,
real  width = 1.0f,
real  height = 1.0f 
)
throw (RenderException
)
inlinevirtual

Create a camera object with the given name covering the proportionate area of the 3D window. The top left corner of the 3D window is (0.0,0.0) and its dimensions are (1.0,1.0), which are the default values of the left, top, width, and height arguments.

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ createFigure()

virtual Figure* createFigure ( const char *  name,
const char *  mat,
FigureType  type 
)
throw (RenderException
)
inlinevirtual

Create a figure of the given name, with material named by `mat', and type `type'.

Reimplemented in OgreRenderScene.

◆ createGPUProgram()

virtual GPUProgram* createGPUProgram ( const char *  name,
ProgramType  ptype,
const char *  language 
)
throw (RenderException
)
inlinevirtual

Load a GPU program (shader) of the given name, type, and language (ie. Cg).

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ createLight()

virtual Light* createLight ( )
throw (RenderException
)
inlinevirtual

Create a light object.

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ createMaterial()

virtual Material* createMaterial ( const char *  name)
throw (RenderException
)
inlinevirtual

Create a material object of the given name.

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ createTexture()

virtual Texture* createTexture ( const char *  name,
sval  width,
sval  height,
sval  depth,
TextureFormat  format 
)
throw (RenderException
)
inlinevirtual

Create a 3D texture with the given name, dimensions, and format. Textures are always 3D but a `depth' value of 1 produces the equivalent of a 2D texture.

Reimplemented in OgreRenderScene.

◆ getAlwaysHighQuality()

bool getAlwaysHighQuality ( ) const
inline

Returns whether to always render in high quality mode.

◆ getConfig()

virtual Config* getConfig ( ) const
inlinevirtual

Returns the Config object used to define properties for the scene.

Reimplemented in OgreRenderScene.

◆ getRenderHighQuality()

bool getRenderHighQuality ( ) const
inline

Returns whether the next render operation will be in high quality mode.

◆ initializeResources()

virtual void initializeResources ( )
inlinevirtual

Onces all resource directories are added, initialize the internal resource system.

Reimplemented in OgreRenderScene.

◆ loadImageFile()

virtual Image* loadImageFile ( const std::string &  filename)
throw (RenderException
)
inlinevirtual

Load an image from the given filename.

Reimplemented in OgreRenderScene.

◆ loadTextureFile()

virtual Texture* loadTextureFile ( const char *  name,
const char *  absFilename 
)
throw (RenderException
)
inlinevirtual

Load a texture of the given name from the image absolute path filename.

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ logMessage()

virtual void logMessage ( const char *  msg)
inlinevirtual

Log a message to the renderer log file.

Reimplemented in OgreRenderScene.

◆ saveScreenshot()

virtual void saveScreenshot ( const char *  filename,
Camera c = NULL,
int  width = 0,
int  height = 0,
real  stereoOffset = 0.0,
TextureFormat  tf = TF_RGB24 
)
throw (RenderException
)
inlinevirtual

Save a screenshot to the given filename taken from the given camera, or of the whole 3D window if this isn't provided.

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ setAlwaysHighQuality()

void setAlwaysHighQuality ( bool  val)
inline

Set whether to force high quality rendering.

◆ setAmbientLight()

virtual void setAmbientLight ( const color c)
inlinevirtual

Set the scene ambient light to the given color value.

Reimplemented in OgreRenderScene.

Here is the caller graph for this function:

◆ setBGObject()

virtual void setBGObject ( color  col,
bool  enabled 
)
inlinevirtual

Set the background skybox to the given color if `enabled' is true, otherwise disable it.

Reimplemented in OgreRenderScene.

◆ setRenderHighQuality()

void setRenderHighQuality ( bool  val)
inline

Set whether rendering should be done using high quality passes or not.

Here is the caller graph for this function:

Member Data Documentation

◆ alwaysHighQuality

bool alwaysHighQuality
private

◆ renderHighQuality

bool renderHighQuality
private

The documentation for this class was generated from the following file: