[2236] | 1 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 2 | //
|
---|
| 3 | // ## ######
|
---|
| 4 | // ###### ###
|
---|
| 5 | // ## ############### Shark 3D Engine (www.shark3d.com)
|
---|
| 6 | // ########## # # #
|
---|
| 7 | // ######## Copyright (c) 1996-2006 Spinor GmbH.
|
---|
| 8 | // ######### # # # All rights reserved.
|
---|
| 9 | // ## ##########
|
---|
| 10 | // ##
|
---|
| 11 | //
|
---|
| 12 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 13 |
|
---|
| 14 | //@cpp
|
---|
| 15 |
|
---|
| 16 | #ifndef S3D_DRV_D3D9_ENG_NULL_H
|
---|
| 17 | #define S3D_DRV_D3D9_ENG_NULL_H
|
---|
| 18 |
|
---|
| 19 | #include "drv_d3d9_settings.h"
|
---|
| 20 | #include "drv_d3d9_types.h"
|
---|
| 21 | #include "drv/interf/drv_gfx.h"
|
---|
| 22 | #include "drv/interf/drv_ctx.h"
|
---|
| 23 | #include "drv/interf/win32/drv_win32_ctx.h"
|
---|
| 24 | #include "comp/core/comp_module.h"
|
---|
| 25 | #include "comp/core/comp_setup.h"
|
---|
| 26 |
|
---|
| 27 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 28 | #ifdef S3D_DRV_D3D9_USE_ENGNULL
|
---|
| 29 |
|
---|
| 30 | class s3d_CDrvD3d9GfxEngNull
|
---|
| 31 | : public s3d_CDrvGfxEng
|
---|
| 32 | {
|
---|
| 33 | public:
|
---|
| 34 | s3d_CDrvD3d9GfxEngNull(
|
---|
| 35 | s3d_CUtilMsgHandler *MsgHandler, s3d_CUtilStr_cr Info,
|
---|
| 36 | s3d_CCompSuppl *CompSuppl, s3d_CUtilAtomMgr *AtomMgr,
|
---|
| 37 | s3d_CUtilMemPool *MemPool, s3d_CCompResMgr *ResMgr,
|
---|
| 38 | s3d_CUtilStorageMgr *StorageMgr, s3d_CDrvCtx *Ctx,
|
---|
| 39 | s3d_CCompSuppl *UnivProgSuppl,
|
---|
| 40 | s3d_CCompSuppl *UnivProgGivenSuppl,
|
---|
| 41 | s3d_CUtilSnkChunk *Param, s3d_CUtilStr_cr Device, int Prop,
|
---|
| 42 | int Left, int Top, int Width, int Height,
|
---|
| 43 | int Depth, int Frequency);
|
---|
| 44 | ~s3d_CDrvD3d9GfxEngNull();
|
---|
| 45 |
|
---|
| 46 | s3d_CUtilStr GetDesc() const;
|
---|
| 47 |
|
---|
| 48 | void UserFunc(s3d_CUtilCoStr Func);
|
---|
| 49 |
|
---|
| 50 | bool HasCap(
|
---|
| 51 | s3d_CSysIntps CapLen, const s3d_CSysChar *CapStart) const;
|
---|
| 52 |
|
---|
| 53 | s3d_CDrvGfxStat *GetStat();
|
---|
| 54 |
|
---|
| 55 | int GetSampCnt() const;
|
---|
| 56 |
|
---|
| 57 | int GetStencilBits() const;
|
---|
| 58 |
|
---|
| 59 | void SnapTexSize(
|
---|
| 60 | int &Width, int &Height, int &Depth,
|
---|
| 61 | int TexProp, int SnapProp);
|
---|
| 62 |
|
---|
| 63 | s3d_CDrvGfxTexPtr CreateTexDirect(
|
---|
| 64 | s3d_CUtilStr_cr Info, int TexProp,
|
---|
| 65 | int Width, int Height, int Depth);
|
---|
| 66 |
|
---|
| 67 | s3d_CDrvGfxTexPtr CreateTexStream(
|
---|
| 68 | s3d_CUtilStr_cr Info, int TexProp,
|
---|
| 69 | s3d_CUtilStream *Stream);
|
---|
| 70 |
|
---|
| 71 | s3d_CDrvGfxTexPtr CreateTexVideo(
|
---|
| 72 | s3d_CUtilStr_cr Info, int TexProp,
|
---|
| 73 | s3d_CDrvVideoPlayer *VideoPlayer);
|
---|
| 74 |
|
---|
| 75 | s3d_CDrvGfxTexPtr CreateTexIdent(
|
---|
| 76 | s3d_CUtilStr_cr Info, int TexProp,
|
---|
| 77 | s3d_CUtilStr_cr Ident);
|
---|
| 78 |
|
---|
| 79 | s3d_CDrvGfxTexPtr CreateTexUser(
|
---|
| 80 | s3d_CUtilStr_cr Info, int TexProp,
|
---|
| 81 | s3d_CCompObj *UserObj);
|
---|
| 82 |
|
---|
| 83 | void SetSampTex(
|
---|
| 84 | int Samp, s3d_CDrvGfxTex *Tex);
|
---|
| 85 |
|
---|
| 86 | void SetSampTexElseNone(int SampStart);
|
---|
| 87 |
|
---|
| 88 | void SetSampMode(
|
---|
| 89 | int Samp, int SampMode);
|
---|
| 90 |
|
---|
| 91 | s3d_CDrvGfxProgPtr CreateProg(
|
---|
| 92 | s3d_CUtilNotifGather *NotifGather,
|
---|
| 93 | s3d_CUtilSnkChunk *Desc);
|
---|
| 94 |
|
---|
| 95 | void GetSize(int &Width, int &Height) const;
|
---|
| 96 |
|
---|
| 97 | int GetColorBits() const;
|
---|
| 98 |
|
---|
| 99 | void SetGamma(
|
---|
| 100 | s3d_CUtilVec3f_cr Gamma);
|
---|
| 101 |
|
---|
| 102 | void Present();
|
---|
| 103 |
|
---|
| 104 | void GetCurTargetSize(int &Width, int &Height) const;
|
---|
| 105 |
|
---|
| 106 | void EndRender();
|
---|
| 107 |
|
---|
| 108 | void BeginRenderMain(
|
---|
| 109 | int DestProp,
|
---|
| 110 | s3d_CDrvGfxClearParam_cr ClearParam,
|
---|
| 111 | s3d_CDrvGfxOut *GfxOut);
|
---|
| 112 |
|
---|
| 113 | void BeginRenderTex(
|
---|
| 114 | int DestProp,
|
---|
| 115 | s3d_CDrvGfxClearParam_cr ClearParam,
|
---|
| 116 | int Width, int Height,
|
---|
| 117 | s3d_CSysIntps DestCnt, const s3d_CDrvGfxDest *DestArray);
|
---|
| 118 |
|
---|
| 119 | void CopyIntoTex(
|
---|
| 120 | int Width, int Height, int SrcX, int SrcY,
|
---|
| 121 | s3d_CSysIntps DestCnt, const s3d_CDrvGfxDest *DestArray);
|
---|
| 122 |
|
---|
| 123 | void StoreScreenshot();
|
---|
| 124 |
|
---|
| 125 | void SetViewRect(
|
---|
| 126 | s3d_CUtilTranslScale2f_cr ViewRect);
|
---|
| 127 |
|
---|
| 128 | void SetViewDepthRange(float NegZ, float PosZ);
|
---|
| 129 |
|
---|
| 130 | void SetCullMode(int Mode);
|
---|
| 131 |
|
---|
| 132 | void SetDepthTest(int Mode);
|
---|
| 133 |
|
---|
| 134 | void SetDepthWrite(bool Enabled);
|
---|
| 135 |
|
---|
| 136 | int GetStencilBits() const;
|
---|
| 137 |
|
---|
| 138 | void SetStencilMode(
|
---|
| 139 | int TestMask, int TestRef, int TestModeFront, int TestModeBack,
|
---|
| 140 | int WriteMask,
|
---|
| 141 | int OpFailFront, int OpDepthFailFront, int OpDepthPassFront,
|
---|
| 142 | int OpFailBack, int OpDepthFailBack, int OpDepthPassBack);
|
---|
| 143 |
|
---|
| 144 | void SetAlphaTest(
|
---|
| 145 | int Mode, float Ref);
|
---|
| 146 |
|
---|
| 147 | void SetBlendMode(
|
---|
| 148 | int ColSrcFac, int ColDestFac, int ColOp,
|
---|
| 149 | int AlphaSrcFac, int AlphaDestFac, int AlphaOp);
|
---|
| 150 |
|
---|
| 151 | void SetPaintMode(int Mode);
|
---|
| 152 |
|
---|
| 153 | void SetPaintExt(float Ext);
|
---|
| 154 |
|
---|
| 155 | void BeginVisib();
|
---|
| 156 |
|
---|
| 157 | s3d_CDrvGfxVisibPtr EndVisib();
|
---|
| 158 |
|
---|
| 159 | void SetFogNone();
|
---|
| 160 |
|
---|
| 161 | void SetFogExp(float Density, s3d_CUtilVec3f_cr Color);
|
---|
| 162 |
|
---|
| 163 | bool IsStereo() const;
|
---|
| 164 |
|
---|
| 165 | void SetStereoEyeOffset(s3d_CUtilVec3f_cr EyeOffset);
|
---|
| 166 |
|
---|
| 167 | void SetTransf(
|
---|
| 168 | int Chan, int Slot, s3d_CUtilMat4x4f_cr Mat);
|
---|
| 169 |
|
---|
| 170 | void SetTransfIdentity(
|
---|
| 171 | int Chan, int Slot);
|
---|
| 172 |
|
---|
| 173 | void SetClipPlane(
|
---|
| 174 | s3d_CUtilVec4f_cr Plane);
|
---|
| 175 |
|
---|
| 176 | void SetDepthBias(
|
---|
| 177 | float BiasOverlay, float BiasOffs);
|
---|
| 178 |
|
---|
| 179 | void DisableLighting();
|
---|
| 180 |
|
---|
| 181 | void SetLightArray(
|
---|
| 182 | s3d_CSysIntps LightCnt,
|
---|
| 183 | s3d_CDrvGfxLight **LightArray);
|
---|
| 184 |
|
---|
| 185 | void SetMtl(
|
---|
| 186 | s3d_CUtilVec3f_cr Ambient, s3d_CUtilVec3f_cr Diffuse,
|
---|
| 187 | s3d_CUtilVec3f_cr Specular, s3d_CUtilVec3f_cr Emissive,
|
---|
| 188 | float SpecExp, float Alpha);
|
---|
| 189 |
|
---|
| 190 | void SetColorAlpha(
|
---|
| 191 | s3d_CUtilVec4f_cr ColorAlpha);
|
---|
| 192 |
|
---|
| 193 | void GetPacketLimits(
|
---|
| 194 | s3d_CSysIntps &MaxVertCnt, s3d_CSysIntps &MaxPrimCnt,
|
---|
| 195 | int Prim);
|
---|
| 196 |
|
---|
| 197 | s3d_CDrvGfxBatchPtr CreateBatch(
|
---|
| 198 | const s3d_CDrvGfxCharge *Charge);
|
---|
| 199 |
|
---|
| 200 | void ExecuteCharge(
|
---|
| 201 | const s3d_CDrvGfxCharge *Charge, s3d_CDrvGfxBatch *Batch,
|
---|
| 202 | s3d_CDrvGfxParam_cr GfxParam);
|
---|
| 203 |
|
---|
| 204 |
|
---|
| 205 |
|
---|
| 206 | s3d_CDrvWin32CtxInterf *m_CtxWin32;
|
---|
| 207 | s3d_CDrvD3d9Direct3d m_D3d;
|
---|
| 208 | s3d_CDrvD3d9Device m_D3dDev;
|
---|
| 209 | int m_Width;
|
---|
| 210 | int m_Height;
|
---|
| 211 | DWORD m_DevFlags;
|
---|
| 212 | D3DPRESENT_PARAMETERS m_PresentParam;
|
---|
| 213 | };
|
---|
| 214 |
|
---|
| 215 | //@
|
---|
| 216 | typedef s3d_CUtilPtr<s3d_CDrvD3d9GfxEngNull> s3d_CDrvD3d9GfxEngNullPtr;
|
---|
| 217 |
|
---|
| 218 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 219 |
|
---|
| 220 | //@
|
---|
| 221 | class s3d_CDrvD3d9GfxEngNullMgr: public s3d_CDrvGfxMgr
|
---|
| 222 | {
|
---|
| 223 | public:
|
---|
| 224 | S3D_UTIL_RTTI_TABLE_DECLARE
|
---|
| 225 |
|
---|
| 226 | ~s3d_CDrvD3d9GfxEngNullMgr();
|
---|
| 227 |
|
---|
| 228 | bool EnumFullscreenModes(
|
---|
| 229 | s3d_CUtilArray<s3d_CDrvGfxEnumEntry> &EnumArray,
|
---|
| 230 | s3d_CUtilStr_cr Info, s3d_CUtilSnkChunk *Param);
|
---|
| 231 |
|
---|
| 232 | s3d_CDrvGfxEngPtr CreateEng();
|
---|
| 233 |
|
---|
| 234 | s3d_CUtilSnkChunkPtr GetDefaultOutParam();
|
---|
| 235 |
|
---|
| 236 | };
|
---|
| 237 |
|
---|
| 238 | //@
|
---|
| 239 | typedef s3d_CUtilPtr<s3d_CDrvD3d9GfxEngNullMgr> s3d_CDrvD3d9GfxEngNullMgrPtr;
|
---|
| 240 |
|
---|
| 241 | #endif // S3D_DRV_D3D9_USE_ENGNULL
|
---|
| 242 |
|
---|
| 243 | ///////////////////////////////////////////////////////////////////////////////
|
---|
| 244 |
|
---|
| 245 | #endif
|
---|