An abstract drawing device. More...
#include <mitsuba/hw/device.h>
Public Member Functions | |
Vector2i | getSize () const |
Return the dimension of the device. More... | |
void | setSize (const Vector2i &dimension) |
Set the dimension of the device. More... | |
Float | getAspect () const |
Return the aspect ratio of the device. More... | |
Point2i | getPosition () const |
Return the position of the device. More... | |
virtual void | setPosition (const Point2i &position) |
Set the position of the device. More... | |
void | setFSAA (int fsaa) |
Set the FSAA sample count, do this before Init() More... | |
int | getFSAA () const |
Return the FSAA sample count. More... | |
virtual void | setVisible (bool visible)=0 |
Only applies to devices, which are UI windows. More... | |
void | setColorBits (int colorBits) |
A convenience method. More... | |
void | setRedBits (int redBits) |
Set the amount of bits for the red component. More... | |
int | getRedBits () const |
Return the amount of bits for the red component. More... | |
void | setGreenBits (int greenBits) |
Set the amount of bits for the green component. More... | |
int | getGreenBits () const |
Return the amount of bits for the green component. More... | |
void | setBlueBits (int blueBits) |
Set the amount of bits for the blue component. More... | |
int | getBlueBits () const |
Return the amount of bits for the blue component. More... | |
void | setAlphaBits (int alphaBits) |
Set the amount of bits for the alpha component. More... | |
int | getAlphaBits () const |
Return the amount of bits for the alpha component. More... | |
void | setDepthBits (int depthBits) |
Set the amount of bits for the depth component. More... | |
int | getDepthBits () const |
Return the amount of bits for the depth component. More... | |
void | setStencilBits (int stencilBits) |
Set the amount of bits for the stencil component. More... | |
int | getStencilBits () const |
Return the amount of bits for the stencil component. More... | |
void | setDoubleBuffer (bool doubleBuffer) |
Define whether to enable double buffering. More... | |
bool | getDoubleBuffer () const |
void | setFullscreen (bool fullscreen) |
bool | getFullscreen () const |
Return whether full screen drawing is enabled. More... | |
void | setResizeAllowed (bool resizeAllowed) |
bool | isResizeAllowed () const |
Return whether it is possible to resize the window. More... | |
void | setCenter (bool center) |
Define whether to enable window centering. More... | |
bool | getCenter () const |
Return whether window centering is enabled. More... | |
void | setShowFPS (bool showFPS) |
Define whether to show the frames per second. More... | |
bool | getShowFPS () const |
Return whether to show the frames per second. More... | |
int | getFPS () const |
Return the frames per second (0 if no data is available) More... | |
void | setXPos (int xpos) |
Set the x window position. More... | |
virtual void | setTitle (const std::string &title) |
Set the window title. More... | |
const std::string & | getTitle () const |
Return the window title. More... | |
const Session * | getSession () const |
Get the session. More... | |
Session * | getSession () |
Get the session. More... | |
virtual void | init (Device *other=NULL) |
virtual void | shutdown () |
Shut the device down. More... | |
void | addCallback (DeviceEventListener *callback) |
Add an event callback to the device. More... | |
void | removeCallback (DeviceEventListener *callback) |
Remove an event callback from the device. More... | |
virtual void | makeCurrent (Renderer *renderer)=0 |
Associate the renderer with this device. More... | |
virtual void | flip () |
Flip the buffers (when using double buffering) More... | |
virtual const Class * | getClass () const |
Retrieve this object's class. 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 Member Functions | |
static Device * | create (Session *session) |
Construct a new device using the appropriate implementation. More... | |
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... | |
Static Public Attributes | |
static Class * | m_theClass |
Static Public Attributes inherited from Object | |
static Class * | m_theClass |
Pointer to the object's class descriptor. More... | |
Protected Member Functions | |
virtual | ~Device () |
Virtual destructor. More... | |
Device (Session *session) | |
Create a new device. More... | |
void | fireDeviceEvent (const DeviceEvent &event) |
Send a device event using the registered callbacks. More... | |
Protected Member Functions inherited from Object | |
virtual | ~Object () |
Virtual private deconstructor. (Will only be called by ref) More... | |
Protected Attributes | |
ref< Session > | m_session |
ref< Timer > | m_timer |
Vector2i | m_size |
Point2i | m_position |
int | m_fsaa |
int | m_redBits |
int | m_greenBits |
int | m_blueBits |
int | m_alphaBits |
int | m_depthBits |
int | m_stencilBits |
bool | m_doubleBuffer |
bool | m_initialized |
bool | m_fullscreen |
bool | m_center |
bool | m_showFPS |
bool | m_resizeAllowed |
int | m_fpsCounter |
int | m_fps |
int | m_lastTime |
std::string | m_title |
std::list< DeviceEventListener * > | m_callbacks |
An abstract drawing device.
Device event types.
Device keyboard event modifiers.
Enumerator | |
---|---|
EShiftModifier | |
EControlModifier | |
EAltModifier | |
EMetaModifier |
Device keyboard event modifiers.
Enumerator | |
---|---|
ENoButton | |
ELeftButton | |
EMiddleButton | |
ERightButton | |
EWheelUpButton | |
EWheelDownButton |
Device special keys.
|
protectedvirtual |
Virtual destructor.
|
protected |
Create a new device.
void mitsuba::Device::addCallback | ( | DeviceEventListener * | callback | ) |
Add an event callback to the device.
Construct a new device using the appropriate implementation.
|
protected |
Send a device event using the registered callbacks.
|
virtual |
Flip the buffers (when using double buffering)
Reimplemented in mitsuba::NSGLDevice, mitsuba::X11Device, mitsuba::WGLDevice, and mitsuba::GLXDevice.
|
inline |
Return the amount of bits for the alpha component.
|
inline |
Return the aspect ratio of the device.
|
inline |
Return the amount of bits for the blue component.
|
inline |
Return whether window centering is enabled.
|
virtual |
Retrieve this object's class.
Reimplemented from Object.
Reimplemented in mitsuba::NSGLDevice, mitsuba::WGLDevice, mitsuba::X11Device, and mitsuba::GLXDevice.
|
inline |
Return the amount of bits for the depth component.
|
inline |
|
inline |
Return the frames per second (0 if no data is available)
|
inline |
Return the FSAA sample count.
|
inline |
Return whether full screen drawing is enabled.
|
inline |
Return the amount of bits for the green component.
|
inline |
Return the position of the device.
|
inline |
Return the amount of bits for the red component.
|
inline |
Get the session.
|
inline |
Get the session.
|
inline |
Return whether to show the frames per second.
|
inline |
Return the dimension of the device.
|
inline |
Return the amount of bits for the stencil component.
|
inline |
Return the window title.
|
virtual |
Initialize the renderer. Optionally, an existing device instance can be provided as a second argument – this is primarily meant to create a device that will be able to support a shared context with another device.
Reimplemented in mitsuba::NSGLDevice, mitsuba::X11Device, and mitsuba::WGLDevice.
|
inline |
Return whether it is possible to resize the window.
|
pure virtual |
Associate the renderer with this device.
Implemented in mitsuba::NSGLDevice, mitsuba::X11Device, and mitsuba::WGLDevice.
void mitsuba::Device::removeCallback | ( | DeviceEventListener * | callback | ) |
Remove an event callback from the device.
void mitsuba::Device::setAlphaBits | ( | int | alphaBits | ) |
Set the amount of bits for the alpha component.
void mitsuba::Device::setBlueBits | ( | int | blueBits | ) |
Set the amount of bits for the blue component.
void mitsuba::Device::setCenter | ( | bool | center | ) |
Define whether to enable window centering.
void mitsuba::Device::setColorBits | ( | int | colorBits | ) |
A convenience method.
Sets the amount of bits for the red, green and blue components
void mitsuba::Device::setDepthBits | ( | int | depthBits | ) |
Set the amount of bits for the depth component.
void mitsuba::Device::setDoubleBuffer | ( | bool | doubleBuffer | ) |
Define whether to enable double buffering.
void mitsuba::Device::setFSAA | ( | int | fsaa | ) |
Set the FSAA sample count, do this before Init()
void mitsuba::Device::setFullscreen | ( | bool | fullscreen | ) |
void mitsuba::Device::setGreenBits | ( | int | greenBits | ) |
Set the amount of bits for the green component.
|
virtual |
Set the position of the device.
Reimplemented in mitsuba::NSGLDevice, mitsuba::X11Device, and mitsuba::WGLDevice.
void mitsuba::Device::setRedBits | ( | int | redBits | ) |
Set the amount of bits for the red component.
void mitsuba::Device::setResizeAllowed | ( | bool | resizeAllowed | ) |
|
inline |
Define whether to show the frames per second.
void mitsuba::Device::setSize | ( | const Vector2i & | dimension | ) |
Set the dimension of the device.
void mitsuba::Device::setStencilBits | ( | int | stencilBits | ) |
Set the amount of bits for the stencil component.
|
virtual |
Set the window title.
Reimplemented in mitsuba::NSGLDevice, mitsuba::X11Device, and mitsuba::WGLDevice.
|
pure virtual |
Only applies to devices, which are UI windows.
Implemented in mitsuba::NSGLDevice, mitsuba::X11Device, and mitsuba::WGLDevice.
void mitsuba::Device::setXPos | ( | int | xpos | ) |
Set the x window position.
|
virtual |
Shut the device down.
Reimplemented in mitsuba::NSGLDevice, mitsuba::X11Device, and mitsuba::WGLDevice.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |