nD3D9Server Class Reference
#include <nd3d9server.h>
Inheritance diagram for nD3D9Server:

Detailed Description
D3D9 based gfx server.(C) 2002 RadonLabs GmbH
Definition at line 52 of file nd3d9server.h.
Public Member Functions | |
| nD3D9Server () | |
| constructor | |
| virtual | ~nD3D9Server () |
| destructor | |
| virtual nMesh2 * | NewMesh (const nString &rsrcName) |
| create a shared mesh object | |
| virtual nMeshArray * | NewMeshArray (const nString &rsrcName) |
| create a mesh array object | |
| virtual nTexture2 * | NewTexture (const nString &rsrcName) |
| create a shared texture object | |
| virtual nShader2 * | NewShader (const nString &rsrcName) |
| create a shared shader object | |
| virtual nFont2 * | NewFont (const nString &rsrcName, const nFontDesc &fontDesc) |
| create a font object | |
| virtual nTexture2 * | NewRenderTarget (const nString &rsrcName, int width, int height, nTexture2::Format fmt, int usageFlags) |
| create a render target object | |
| virtual nOcclusionQuery * | NewOcclusionQuery () |
| create a new occlusion query object | |
| virtual void | SetDisplayMode (const nDisplayMode2 &mode) |
| set display mode | |
| virtual const nDisplayMode2 & | GetDisplayMode () const |
| get display mode | |
| virtual void | SetWindowTitle (const char *title) |
| set the window title | |
| virtual void | SetCamera (nCamera2 &cam) |
| set the current camera description | |
| virtual void | SetViewport (nViewport &vp) |
| set the viewport | |
| virtual bool | OpenDisplay () |
| open the display | |
| virtual void | CloseDisplay () |
| close the display | |
| virtual FeatureSet | GetFeatureSet () |
| get the best supported feature set | |
| virtual bool | AreVertexShadersEmulated () |
| return true if vertex shader run in software emulation | |
| virtual HWND | GetAppHwnd () const |
| get window handle | |
| virtual HWND | GetParentHwnd () const |
| get parent window handle | |
| virtual int | GetNumStencilBits () const |
| returns the number of available stencil bits | |
| virtual int | GetNumDepthBits () const |
| returns the number of available z bits | |
| virtual void | SetScissorRect (const rectangle &r) |
| set scissor rect | |
| virtual void | SetClipPlanes (const nArray< plane > &planes) |
| set or clear user defined clip planes in clip space | |
| virtual void | SetRenderTarget (int index, nTexture2 *t) |
| set a new render target texture | |
| virtual bool | BeginFrame () |
| start rendering the current frame | |
| virtual bool | BeginScene () |
| start rendering to current render target | |
| virtual void | EndScene () |
| finish rendering to current render target | |
| virtual void | PresentScene () |
| present the contents of the back buffer | |
| virtual void | EndFrame () |
| end rendering the current frame | |
| virtual void | Clear (int bufferTypes, float red, float green, float blue, float alpha, float z, int stencil) |
| clear buffers | |
| virtual void | ClearLights () |
| reset the light array | |
| virtual void | ClearLight (int index) |
| remove a light | |
| virtual int | AddLight (const nLight &light) |
| add a light to the light array (reset in BeginScene) | |
| virtual void | SetMesh (nMesh2 *vbMesh, nMesh2 *ibMesh) |
| set current mesh | |
| virtual void | SetMeshArray (nMeshArray *meshArray) |
| set current mesh array, clearing the single mesh | |
| virtual void | SetShader (nShader2 *shader) |
| set current shader | |
| virtual void | SetTransform (TransformType type, const matrix44 &matrix) |
| set transform | |
| virtual void | DrawIndexed (PrimitiveType primType) |
| draw the current mesh with indexed primitives | |
| virtual void | Draw (PrimitiveType primType) |
| draw the current mesh with non-indexed primitives | |
| virtual void | DrawIndexedNS (PrimitiveType primType) |
| render indexed primitives without applying shader state (NS == No Shader) | |
| virtual void | DrawNS (PrimitiveType primType) |
| render non-indexed primitives without applying shader state (NS == No Shader) | |
| virtual bool | Trigger () |
| trigger the window system message pump | |
| virtual void | DrawText (const nString &text, const vector4 &color, const rectangle &rect, uint flags, bool immediate=true) |
| draw text (immediately) | |
| virtual vector2 | GetTextExtent (const nString &text) |
| get text extents | |
| virtual void | DrawTextBuffer () |
| draw accumulated text buffer | |
| virtual void | EnterDialogBoxMode () |
| enter dialog box mode (display mode must have DialogBoxMode enabled!) | |
| virtual void | LeaveDialogBoxMode () |
| leave dialog box mode | |
| virtual bool | SaveScreenshot (const char *fileName, nTexture2::FileFormat fileFormat) |
| save a screen shot | |
| virtual void | BeginLines () |
| begin rendering lines | |
| virtual void | DrawLines3d (const vector3 *vertexList, int numVertices, const vector4 &color) |
| draw 3d lines, using the current transforms | |
| virtual void | DrawLines2d (const vector2 *vertexList, int numVertices, const vector4 &color) |
| draw 2d lines in screen space | |
| virtual void | EndLines () |
| finish line rendering | |
| virtual void | BeginShapes () |
| begin shape rendering (for debug visualizations) | |
| virtual void | DrawShape (ShapeType type, const matrix44 &model, const vector4 &color) |
| draw a shape with the given model matrix with given color | |
| virtual void | DrawShapeNS (ShapeType type, const matrix44 &model) |
| draw a shape without shader management | |
| virtual void | DrawShapePrimitives (PrimitiveType type, int numPrimitives, const vector3 *vertexList, int vertexWidth, const matrix44 &model, const vector4 &color) |
| draw direct primitives | |
| virtual void | DrawShapeIndexedPrimitives (PrimitiveType type, int numPrimitives, const vector3 *vertexList, int numVertices, int vertexWidth, void *indices, IndexType indexType, const matrix44 &model, const vector4 &color) |
| draw direct indexed primitives (slow, use for debug visual visualization only!) | |
| virtual void | EndShapes () |
| end shape rendering | |
| IDirect3DDevice9 * | GetD3DDevice () const |
| Access Direct3D Device directly. Might be Null! | |
| IDirect3D9 * | GetD3D () const |
| Access Direct3D object directly. Might be Null! | |
| virtual void | AdjustGamma () |
| adjust gamma. | |
| virtual void | RestoreGamma () |
| restore gamma. | |
| virtual void | SetSkipMsgLoop (bool skip) |
| skip message loop in trigger | |
Static Public Member Functions | |
| static nD3D9Server * | Instance () |
| get instance pointer | |
Public Attributes | |
| IDirect3DDevice9 * | d3d9Device |
| pointer to device object | |
| IDirect3D9 * | d3d9 |
| pointer to D3D9 object | |
Friends | |
| class | nD3D9Mesh |
| class | nD3D9Texture |
| class | nD3D9Shader |
Classes | |
| class | TextElement |
Constructor & Destructor Documentation
|
|
constructor
Definition at line 16 of file nd3d9server_main.cc. |
|
|
destructor
Definition at line 68 of file nd3d9server_main.cc. |
Member Function Documentation
|
|
get instance pointer
Reimplemented from nGfxServer2. Definition at line 333 of file nd3d9server.h. |
|
|
create a shared mesh object Create a new shared mesh object. If the object already exists, its refcount is increment.
Reimplemented from nGfxServer2. Definition at line 22 of file nd3d9server_resource.cc. |
|
|
create a mesh array object Create a new mesh array object.
Reimplemented from nGfxServer2. Definition at line 34 of file nd3d9server_resource.cc. |
|
|
create a shared texture object Create a new shared texture object. If the object already exists, its refcount is incremented.
Reimplemented from nGfxServer2. Definition at line 48 of file nd3d9server_resource.cc. |
|
|
create a shared shader object Create a new shared shader object. If the object already exists, its refcount is incremented.
Reimplemented from nGfxServer2. Definition at line 62 of file nd3d9server_resource.cc. |
|
||||||||||||
|
create a font object Create a new shared font object. If the object already exists, its refcount is incremented.
Reimplemented from nGfxServer2. Definition at line 76 of file nd3d9server_resource.cc. |
|
||||||||||||||||||||||||
|
create a render target object Create a new render target object.
Reimplemented from nGfxServer2. Definition at line 95 of file nd3d9server_resource.cc. |
|
|
create a new occlusion query object Create a new occlusion query object.
Reimplemented from nGfxServer2. Definition at line 129 of file nd3d9server_resource.cc. |
|
|
set display mode Set the current display mode. This will not take effect until OpenDisplay() has been called! Reimplemented from nGfxServer2. Definition at line 270 of file nd3d9server_main.cc. |
|
|
get display mode Get the current display mode. Reimplemented from nGfxServer2. Definition at line 280 of file nd3d9server_main.cc. |
|
|
set the window title
Reimplemented from nGfxServer2. Definition at line 289 of file nd3d9server_main.cc. |
|
|
set the current camera description Update the d3d projection matrix from the new camera settings. Reimplemented from nGfxServer2. Definition at line 17 of file nd3d9server_render.cc. |
|
|
set the viewport Update the device viewport. Reimplemented from nGfxServer2. Definition at line 33 of file nd3d9server_render.cc. |
|
|
open the display Open the display. Reimplemented from nGfxServer2. Definition at line 129 of file nd3d9server_main.cc. |
|
|
close the display Close the display. Reimplemented from nGfxServer2. Definition at line 165 of file nd3d9server_main.cc. |
|
|
get the best supported feature set Get the supported feature set. Reimplemented from nGfxServer2. Definition at line 626 of file nd3d9server_device.cc. |
|
|
return true if vertex shader run in software emulation Return true when vertex shaders are running in emulation. Reimplemented from nGfxServer2. Definition at line 299 of file nd3d9server_main.cc. |
|
|
get window handle
Definition at line 454 of file nd3d9server.h. |
|
|
get parent window handle
Definition at line 464 of file nd3d9server.h. |
|
|
returns the number of available stencil bits This method should return the number of currently available stencil bits (override in subclass). Reimplemented from nGfxServer2. Definition at line 776 of file nd3d9server_device.cc. |
|
|
returns the number of available z bits This method should return the number of currently available depth bits (override in subclass). Reimplemented from nGfxServer2. Definition at line 793 of file nd3d9server_device.cc. |
|
|
set scissor rect Set the scissor rectangle. Note that this method doesn't enable/disable scissoring, this must be done externally in the shader. Reimplemented from nGfxServer2. Definition at line 1035 of file nd3d9server_device.cc. |
|
|
set or clear user defined clip planes in clip space Set user defined clip planes in clip space. Clip space is where outgoing vertex shader vertices live in. Up to 6 clip planes can be defined. Provide an empty array to clear all clip planes. NOTE: this method does not work in the DX7 render path (check the D3D docs why) Reimplemented from nGfxServer2. Definition at line 1071 of file nd3d9server_device.cc. |
|
||||||||||||
|
set a new render target texture Set the current render target at a given index (for simultaneous render targets). This method must be called outside BeginScene()/EndScene(). The method will increment the refcount of the render target object and decrement the refcount of the previous render target. Setting a render target of 0 at index 0 will restore the original back buffer as render target.
Reimplemented from nGfxServer2. Definition at line 707 of file nd3d9server_render.cc. |
|
|
start rendering the current frame Begin rendering the current frame. This is guaranteed to be called exactly once per frame. Reimplemented from nGfxServer2. Definition at line 377 of file nd3d9server_render.cc. |
|
|
start rendering to current render target Start rendering the scene. This can be called several times per frame (each render target requires its own BeginScene()/EndScene(). Reimplemented from nGfxServer2. Definition at line 422 of file nd3d9server_render.cc. |
|
|
finish rendering to current render target Finish rendering the scene and present the backbuffer. Reimplemented from nGfxServer2. Definition at line 454 of file nd3d9server_render.cc. |
|
|
present the contents of the back buffer Present the scene. Reimplemented from nGfxServer2. Definition at line 509 of file nd3d9server_render.cc. |
|
|
end rendering the current frame Finish rendering the current frame. This is guaranteed to be called exactly once per frame after PresentScene() has happened. Reimplemented from nGfxServer2. Definition at line 406 of file nd3d9server_render.cc. |
|
||||||||||||||||||||||||||||||||
|
clear buffers Clear buffers.
Reimplemented from nGfxServer2. Definition at line 479 of file nd3d9server_render.cc. |
|
|
reset the light array Reset lighting. Reimplemented from nGfxServer2. Definition at line 54 of file nd3d9server_render.cc. |
|
|
remove a light Reset lighting. Reimplemented from nGfxServer2. Definition at line 79 of file nd3d9server_render.cc. |
|
|
add a light to the light array (reset in BeginScene) Add a light to the light array. This will update the shared light effect state. Reimplemented from nGfxServer2. Definition at line 97 of file nd3d9server_render.cc. |
|
||||||||||||
|
set current mesh Bind vertex buffer and index buffer to vertex stream 0.
Reimplemented from nGfxServer2. Definition at line 537 of file nd3d9server_render.cc. |
|
|
set current mesh array, clearing the single mesh Set a mesh array for multiple vertex streams. Must be a nD3D9MeshArray The mesh in the array at stream 0 must provide a index buffer!
Reimplemented from nGfxServer2. Definition at line 607 of file nd3d9server_render.cc. |
|
|
set current shader Set the current shader object. Reimplemented from nGfxServer2. Definition at line 687 of file nd3d9server_render.cc. |
|
||||||||||||
|
set transform Set a transformation matrix. This will update the shared state in the effect pool. Reimplemented from nGfxServer2. Definition at line 228 of file nd3d9server_render.cc. |
|
|
draw the current mesh with indexed primitives Draw the currently set mesh with indexed primitives, texture and shader to the current render target. FIXME: the multi-pass renderer should check if state actually needs to be applied again. This is not necessary if the effect only has 1 pass, and is the same effect with the same parameters as in the last invocation of Draw(). Reimplemented from nGfxServer2. Definition at line 768 of file nd3d9server_render.cc. |
|
|
draw the current mesh with non-indexed primitives Draw the currently set mesh with non-indexed primitives. Reimplemented from nGfxServer2. Definition at line 819 of file nd3d9server_render.cc. |
|
|
render indexed primitives without applying shader state (NS == No Shader) Render the currently set mesh without applying any shader state. You must call nShader2::Begin(), nShader2::Pass() and nShader2::End() yourself as needed. Reimplemented from nGfxServer2. Definition at line 866 of file nd3d9server_render.cc. |
|
|
render non-indexed primitives without applying shader state (NS == No Shader) Render the currently set mesh without applying any shader state. You must call nShader2::Begin(), nShader2::Pass() and nShader2::End() yourself as needed. Reimplemented from nGfxServer2. Definition at line 912 of file nd3d9server_render.cc. |
|
|
trigger the window system message pump Implements the Windows message pump. Must be called once a frame OUTSIDE of BeginScene() / EndScene().
Reimplemented from nGfxServer2. Definition at line 180 of file nd3d9server_main.cc. |
|
||||||||||||||||||||||||
|
draw text (immediately) Public text rendering routine. Either draws the text immediately, or stores the text internally in a text element array and draws it towards the end of frame. Reimplemented from nGfxServer2. Definition at line 60 of file nd3d9server_text.cc. |
|
|
get text extents Get text extents.
Reimplemented from nGfxServer2. Definition at line 160 of file nd3d9server_text.cc. |
|
|
draw accumulated text buffer Draws the accumulated text elements and flushes the text buffer. Reimplemented from nGfxServer2. Definition at line 81 of file nd3d9server_text.cc. |
|
|
enter dialog box mode (display mode must have DialogBoxMode enabled!) Enter dialog box mode. Reimplemented from nGfxServer2. Definition at line 221 of file nd3d9server_main.cc. |
|
|
leave dialog box mode Leave dialog box mode. Reimplemented from nGfxServer2. Definition at line 246 of file nd3d9server_main.cc. |
|
||||||||||||
|
save a screen shot Create screen shot and save it to given filename. (.jpg file)
Reimplemented from nGfxServer2. Definition at line 194 of file nd3d9server_main.cc. |
|
|
begin rendering lines Begin rendering lines. Reimplemented from nGfxServer2. Definition at line 12 of file nd3d9server_lines.cc. |
|
||||||||||||||||
|
draw 3d lines, using the current transforms Render a 3d line strip using the current transformations. Reimplemented from nGfxServer2. Definition at line 25 of file nd3d9server_lines.cc. |
|
||||||||||||||||
|
draw 2d lines in screen space Render a 3d line strip using the current transformations. Careful: Clipping doesn't work correctly! Reimplemented from nGfxServer2. Definition at line 43 of file nd3d9server_lines.cc. |
|
|
finish line rendering Finish rendering lines. Reimplemented from nGfxServer2. Definition at line 71 of file nd3d9server_lines.cc. |
|
|
begin shape rendering (for debug visualizations) Begin rendering shape primitives. Shape primitives are handy for quickly rendering debug visualizations. Reimplemented from nGfxServer2. Definition at line 15 of file nd3d9server_shapes.cc. |
|
||||||||||||||||
|
draw a shape with the given model matrix with given color Render a standard shape using the provided model matrix and color. Reimplemented from nGfxServer2. Definition at line 30 of file nd3d9server_shapes.cc. |
|
||||||||||||
|
draw a shape without shader management Render a standard shape using the provided model matrix without any shader management. Reimplemented from nGfxServer2. Definition at line 57 of file nd3d9server_shapes.cc. |
|
||||||||||||||||||||||||||||
|
draw direct primitives Draw non-indexed primitives. This is slow, so it should only be used for debug visualizations. Vertex width is number of float's! Reimplemented from nGfxServer2. Definition at line 73 of file nd3d9server_shapes.cc. |
|
||||||||||||||||||||||||||||||||||||||||
|
draw direct indexed primitives (slow, use for debug visual visualization only!) Directly Draw indexed primitives. This is slow, so it should only be used for debug visualizations. Vertex width is number of float's! Reimplemented from nGfxServer2. Definition at line 108 of file nd3d9server_shapes.cc. |
|
|
end shape rendering Finish rendering shapes. Reimplemented from nGfxServer2. Definition at line 164 of file nd3d9server_shapes.cc. |
|
|
Access Direct3D Device directly. Might be Null!
Definition at line 484 of file nd3d9server.h. |
|
|
Access Dire |