|
virtual unsigned int | ThreadID ()=0 |
| Returns the thread id of the virtual device. More...
|
|
virtual bool | IsValid () const =0 |
| Gets the status of the device. More...
|
|
virtual bool | BeginFrame ()=0 |
| Begins a frame draw. More...
|
|
virtual bool | EndFrame ()=0 |
| Ends a frame draw. More...
|
|
virtual bool | BeginScene ()=0 |
| Begins a scene draw. More...
|
|
virtual bool | EndScene ()=0 |
| Ends a scene draw. More...
|
|
virtual const RasterizerState & | GetRasterizerState ()=0 |
| Gets the current rasterizer state. More...
|
|
virtual void | SetRasterizerState (const RasterizerState &newState)=0 |
| Sets the current rasterizer state. More...
|
|
virtual const DepthStencilState & | GetDepthStencilState ()=0 |
| Gets the current depth-stencil state. More...
|
|
virtual void | SetDepthStencilState (const DepthStencilState &newState)=0 |
| Sets the current depth stencil state. More...
|
|
virtual const BlendState & | GetBlendState ()=0 |
| Gets the current blend state. More...
|
|
virtual void | SetBlendState (const BlendState &newState)=0 |
| Sets the current depth stencil state. More...
|
|
virtual const Box2 | Viewport ()=0 |
| Gets the pixel coordinate viewport for the drawing. More...
|
|
virtual void | Viewport (const Box2 *vp)=0 |
| Sets the pixel coordinate viewport for the drawing. More...
|
|
virtual const Point2 | DepthRange () const =0 |
| Gets the depth range. More...
|
|
virtual void | DepthRange (const Point2 &depthRange)=0 |
| Sets the depth range. More...
|
|
virtual const Box2 | ScissorBox ()=0 |
| Gets scissor box in pixels. More...
|
|
virtual void | ScissorBox (const Box2 *box)=0 |
| Sets the scissor box in pixels. More...
|
|
virtual size_t | VertexStreamCount () const =0 |
| Gets the number of vertex buffer streams. More...
|
|
virtual VertexBufferHandle | GetVertexStream (int nStream) const =0 |
| Gets the specified vertex buffer stream. More...
|
|
virtual void | SetVertexStreams (VertexBufferHandleArray &bufferArray, int *offsetArray=nullptr)=0 |
| Sets vertex buffer streams. More...
|
|
virtual void | SetStreamFormat (const MaxSDK::Graphics::MaterialRequiredStreams &format)=0 |
|
virtual int | OutputStreamCount () const =0 |
| Gets the number of current output vertex buffer streams. More...
|
|
virtual SmartHandle | GetOutputStream (int nStream) const =0 |
| Gets the specified output vertex buffer stream. More...
|
|
virtual void | SetOutputStreams (SmartHandleArray &bufferArray, int *offsetArray=nullptr)=0 |
| Sets the current output vertex buffer stream. More...
|
|
virtual void | SetTarget (TargetHandle &target, TargetHandle &zBuffer)=0 |
| Sets the render target at index 0. More...
|
|
virtual void | SetTargets (TargetHandleArray &targetArray, TargetHandle &zBuffer)=0 |
| Sets multiple render targets. More...
|
|
virtual TargetHandle | GetTarget (int index)=0 |
| Gets the specified render target. More...
|
|
virtual size_t | TargetCount ()=0 |
| Gets the current render target count. More...
|
|
virtual TargetHandle | GetZBuffer ()=0 |
| Gets the current z buffer. More...
|
|
virtual IndexBufferHandle | GetIndexBuffer () const =0 |
| Gets the current index buffer. More...
|
|
virtual void | SetIndexBuffer (IndexBufferHandle &indexBuffer)=0 |
| Sets the current index buffer. More...
|
|
virtual void | Draw (PrimitiveType type, int start, int primCount)=0 |
| Draws part of a set of primitives. More...
|
|
virtual void | DrawInstanced (PrimitiveType type, int instanceCount, int start, int primCount)=0 |
| Draws part of a set of primitives with an instance. More...
|
|
virtual void | Clear (BufferClearFlag flags, const AColor &color, float z, int stencil)=0 |
| Performs a full clear: target( nTargets ) to a given color, z to a given z, stencil to a given stencil. More...
|
|
virtual void | ClearRegion (const Box2 &rect, BufferClearFlag flags, const AColor &color, float z, int stencil)=0 |
| Performs a partial clear: a sub-region of the target/z/stencil is cleared. More...
|
|
virtual bool | SetTargetsAndUnorderedAccessViews (TargetHandleArray targets, TargetHandle &zBuffer, VertexBufferHandleArray uavs, unsigned int *initialUAVCounts)=0 |
| Set Render Targets and Unordered Access View targets. More...
|
|
virtual void | ClearUnorderedAccessView (VertexBufferHandle buffer, const unsigned int vals[4])=0 |
| Clear a Unordered Access View target with initial value. More...
|
|
|
static UtilExport void * | operator new (size_t size) |
| Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
| Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
| New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
| New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
| New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new (size_t size, unsigned long flags) |
| New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
| New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new[] (size_t size) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
| New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
| New operator used to allocate arrays of objects. More...
|
|
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
| New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
| New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
|
|
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
| New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
|
|
static UtilExport void | operator delete (void *ptr) |
| Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
| Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
| Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
| Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
| Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
| Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
| Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete[] (void *ptr) |
| Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
| Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
| Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
| Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
| Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
|
|
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
| Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
| Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
|
|
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
| Placement new operator. More...
|
|
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
| Placement delete operator. More...
|
|
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
| Allocates memory on a specified alignment boundary. More...
|
|
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
| Reallocates memory on a specified alignment boundary. More...
|
|
static UtilExport void | aligned_free (void *ptr) |
| Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
|
|
This class provides low level access to the GPU device.
It wraps the variable 3D API into an unified interface. This means you do not need to know whether the real device is actually Direct3D9, Direct3D11 or OpenGL. Similar to the device interface in Direct3D, this interface provides rendering functions such as Draw() and DrawInstanced(), and resource functions like SetVertexStreams(), SetIndexBuffer() and so on. You can also change render states via Get/SetBlendState(), Get/SetRasterizerState(), and Get/SetDepthStencilState(). For example, to change the Z-Bias of the next draw call, use RasterizerState::SetDepthBias() or RasterizerState::SetSlopeScaledDepthBias().
- See also
- For information about how to obtain the draw context and work with the Nitrous API, see Low-level Device API and About RenderItem. You should read all the topics on Nitrous before developing Nitrous plugins.
For an example of code that implements this interface, see the sample project in howto/Graphiccs/GPUParticle.
- Example Code:
Typical usage of rendering geometry data may look like this:
class SampleItemDX9 : public ICustomRenderItem
{
...
};
void SampleItemDX9::Display(DrawContext& dc)
{
IVirtualDevice& vd = drawContext.GetVirtualDevice();
BaseMaterialHandle& material = const_cast<BaseMaterialHandle&>(drawContext.GetMaterial());
vd.SetStreamFormat(const_cast<MaterialRequiredStreams&>(*material.GetRequiredStreams()));
vd.SetVertexStreams(mVertexBuffer);
vd.SetIndexBuffer(&mIndexBuffer);
material.Activate(drawContext);
unsigned int passCount = material.GetPassCount(drawContext);
for (int pass = 0; pass < passCount; ++pass)
{
material.ActivatePass(drawContext, pass);
}
material.Terminate(drawContext);
}
@ PrimitiveTriangleList
A list of unconnected triangles, yielding (vertex_count / 3) triangles.
Definition: RenderEnums.h:41
Typical usage of stream-out data may look like this:
vd.SetDepthStencilState(mDepthOffState);
streamOutEffect.Activate(drawContext);
streamOutEffect.ActivatePass(drawContext, 0);
vd.SetStreamFormat(streamOutEffect.GetStreamFormat());
vd.SetIndexBuffer(nullptr);
vd.SetVertexStreams(mRawDataBuffers);
vd.SetOutputStreams(&mStreamOutBuffers);
vd.SetOutputStreams(nullptr);
streamOutEffect.PassesFinished(drawContext);
streamOutEffect.Terminate();
vd.SetDepthStencilState(mBackupState);
@ PrimitivePointList
A list of independent points.
Definition: RenderEnums.h:27