Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::NSGLRenderer Class Reference

A MacOS X (NSGL) OpenGL Renderer. More...

#include <mitsuba/hw/nsglrenderer.h>

+ Inheritance diagram for mitsuba::NSGLRenderer:

Public Member Functions

 NSGLRenderer (NSGLSession *session)
 Create a new renderer. More...
 
void init (Device *device, Renderer *other=NULL)
 Initialize the renderer. More...
 
void shutdown ()
 Shut the renderer down. More...
 
void * getContext ()
 Return the rendering context. More...
 
virtual const ClassgetClass () const
 Retrieve this object's class. More...
 
- Public Member Functions inherited from mitsuba::GLRenderer
 GLRenderer (Session *session)
 Construct a new OpenGL rendering interface. More...
 
void reconfigure (const Device *device)
 Reconfigure the renderer for a certain device (e.g. after a resize event) More...
 
GPUTexturecreateGPUTexture (const std::string &name, Bitmap *bitmap=NULL)
 Create a new GPU texture object. More...
 
GPUGeometrycreateGPUGeometry (const Shape *shape)
 Create a new GPU geometry object. More...
 
GPUProgramcreateGPUProgram (const std::string &name)
 Create a new GPU program object. More...
 
GPUSynccreateGPUSync ()
 Create a new synchronization object. More...
 
void clear ()
 Clear the viewport. More...
 
void setCamera (const ProjectiveCamera *pCamera, const Point2 &apertureSample=Point2(0.5f), const Point2 &aaSample=Point2(0.5f), Float timeSample=0.5f)
 Configure the camera. More...
 
void setCamera (const Matrix4x4 &proj, const Matrix4x4 &view)
 Configure the camera (manual) More...
 
void setMatrix (EMatrixType type, const Matrix4x4 &value)
 Directly set the modelview or projection matrix. More...
 
Matrix4x4 getMatrix (EMatrixType type) const
 Fetch the currently set modelview or projection matrix. More...
 
void beginDrawingMeshes (bool transmitOnlyPositions=false)
 Set up the renderer for drawing triangle geometry. More...
 
void drawMesh (const TriMesh *geo)
 Send a triangle mesh to the renderer. More...
 
void drawMesh (const GPUGeometry *geo)
 Send a triangle mesh to the renderer. More...
 
void endDrawingMeshes ()
 Clean up the renderer after drawing triangle geometry. More...
 
void drawAll (const std::vector< TransformedGPUGeometry > &allGeometry)
 Quickly draw all geometry that has been registered with the renderer. More...
 
void blitTexture (const GPUTexture *texture, bool flipVertically=false, bool centerHoriz=true, bool centerVert=true, const Vector2i &offset=Vector2i(0, 0))
 Draw a quad using the given texture. More...
 
void blitQuad (bool flipVertically)
 Blit a screen-sized quad. More...
 
void drawText (const Point2i &pos, const Font *font, const std::string &text)
 
void setPointSize (Float size)
 Set the size of point primitives. More...
 
void drawPoint (const Point &p)
 Draw a point. More...
 
void drawLine (const Point &a, const Point &b)
 Draw a line between two specified points. More...
 
void drawPoint (const Point2 &p)
 Draw a point (2D) More...
 
void drawPoint (const Point2i &p)
 Draw a point (2D, integer coordinates) More...
 
void drawLine (const Point2 &a, const Point2 &b)
 Draw a line between two specified points (2D) More...
 
void drawLine (const Point2i &a, const Point2i &b)
 Draw a line between two specified points (2D, integer coordinates) More...
 
void drawRectangle (const Point2 &a, const Point2 &b)
 Draw a rectangle between two specified points (2D) More...
 
void drawRectangle (const Point2i &a, const Point2i &b)
 Draw a rectangle between two specified points (2D, integer coordinates) More...
 
void drawFilledRectangle (const Point2 &a, const Point2 &b)
 Draw a filled rectangle between two specified points (2D) More...
 
void drawFilledRectangle (const Point2i &a, const Point2i &b)
 Draw a filled rectangle between two specified points (2D, integer coordinates) More...
 
void drawEllipse (const Point &center, const Vector &axis1, const Vector &axis2)
 Draw an ellipse with the specified center and axes. More...
 
void drawAABB (const AABB &aabb)
 Draw a wire-frame axis-aligned box. More...
 
void setBlendMode (EBlendMode mode)
 Set the currently active blending mode. More...
 
void setCullMode (ECullMode mode)
 Set the currently active culling mode. More...
 
void setDepthMask (bool value)
 Activate or deactivate the writing of depth information. More...
 
void setDepthTest (bool value)
 Activate or deactivate depth testing. More...
 
void setColor (const Color3 &color, Float alpha=1.0f)
 Set the current fixed-function pipeline color. More...
 
void setColor (const Spectrum &spec, Float alpha=1.0f)
 Set the current fixed-function pipeline color. More...
 
void setClearDepth (Float depth)
 Set the depth value that is written by clear() More...
 
void setClearColor (const Color3 &color)
 Set the color value that is written by clear() More...
 
void clearTransforms ()
 Clear the view and projection transformations. More...
 
