![]() |
Public API Reference |
#include <graph3d.h>
Inheritance diagram for iGraphics3D:
Public Methods | |
virtual bool | Open ()=0 |
Open the 3D graphics display. More... | |
virtual void | Close ()=0 |
Close the 3D graphics display. More... | |
virtual iGraphics2D * | GetDriver2D ()=0 |
Get the 2D driver: This does NOT increment the refcount of 2D driver! More... | |
virtual void | SetDimensions (int width, int height)=0 |
Change the dimensions of the display. More... | |
virtual int | GetWidth ()=0 |
Get drawing buffer width. More... | |
virtual int | GetHeight ()=0 |
Get drawing buffer height. More... | |
virtual csGraphics3DCaps * | GetCaps ()=0 |
Get the current driver's capabilities. More... | |
virtual void | SetPerspectiveCenter (int x, int y)=0 |
Set center of projection for perspective projection. More... | |
virtual void | GetPerspectiveCenter (int &x, int &y)=0 |
Get perspective center. More... | |
virtual void | SetPerspectiveAspect (float aspect)=0 |
Set aspect ratio for perspective projection. More... | |
virtual float | GetPerspectiveAspect ()=0 |
Get aspect ratio. More... | |
virtual void | SetObjectToCamera (csReversibleTransform *o2c)=0 |
Set world to camera transformation (currently only used by DrawTriangleMesh and DrawPolygonMesh). More... | |
virtual const csReversibleTransform & | GetObjectToCamera ()=0 |
Get world to camera transformation. More... | |
virtual void | SetClipper (iClipper2D *clipper, int cliptype)=0 |
Set optional clipper to use. More... | |
virtual iClipper2D * | GetClipper ()=0 |
Get clipper that was used. More... | |
virtual int | GetClipType ()=0 |
Return type of clipper. More... | |
virtual void | SetNearPlane (const csPlane3 &pl)=0 |
Set near clip plane. More... | |
virtual void | ResetNearPlane ()=0 |
Reset near clip plane (i.e. More... | |
virtual const csPlane3 & | GetNearPlane ()=0 |
Get near clip plane. More... | |
virtual bool | HasNearPlane ()=0 |
Return true if we have a near plane. More... | |
virtual uint32 * | GetZBuffAt (int x, int y)=0 |
Debugging only: get a pointer to Z-buffer at some location. More... | |
virtual float | GetZBuffValue (int x, int y)=0 |
Get Z-buffer value at given X,Y position. More... | |
virtual bool | BeginDraw (int DrawFlags)=0 |
Start a new frame (see CSDRAW_XXX bit flags). More... | |
virtual void | FinishDraw ()=0 |
End the frame and do a page swap. More... | |
virtual void | Print (csRect *area)=0 |
Print the image in backbuffer. More... | |
virtual bool | SetRenderState (G3D_RENDERSTATEOPTION op, long val)=0 |
Set a renderstate value. More... | |
virtual long | GetRenderState (G3D_RENDERSTATEOPTION op)=0 |
Get a renderstate value. More... | |
virtual void | DrawPolygon (G3DPolygonDP &poly)=0 |
Draw the projected polygon with light and texture. More... | |
virtual void | DrawPolygonDebug (G3DPolygonDP &poly)=0 |
Draw the projected polygon with light and texture. More... | |
virtual void | DrawPolygonFX (G3DPolygonDPFX &poly)=0 |
Draw a polygon with special effects. More... | |
virtual void | DrawTriangleMesh (G3DTriangleMesh &mesh)=0 |
Draw a triangle mesh using features similar to DrawPolygonFX. More... | |
virtual void | DrawPolygonMesh (G3DPolygonMesh &mesh)=0 |
Draw a triangle mesh using features similar to DrawPolygon. More... | |
virtual void | OpenFogObject (CS_ID id, csFog *fog)=0 |
Initiate a volumetric fog object. More... | |
virtual void | DrawFogPolygon (CS_ID id, G3DPolygonDFP &poly, int fogtype)=0 |
Add a front or back-facing fog polygon in the current fog object. More... | |
virtual void | CloseFogObject (CS_ID id)=0 |
Close a volumetric fog object. More... | |
virtual void | OpenPortal (G3DPolygonDFP *poly)=0 |
Enter a new clipped portal. More... | |
virtual void | ClosePortal ()=0 |
Close a portal previously opened with OpenPortal(). More... | |
virtual void | DrawLine (const csVector3 &v1, const csVector3 &v2, float fov, int color)=0 |
Draw a line in camera space. More... | |
virtual iHalo * | CreateHalo (float iR, float iG, float iB, unsigned char *iAlpha, int iWidth, int iHeight)=0 |
Create a halo of the specified color and return a handle. More... | |
virtual void | DrawPixmap (iTextureHandle *hTex, int sx, int sy, int sw, int sh, int tx, int ty, int tw, int th, uint8 Alpha=0)=0 |
Draw a pixmap using a rectangle from given texture. More... | |
virtual iTextureManager * | GetTextureManager ()=0 |
Get the texture manager: do NOT increment the refcount of texture manager. More... | |
virtual void | DumpCache ()=0 |
Dump the texture cache. More... | |
virtual void | ClearCache ()=0 |
Clear the texture cache. More... | |
virtual void | RemoveFromCache (iPolygonTexture *poly_texture)=0 |
Remove some polygon from the cache. More... | |
virtual iVertexBufferManager * | GetVertexBufferManager ()=0 |
Get the vertex buffer manager. More... | |
virtual bool | IsLightmapOK (iPolygonTexture *poly_texture)=0 |
Check if renderer can handle a lightmap. More... | |
virtual void | SetRenderTarget (iTextureHandle *handle, bool persistent=false)=0 |
Set the target of rendering. More... | |
virtual iTextureHandle * | GetRenderTarget () const=0 |
Get the current render target (NULL for screen). More... |
All 3D graphics rasterizer servers for Crystal Space should implement this interface, as well as the iGraphics2D interface. The standard implementation is csGraphics3DSoftware.
Definition at line 491 of file graph3d.h.
|
Start a new frame (see CSDRAW_XXX bit flags).
|
|
Clear the texture cache.
|
|
Close the 3D graphics display.
|
|
Close a volumetric fog object. After the volumetric object is closed it should be rendered on screen (whether you do it here or in DrawFogPolygon is not important). |
|
Close a portal previously opened with OpenPortal().
|
|
Create a halo of the specified color and return a handle.
|
|
Add a front or back-facing fog polygon in the current fog object.
Note that it is guaranteed that all back-facing fog polygons will have been added before the first front-facing polygon. fogtype can be:
|
|
Draw a line in camera space. Warning! This is a 2D operation and must be called while in BeginDraw(CSDRAW_2DGRAPHICS)! |
|
Draw a pixmap using a rectangle from given texture. The sx,sy(sw,sh) rectangle defines the screen rectangle within which the drawing is performed (clipping rectangle is also taken into account). The tx,ty(tw,th) rectangle defines a subrectangle from texture which should be painted. If the subrectangle exceeds the actual texture size, texture coordinates are wrapped around (e.g. the texture is tiled). The Alpha parameter defines the transparency of the drawing operation, 0 means opaque, 255 means fully transparent. WARNING: Tiling works only with textures that have power-of-two sizes! That is, both width and height should be a power-of-two, although not neccessarily equal. |
|
Draw the projected polygon with light and texture.
|
|
Draw the projected polygon with light and texture. Debugging version. This one does not actually draw anything but it just prints debug information about what it would have done. |
|
Draw a polygon with special effects. This is the most rich and slowest variant of DrawPolygonXxx. (If you use these features) Warning! Do not rely on this method to handle Color keying under all circumstances. Color Keying will only work reliable in Mixmodes FX_Copy, FX_Add and FX_Transparent. When using FX_Multiply and FX_Multiply2, it depends very much on the driver if it works or not. For example the RivaTNT Detonator 0.48 driver can display Multiply with color keying, while newer versions can't. They will then not display anything at all. It is always safer to use a texture where transparent sections are white or 50% gray if you want to achieve transparent sections in Multiply, Multiply2. There are also some drivers (which I would consider buggy...), that won't display FX_Alpha correctly with Color Keying. I can't provide a valid workaround for that except using FX_Multiplay and FX_Add, to manually create the image, but that would be very expensive. |
|
Draw a triangle mesh using features similar to DrawPolygon.
|
|
Draw a triangle mesh using features similar to DrawPolygonFX.
|
|
Dump the texture cache.
|
|
End the frame and do a page swap.
|
|
Get the current driver's capabilities. Each driver implements their own function. |
|
Get clipper that was used.
|
|
Return type of clipper.
|
|
Get the 2D driver: This does NOT increment the refcount of 2D driver!
|
|
Get drawing buffer height.
|
|
Get near clip plane.
|
|
Get world to camera transformation.
|
|
Get aspect ratio.
|
|
Get perspective center.
|
|
Get a renderstate value.
|
|
Get the current render target (NULL for screen).
|
|
Get the texture manager: do NOT increment the refcount of texture manager.
|
|
Get the vertex buffer manager. This will not increment the ref count of the vertex buffer manager! |
|
Get drawing buffer width.
|
|
Debugging only: get a pointer to Z-buffer at some location.
|
|
Get Z-buffer value at given X,Y position.
|
|
Return true if we have a near plane.
|
|
Check if renderer can handle a lightmap. Returns true if it can, false if not. |
|
Open the 3D graphics display.
|
|
Initiate a volumetric fog object. This function will be called before front-facing and back-facing fog polygons are added to the object. The fog object will be convex but not necesarily closed. The given CS_ID can be used to identify multiple fog objects when multiple objects are started. |
|
Enter a new clipped portal. Basically this routine will restrict all further drawing to the given 2D area and it will also respect the current contents of the Z-buffer so that geometry will only render where the Z-buffer allows it (even if zfill or znone is used). Remember to close a portal later using ClosePortal(). Basically this represents a stacked layer of portals. Each subsequent portal must be fully contained in the previous ones. |
|
Print the image in backbuffer. The area parameter is only a hint to the renderer. Changes outside the rectangle may or may not be printed as well. |
|
Remove some polygon from the cache. You have to call this function before deleting a polygon (csPolygon3D destructor will do that). |
|
Reset near clip plane (i.e. disable it). |
|
Set optional clipper to use. If clipper == null then there is no clipper. Currently only used by DrawTriangleMesh. |
|
Change the dimensions of the display.
|
|
Set near clip plane. Currently only used by DrawTriangleMesh. |
|
Set world to camera transformation (currently only used by DrawTriangleMesh and DrawPolygonMesh).
|
|
Set aspect ratio for perspective projection.
|
|
Set center of projection for perspective projection. Center is set in screen space coordinates. |
|
Set a renderstate value.
|
|
Set the target of rendering. If this is NULL then the target will be the main screen. Otherwise it is a texture. After calling g3d->FinishDraw() the target will automatically be reset to NULL (main screen). Note that on some implementions rendering on a texture will overwrite the screen. So you should only do this BEFORE you start rendering your frame. If 'persistent' is true then the current contents of the texture will be copied on screen before drawing occurs (in the first call to BeginDraw). Otherwise it is assumed that you fully render the texture. |