ivideo/graph3d.h Source File (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ivideo/graph3d.h
Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 1998-2001 by Jorrit Tyberghein
    00003                        2004 by Marten Svanfeldt
    00004     Written by Jorrit Tyberghein, Dan Ogles, and Gary Clark.
    00005
    00006     This library is free software; you can redistribute it and/or
    00007     modify it under the terms of the GNU Library General Public
    00008     License as published by the Free Software Foundation; either
    00009     version 2 of the License, or (at your option) any later version.
    00010
    00011     This library is distributed in the hope that it will be useful,
    00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014     Library General Public License for more details.
    00015
    00016     You should have received a copy of the GNU Library General Public
    00017     License along with this library; if not, write to the Free
    00018     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00019 */
    00020
    00021 #ifndef __CS_IVIDEO_GRAPH3D_H__
    00022 #define __CS_IVIDEO_GRAPH3D_H__
    00023
    00032 #include "csutil/scf.h"
    00033
    00034 #include "csgeom/matrix4.h"
    00035 #include "csgeom/transfrm.h"
    00036 #include "csutil/flags.h"
    00037 #include "csutil/strset.h"
    00038
    00039 #include "ivideo/rndbuf.h"
    00040
    00041 struct iClipper2D;
    00042 struct iGraphics2D;
    00043 struct iHalo;
    00044 struct iRenderBuffer;
    00045 struct iShader;
    00046 struct iShaderVariableContext;
    00047 struct iTextureHandle;
    00048 struct iTextureManager;
    00049
    00050 class csRect;
    00051 class csPlane3;
    00052 class csShaderVariable;
    00053 class csVector2;
    00054 class csVector3;
    00055 class csVector4;
    00056
    00057 namespace CS
    00058 {
    00059   namespace Graphics
    00060   {
    00061     struct CoreRenderMesh;
    00062     struct RenderMeshModes;
    00063   } // namespace Graphics
    00064 } // namespace CS
    00065 class csRenderBufferHolder;
    00066 class csShaderVariableStack;
    00067
    00068
    00071
    00072 #define CSDRAW_2DGRAPHICS   0x00000001
    00073
    00074 #define CSDRAW_3DGRAPHICS   0x00000002
    00075
    00076 #define CSDRAW_CLEARZBUFFER 0x00000010
    00077
    00078 #define CSDRAW_CLEARSCREEN  0x00000020
    00079
    00080 #define CSDRAW_NOCLIPCLEAR  0x00000040
    00081
    00086 #define CSDRAW_READBACK     0x00000080
    00087
    00094 #define CS_CLIPPER_NONE -1
    00095
    00098 #define CS_CLIPPER_OPTIONAL 0
    00099
    00102 #define CS_CLIPPER_TOPLEVEL 1
    00103
    00106 #define CS_CLIPPER_REQUIRED 2
    00107
    00115 #define CS_CLIP_NOT 0
    00116
    00121 #define CS_CLIP_NEEDED 1
    00122
    00124
    00125 enum csZBufMode
    00126 {
    00128   CS_ZBUF_NONE     = 0x00000000,
    00130   CS_ZBUF_FILL     = 0x00000001,
    00132   CS_ZBUF_TEST     = 0x00000002,
    00134   CS_ZBUF_USE      = 0x00000003,
    00136   CS_ZBUF_EQUAL    = 0x00000004,
    00138   CS_ZBUF_INVERT   = 0x00000005,
    00139
    00141   CS_ZBUF_MESH     = 0x80000000,
    00150   CS_ZBUF_MESH2    = 0x80000001
    00151 };
    00152
    00153 // @@@ Keep in sync with values below
    00154 // \todo Document me!
    00155 #define CS_VATTRIB_SPECIFIC_FIRST    0
    00156 #define CS_VATTRIB_SPECIFIC_LAST    15
    00157 #define CS_VATTRIB_SPECIFIC_NUM     \
    00158   (CS_VATTRIB_SPECIFIC_LAST - CS_VATTRIB_SPECIFIC_FIRST + 1)
    00159 #define CS_VATTRIB_GENERIC_FIRST   100
    00160 #define CS_VATTRIB_GENERIC_LAST    (CS_VATTRIB_GENERIC_FIRST + 15)
    00161 #define CS_VATTRIB_GENERIC_NUM     \
    00162   (CS_VATTRIB_GENERIC_LAST - CS_VATTRIB_GENERIC_FIRST + 1)
    00163 #define CS_IATTRIB_FIRST           200
    00164 #define CS_IATTRIB_LAST            (CS_IATTRIB_FIRST + 0)
    00165 #define CS_IATTRIB_NUM             \
    00166   (CS_IATTRIB_LAST - CS_IATTRIB_FIRST + 1)
    00167
    00168
    00169 #define CS_VATTRIB_IS_GENERIC(va)   \
    00170   ((va >= CS_VATTRIB_GENERIC_FIRST) && (va <=CS_VATTRIB_GENERIC_LAST))
    00171 #define CS_VATTRIB_IS_SPECIFIC(va)   \
    00172   ((va >= CS_VATTRIB_SPECIFIC_FIRST) && (va <=CS_VATTRIB_SPECIFIC_LAST))
    00173
    00177 enum csVertexAttrib
    00178 {
    00182   CS_VATTRIB_UNUSED           = -2,
    00184   CS_VATTRIB_INVALID          = -1,
    00186   CS_VATTRIB_POSITION         = CS_VATTRIB_SPECIFIC_FIRST + 0,
    00188   CS_VATTRIB_WEIGHT           = CS_VATTRIB_SPECIFIC_FIRST + 1,
    00190   CS_VATTRIB_NORMAL           = CS_VATTRIB_SPECIFIC_FIRST + 2,
    00192   CS_VATTRIB_COLOR            = CS_VATTRIB_SPECIFIC_FIRST + 3,
    00194   CS_VATTRIB_PRIMARY_COLOR    = CS_VATTRIB_SPECIFIC_FIRST + 3,
    00196   CS_VATTRIB_SECONDARY_COLOR  = CS_VATTRIB_SPECIFIC_FIRST + 4,
    00198   CS_VATTRIB_FOGCOORD         = CS_VATTRIB_SPECIFIC_FIRST + 5,
    00200   CS_VATTRIB_TEXCOORD         = CS_VATTRIB_SPECIFIC_FIRST + 8,
    00202   CS_VATTRIB_TEXCOORD0        = CS_VATTRIB_SPECIFIC_FIRST + 8,
    00204   CS_VATTRIB_TEXCOORD1        = CS_VATTRIB_SPECIFIC_FIRST + 9,
    00206   CS_VATTRIB_TEXCOORD2        = CS_VATTRIB_SPECIFIC_FIRST + 10,
    00208   CS_VATTRIB_TEXCOORD3        = CS_VATTRIB_SPECIFIC_FIRST + 11,
    00210   CS_VATTRIB_TEXCOORD4        = CS_VATTRIB_SPECIFIC_FIRST + 12,
    00212   CS_VATTRIB_TEXCOORD5        = CS_VATTRIB_SPECIFIC_FIRST + 13,
    00214   CS_VATTRIB_TEXCOORD6        = CS_VATTRIB_SPECIFIC_FIRST + 14,
    00216   CS_VATTRIB_TEXCOORD7        = CS_VATTRIB_SPECIFIC_FIRST + 15,
    00218
    00221   CS_VATTRIB_0  = CS_VATTRIB_GENERIC_FIRST + 0,
    00222   CS_VATTRIB_1  = CS_VATTRIB_GENERIC_FIRST + 1,
    00223   CS_VATTRIB_2  = CS_VATTRIB_GENERIC_FIRST + 2,
    00224   CS_VATTRIB_3  = CS_VATTRIB_GENERIC_FIRST + 3,
    00225   CS_VATTRIB_4  = CS_VATTRIB_GENERIC_FIRST + 4,
    00226   CS_VATTRIB_5  = CS_VATTRIB_GENERIC_FIRST + 5,
    00227   CS_VATTRIB_6  = CS_VATTRIB_GENERIC_FIRST + 6,
    00228   CS_VATTRIB_7  = CS_VATTRIB_GENERIC_FIRST + 7,
    00229   CS_VATTRIB_8  = CS_VATTRIB_GENERIC_FIRST + 8,
    00230   CS_VATTRIB_9  = CS_VATTRIB_GENERIC_FIRST + 9,
    00231   CS_VATTRIB_10 = CS_VATTRIB_GENERIC_FIRST + 10,
    00232   CS_VATTRIB_11 = CS_VATTRIB_GENERIC_FIRST + 11,
    00233   CS_VATTRIB_12 = CS_VATTRIB_GENERIC_FIRST + 12,
    00234   CS_VATTRIB_13 = CS_VATTRIB_GENERIC_FIRST + 13,
    00235   CS_VATTRIB_14 = CS_VATTRIB_GENERIC_FIRST + 14,
    00236   CS_VATTRIB_15 = CS_VATTRIB_GENERIC_FIRST + 15,
    00238
    00240   CS_IATTRIB_OBJECT2WORLD = CS_IATTRIB_FIRST + 0
    00241 };
    00242
    00252 #define CS_MIXMODE_TYPE_AUTO (0x00000000)
    00253
    00261 #define CS_MIXMODE_TYPE_BLENDOP (0x40000000)
    00262
    00266 #define CS_MIXMODE_FLAG_BLENDOP_ALPHA (0x08000000)
    00267
    00271 #define CS_MIXMODE_TYPE_MESH (0x80000000)
    00272
    00274 #define CS_MIXMODE_TYPE_MASK (0xc0000000)
    00275
    00277
    00278 enum
    00279 {
    00281   CS_MIXMODE_FACT_ZERO          = 0x0,
    00283   CS_MIXMODE_FACT_ONE           = 0x1,
    00285   CS_MIXMODE_FACT_SRCCOLOR      = 0x2,
    00287   CS_MIXMODE_FACT_SRCCOLOR_INV  = 0x3,
    00289   CS_MIXMODE_FACT_DSTCOLOR      = 0x4,
    00291   CS_MIXMODE_FACT_DSTCOLOR_INV  = 0x5,
    00293   CS_MIXMODE_FACT_SRCALPHA      = 0x6,
    00295   CS_MIXMODE_FACT_SRCALPHA_INV  = 0x7,
    00297   CS_MIXMODE_FACT_DSTALPHA      = 0x8,
    00299   CS_MIXMODE_FACT_DSTALPHA_INV  = 0x9,
    00300
    00302   CS_MIXMODE_FACT_COUNT         = 0xa,
    00303
    00305   CS_MIXMODE_FACT_MASK          = 0xf
    00306 };
    00307
    00318 #define CS_MIXMODE_ALPHATEST_AUTO (0x00000000)
    00319
    00320 #define CS_MIXMODE_ALPHATEST_ENABLE (0x10000000)
    00321
    00322 #define CS_MIXMODE_ALPHATEST_DISABLE (0x20000000)
    00323
    00325 #define CS_MIXMODE_ALPHATEST_MASK (0x30000000)
    00326
    00340 #define CS_MIXMODE_BLEND(Src, Dst)                                      \
    00341   (CS_MIXMODE_TYPE_BLENDOP                                              \
    00342   | (CS_MIXMODE_FACT_ ## Src << 20) | (CS_MIXMODE_FACT_ ## Dst << 16))
    00343
    00344 #define CS_MIXMODE_BLENDOP_SRC(mode)    ((mode >> 20) & CS_MIXMODE_FACT_MASK)
    00345
    00346 #define CS_MIXMODE_BLENDOP_DST(mode)    ((mode >> 16) & CS_MIXMODE_FACT_MASK)
    00347
    00360 #define CS_MIXMODE_BLEND_ALPHA(Src, Dst)                                \
    00361   (CS_MIXMODE_FLAG_BLENDOP_ALPHA                                        \
    00362   | (CS_MIXMODE_FACT_ ## Src << 12) | (CS_MIXMODE_FACT_ ## Dst << 8))
    00363
    00364 #define CS_MIXMODE_BLENDOP_ALPHA_SRC(mode)      ((mode >> 12) & CS_MIXMODE_FACT_MASK)
    00365
    00366 #define CS_MIXMODE_BLENDOP_ALPHA_DST(mode)      ((mode >> 8) & CS_MIXMODE_FACT_MASK)
    00367
    00382 #define CS_FX_COPY (CS_MIXMODE_TYPE_AUTO | CS_MIXMODE_ALPHATEST_AUTO)
    00383
    00384 #define CS_FX_MULTIPLY \
    00385     (CS_MIXMODE_BLEND(DSTCOLOR, ZERO) | CS_MIXMODE_ALPHATEST_DISABLE)
    00386
    00387 #define CS_FX_MULTIPLY2 \
    00388     (CS_MIXMODE_BLEND(DSTCOLOR, SRCCOLOR) | CS_MIXMODE_ALPHATEST_DISABLE)
    00389
    00390 #define CS_FX_ADD \
    00391     (CS_MIXMODE_BLEND(ONE, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
    00392
    00397 #define CS_FX_ALPHA \
    00398     (CS_MIXMODE_BLEND(SRCALPHA, SRCALPHA_INV) \
    00399     | CS_MIXMODE_BLEND_ALPHA(ONE, SRCALPHA_INV) | CS_MIXMODE_ALPHATEST_DISABLE)
    00400
    00405 #define CS_FX_TRANSPARENT \
    00406     (CS_MIXMODE_BLEND(ZERO, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
    00407
    00411 #define CS_FX_DESTALPHAADD \
    00412     (CS_MIXMODE_BLEND(DSTALPHA, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
    00413
    00417 #define CS_FX_SRCALPHAADD \
    00418     (CS_MIXMODE_BLEND(SRCALPHA, ONE) | CS_MIXMODE_ALPHATEST_DISABLE)
    00419
    00428 #define CS_FX_PREMULTALPHA \
    00429     (CS_MIXMODE_BLEND(ONE, SRCALPHA_INV) | \
    00430     CS_MIXMODE_BLEND_ALPHA(ONE, SRCALPHA_INV) | CS_MIXMODE_ALPHATEST_DISABLE)
    00431
    00435 #define CS_FX_MESH (CS_MIXMODE_TYPE_MESH)
    00436
    00438 #define CS_FX_FLAT (0x04000000)
    00439
    00448 #define CS_FX_MASK_ALPHA (0x000000FF)
    00449
    00454 #define CS_FX_MASK_MIXMODE (0xf8ffff00)
    00455
    00459
    00460 #define CS_FX_SETALPHA(alpha) \
    00461   (CS_FX_ALPHA | uint ((alpha) * CS_FX_MASK_ALPHA))
    00462
    00463 #define CS_FX_SETALPHA_INT(alpha) \
    00464   (CS_FX_ALPHA | uint ((alpha) & CS_FX_MASK_ALPHA))
    00465
    00470 struct csAlphaMode
    00471 {
    00473   enum AlphaType
    00474   {
    00476     alphaNone = 1,
    00478     alphaBinary,
    00480     alphaSmooth
    00481   };
    00483   bool autoAlphaMode;
    00484   union
    00485   {
    00487     AlphaType alphaType;
    00492     CS::StringIDValue autoModeTexture;
    00493   };
    00494 };
    00499
    00500 #define CS_SHADOW_VOLUME_BEGIN 1
    00501
    00502 #define CS_SHADOW_VOLUME_PASS1 2
    00503
    00504 #define CS_SHADOW_VOLUME_PASS2 3
    00505
    00506 #define CS_SHADOW_VOLUME_FAIL1 4
    00507
    00508 #define CS_SHADOW_VOLUME_FAIL2 5
    00509
    00510 #define CS_SHADOW_VOLUME_USE 6
    00511
    00512 #define CS_SHADOW_VOLUME_FINISH 7
    00513
    00515
    00516 enum G3D_RENDERSTATEOPTION
    00517 {
    00519   G3DRENDERSTATE_EDGES
    00520 };
    00521
    00523 struct csGraphics3DCaps
    00524 {
    00526   int minTexHeight, minTexWidth;
    00528   int maxTexHeight, maxTexWidth;
    00533   bool SupportsPointSprites;
    00537   bool DestinationAlpha;
    00541   bool StencilShadows;
    00546   int MaxRTColorAttachments;
    00547 };
    00548
    00550 enum csRenderMeshType
    00551 {
    00553   CS_MESHTYPE_TRIANGLES,
    00555   CS_MESHTYPE_QUADS,
    00565   CS_MESHTYPE_TRIANGLESTRIP,
    00571   CS_MESHTYPE_TRIANGLEFAN,
    00575   CS_MESHTYPE_POINTS,
    00581   CS_MESHTYPE_POINT_SPRITES,
    00585   CS_MESHTYPE_LINES,
    00590   CS_MESHTYPE_LINESTRIP
    00591 };
    00592
    00596 enum csSimpleMeshFlags
    00597 {
    00604   csSimpleMeshScreenspace = 0x01
    00605 };
    00606
    00611 enum csOpenPortalFlags
    00612 {
    00621   CS_OPENPORTAL_ZFILL = 0x00000004,
    00626   CS_OPENPORTAL_MIRROR = 0x00000010,
    00634   CS_OPENPORTAL_FLOAT = 0x00000040
    00635 };
    00636
    00640 struct csSimpleRenderMesh
    00641 {
    00643   csRenderMeshType meshtype;
    00644
    00646   uint indexCount;
    00654   const uint* indices;
    00656
    00661   uint indexStart, indexEnd;
    00663
    00665   uint vertexCount;
    00671   const csVector3* vertices;
    00673   const csVector2* texcoords;
    00679   const csVector4* colors;
    00684   iTextureHandle* texture;
    00685
    00687   iShader* shader;
    00689   iShaderVariableContext* dynDomain;
    00691   csAlphaMode alphaType;
    00693   csZBufMode z_buf_mode;
    00695   uint mixmode;
    00706   csReversibleTransform object2world;
    00708   csRef<csRenderBufferHolder> renderBuffers;
    00709
    00710   csSimpleRenderMesh () : indexCount(0), indices(0), indexStart (0),
    00711     indexEnd (0), texcoords(0), colors(0),
    00712     texture (0), shader (0), dynDomain (0), z_buf_mode (CS_ZBUF_NONE),
    00713     mixmode (CS_FX_COPY)
    00714   {
    00715     alphaType.autoAlphaMode = true;
    00716     alphaType.autoModeTexture = csInvalidStringID;
    00717   };
    00718 };
    00719
    00724 enum csRenderTargetAttachment
    00725 {
    00727   rtaDepth,
    00729   rtaColor0,
    00731   rtaColor1,
    00733   rtaColor2,
    00735   rtaColor3,
    00737   rtaColor4,
    00739   rtaColor5,
    00741   rtaColor6,
    00743   rtaColor7,
    00745   rtaColor8,
    00747   rtaColor9,
    00749   rtaColor10,
    00751   rtaColor11,
    00753   rtaColor12,
    00755   rtaColor13,
    00757   rtaColor14,
    00759   rtaColor15,
    00760
    00761   /*
    00762    * We stop at 16 color buffer attachment points since that is the current limit placed
    00763    * on the OpenGL framebuffer extension (as of May 19 2010).
    00764    *
    00765    * http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt
    00766    */
    00767
    00769   rtaNumAttachments,
    00771   rtaNumColorAttachments = rtaNumAttachments - 1
    00772 };
    00773
    00774 namespace CS
    00775 {
    00776   namespace Graphics
    00777   {
    00778     struct TextureComparisonMode
    00779     {
    00780       enum Mode
    00781       {
    00782         compareNone,
    00783         compareR
    00784       };
    00785       Mode mode;
    00786       enum Function
    00787       {
    00788         funcLEqual,
    00789         funcGEqual
    00790       };
    00791       Function function;
    00792
    00793       TextureComparisonMode() : mode (compareNone), function (funcLEqual) {}
    00794     };
    00795   } // namespace Graphics
    00796 } // namespace CS
    00797
    00809 struct iGraphics3D : public virtual iBase
    00810 {
    00811   SCF_INTERFACE(iGraphics3D, 4, 0, 3);
    00812
    00814   virtual bool Open () = 0;
    00816   virtual void Close () = 0;
    00817
    00825   virtual iGraphics2D *GetDriver2D () = 0;
    00826
    00833   virtual iTextureManager *GetTextureManager () = 0;
    00834
    00839   CS_DEPRECATED_METHOD
    00840   virtual void SetDimensions (int width, int height) = 0;
    00842   virtual int GetWidth () const = 0;
    00844   virtual int GetHeight () const = 0;
    00845
    00850   virtual const csGraphics3DCaps *GetCaps () const = 0;
    00851
    00859   CS_DEPRECATED_METHOD_MSG("Use explicit projection matrix instead")
    00860   virtual void SetPerspectiveCenter (int x, int y) = 0;
    00861
    00869   CS_DEPRECATED_METHOD_MSG("Use explicit projection matrix instead")
    00870   virtual void GetPerspectiveCenter (int& x, int& y) const = 0;
    00871
    00876   CS_DEPRECATED_METHOD_MSG("Use explicit projection matrix instead")
    00877   virtual void SetPerspectiveAspect (float aspect) = 0;
    00878
    00883   CS_DEPRECATED_METHOD_MSG("Use explicit projection matrix instead")
    00884   virtual float GetPerspectiveAspect () const = 0;
    00885
    00913   virtual bool SetRenderTarget (iTextureHandle* handle,
    00914         bool persistent = false,
    00915         int subtexture = 0,
    00916         csRenderTargetAttachment attachment = rtaColor0) = 0;
    00917
    00926   virtual bool ValidateRenderTargets () = 0;
    00927
    00934   virtual bool CanSetRenderTarget (const char* format,
    00935     csRenderTargetAttachment attachment = rtaColor0) = 0;
    00936
    00942   virtual iTextureHandle* GetRenderTarget (
    00943     csRenderTargetAttachment attachment = rtaColor0,
    00944     int* subtexture = 0) const = 0;
    00945
    00947   virtual void UnsetRenderTargets() = 0;
    00948
    00950   virtual bool BeginDraw (int DrawFlags) = 0;
    00951
    00953   virtual void FinishDraw () = 0;
    00954
    00960   virtual void Print (csRect const* area) = 0;
    00961
    00963   virtual void DrawMesh (const CS::Graphics::CoreRenderMesh* mymesh,
    00964                          const CS::Graphics::RenderMeshModes& modes,
    00965                          const csShaderVariableStack& stack) = 0;
    00982   virtual void DrawSimpleMesh (const csSimpleRenderMesh& mesh,
    00983     uint flags = 0) = 0;
    00984
    00999   virtual void DrawPixmap (iTextureHandle *hTex, int sx, int sy,
    01000     int sw, int sh, int tx, int ty, int tw, int th, uint8 Alpha = 0) = 0;
    01001
    01007   CS_DEPRECATED_METHOD_MSG("Use iGraphics2D::DrawLineProjected() instead")
    01008   virtual void DrawLine (const csVector3& v1, const csVector3& v2,
    01009     float fov, int color) = 0;
    01010
    01014   virtual bool ActivateBuffers (csRenderBufferHolder* holder,
    01015     csRenderBufferName mapping[CS_VATTRIB_SPECIFIC_LAST+1]) = 0;
    01016
    01020   virtual bool ActivateBuffers (csVertexAttrib *attribs,
    01021     iRenderBuffer **buffers, unsigned int count) = 0;
    01022
    01027   virtual void DeactivateBuffers (csVertexAttrib *attribs, unsigned int count) = 0;
    01028
    01034   virtual void SetTextureState (int* units, iTextureHandle** textures,
    01035     int count) = 0;
    01036
    01037
    01043   virtual void SetClipper (iClipper2D* clipper, int cliptype) = 0;
    01044
    01048   virtual iClipper2D* GetClipper () = 0;
    01049
    01053   virtual int GetClipType () const = 0;
    01054
    01059   virtual void SetNearPlane (const csPlane3& pl) = 0;
    01060
    01064   virtual void ResetNearPlane () = 0;
    01065
    01069   virtual const csPlane3& GetNearPlane () const = 0;
    01070
    01074   virtual bool HasNearPlane () const = 0;
    01075
    01080   CS_DEPRECATED_METHOD_MSG("Use SetEdgeDrawing() for sole supported render state")
    01081   virtual bool SetRenderState (G3D_RENDERSTATEOPTION op, long val) = 0;
    01082
    01087   CS_DEPRECATED_METHOD_MSG("Use GetEdgeDrawing() for sole supported render state")
    01088   virtual long GetRenderState (G3D_RENDERSTATEOPTION op) const = 0;
    01089
    01094   virtual bool SetOption (const char*, const char*) = 0;
    01095
    01097   virtual void SetWriteMask (bool red, bool green, bool blue, bool alpha) = 0;
    01098
    01100   virtual void GetWriteMask (bool &red, bool &green, bool &blue,
    01101         bool &alpha) const = 0;
    01102
    01104   virtual void SetZMode (csZBufMode mode) = 0;
    01105
    01107   virtual csZBufMode GetZMode () = 0;
    01108
    01112   CS_DEPRECATED_METHOD_MSG("Nonfunctional. Use RenderMeshModes::zoffset instead")
    01113   virtual void EnableZOffset () = 0;
    01114
    01118   CS_DEPRECATED_METHOD_MSG("Nonfunctional. Use RenderMeshModes::zoffset instead")
    01119   virtual void DisableZOffset () = 0;
    01120
    01122   virtual void SetShadowState (int state) = 0;
    01123
    01125   virtual float GetZBuffValue (int x, int y) = 0;
    01126
    01137   virtual void OpenPortal (size_t numVertices, const csVector2* vertices,
    01138     const csPlane3& normal, csFlags flags) = 0;
    01139
    01144   virtual void ClosePortal () = 0;
    01145
    01147   virtual iHalo *CreateHalo (float iR, float iG, float iB,
    01148     unsigned char *iAlpha, int iWidth, int iHeight) = 0;
    01149
    01155   virtual void SetWorldToCamera (const csReversibleTransform& w2c) = 0;
    01156
    01164   virtual bool PerformExtension (char const* command, ...) = 0;
    01165
    01171   virtual bool PerformExtensionV (char const* command, va_list) = 0;
    01172
    01177   virtual const csReversibleTransform& GetWorldToCamera () = 0;
    01181   virtual int GetCurrentDrawFlags() const = 0;
    01182
    01183   virtual const CS::Math::Matrix4& GetProjectionMatrix() = 0;
    01187   virtual void SetProjectionMatrix (const CS::Math::Matrix4& m) = 0;
    01188
    01192   virtual void SetTextureComparisonModes (int* units,
    01193     CS::Graphics::TextureComparisonMode* texCompare,
    01194     int count) = 0;
    01195
    01206   virtual void CopyFromRenderTargets (size_t num,
    01207     csRenderTargetAttachment* attachments,
    01208     iTextureHandle** textures,
    01209     int* subtextures = 0) = 0;
    01210
    01215   virtual void DrawSimpleMeshes (const csSimpleRenderMesh* meshes,
    01216     size_t numMeshes, uint flags = 0) = 0;
    01217
    01223   virtual void OQInitQueries (unsigned int* queries, int num_queries) = 0;
    01224
    01226   virtual void OQDelQueries (unsigned int* queries, int num_queries) = 0;
    01227
    01231   virtual bool OQueryFinished (unsigned int occlusion_query) = 0;
    01232
    01236   virtual bool OQIsVisible (unsigned int occlusion_query, unsigned int sampleLimit = 0) = 0;
    01237
    01239   virtual void OQBeginQuery (unsigned int occlusion_query) = 0;
    01241   virtual void OQEndQuery () = 0;
    01244   virtual void DrawMeshBasic(const CS::Graphics::CoreRenderMesh* mymesh,
    01245                                                         const CS::Graphics::RenderMeshModes& modes) = 0;
    01246
    01248   virtual void SetEdgeDrawing (bool flag) = 0;
    01250   virtual bool GetEdgeDrawing () = 0;
    01251 };
    01252
    01255 #endif // __CS_IVIDEO_GRAPH3D_H__