void flush ()
 Flush outstanding rendering commands. More...
 
void finish ()
 Completely finish outstanding rendering commands. More...
 
void checkError (bool onlyWarn=true)
 Check for any error indications. More...
 
void debugString (const std::string &text)
 Send a debug string to the rendering backend. More...
 
- Public Member Functions inherited from mitsuba::Renderer
const RendererCapabilitiesgetCapabilities () const
 Return the renderer's capabilities. More...
 
ShaderregisterShaderForResource (const HWResource *res)
 
ShadergetShaderForResource (const HWResource *res)
 Look up a shader by the associated HWResource object. More...
 
void unregisterShaderForResource (const HWResource *res)
 Decrease the reference count of a shader. Deletes it when zero is reached. More...
 
GPUGeometryregisterGeometry (const Shape *shape)
 
bool unregisterGeometry (const Shape *shape)
 Unregister a triangle mesh from the renderer. More...
 
void setLogLevel (ELogLevel logLevel)
 Set the log level. More...
 
void setWarnLogLevel (ELogLevel logLevel)
 Set the log level for warnings. More...
 
- Public Member Functions inherited from Object
 Object ()
 Construct a new object. More...
 
int getRefCount () const
 Return the current reference count. More...
 
void incRef () const
 Increase the reference count of the object by one. More...
 
void decRef (bool autoDeallocate=true) const
 Decrease the reference count of the object and possibly deallocate it. More...
 
virtual std::string toString () const
 Return a human-readable string representation of the object's contents. More...
 

Static Public Attributes

static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::GLRenderer
static Classm_theClass
 
- Static Public Attributes inherited from mitsuba::Renderer
static Classm_theClass
 
- Static Public Attributes inherited from Object
static Classm_theClass
 Pointer to the object's class descriptor. More...
 

Protected Member Functions

virtual ~NSGLRenderer ()
 Virtual destructor. More...
 
void * lookupExtension (const std::string &name) const
 Lookup an OpenGL extension. More...
 
- Protected Member Functions inherited from mitsuba::GLRenderer
virtual ~GLRenderer ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from mitsuba::Renderer
 Renderer (Session *session)
 Construct a new OpenI rendering interface. More...
 
virtual ~Renderer ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from Object
virtual ~Object ()
 Virtual private deconstructor. (Will only be called by ref) More...
 

Additional Inherited Members

- Public Types inherited from mitsuba::Renderer
enum  EBlendMode { EBlendNone = 0, EBlendAlpha, EBlendAdditive }
 
enum  ECullMode { ECullNone = 0, ECullFront, ECullBack }
 Possible culling modes. More...
 
enum  EMatrixType { EProjection = 0, EModelView }
 Matrices of the fixed function pipeline. More...
 
typedef std::pair< const
GPUGeometry *, Matrix4x4
TransformedGPUGeometry
 
- Static Public Member Functions inherited from mitsuba::Renderer
static Renderercreate (Session *session)
 
- Static Public Member Functions inherited from Object
static void staticInitialization ()
 Initializes the built-in reference count debugger (if enabled) More...
 
static void staticShutdown ()
 Free the memory taken by staticInitialization() More...
 
- Protected Attributes inherited from mitsuba::GLRenderer
bool m_transmitOnlyPositions
 
bool m_normalsEnabled
 
bool m_texcoordsEnabled
 
bool m_tangentsEnabled
 
bool m_colorsEnabled
 
size_t m_queuedTriangles
 
int m_stride
 
- Protected Attributes inherited from mitsuba::Renderer
ref< Sessionm_session
 
ref< Devicem_device
 
ref< RendererCapabilitiesm_capabilities
 
std::map< const HWResource
*, ShaderRecord
m_shaders
 
std::map< const Shape
*, GPUGeometry * > 
m_geometry
 
bool m_initialized
 
bool m_borrowed
 
std::string m_driverVendor
 
std::string m_driverRenderer
 
std::string m_driverVersion
 
ELogLevel m_logLevel
 
ELogLevel m_warnLogLevel
 

Detailed Description

A MacOS X (NSGL) OpenGL Renderer.

Constructor & Destructor Documentation

mitsuba::NSGLRenderer::NSGLRenderer ( NSGLSession session)

Create a new renderer.

virtual mitsuba::NSGLRenderer::~NSGLRenderer ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual const Class* mitsuba::NSGLRenderer::getClass ( ) const
virtual

Retrieve this object's class.

Reimplemented from mitsuba::GLRenderer.

void* mitsuba::NSGLRenderer::getContext ( )
inline

Return the rendering context.

void mitsuba::NSGLRenderer::init ( Device device,
Renderer other = NULL 
)
virtual

Initialize the renderer.

Reimplemented from mitsuba::GLRenderer.

void* mitsuba::NSGLRenderer::lookupExtension ( const std::string &  name) const
protected

Lookup an OpenGL extension.

void mitsuba::NSGLRenderer::shutdown ( )
virtual

Shut the renderer down.

Reimplemented from mitsuba::GLRenderer.

Member Data Documentation

Class* mitsuba::NSGLRenderer::m_theClass
static

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