CmD3D9RenderSystem.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. /*
  2. -----------------------------------------------------------------------------
  3. This source file is part of OGRE
  4. (Object-oriented Graphics Rendering Engine)
  5. For the latest info, see http://www.ogre3d.org
  6. Copyright (c) 2000-2011 Torus Knot Software Ltd
  7. Permission is hereby granted, free of charge, to any person obtaining a copy
  8. of this software and associated documentation files (the "Software"), to deal
  9. in the Software without restriction, including without limitation the rights
  10. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. copies of the Software, and to permit persons to whom the Software is
  12. furnished to do so, subject to the following conditions:
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. THE SOFTWARE.
  22. -----------------------------------------------------------------------------
  23. */
  24. #ifndef __D3D9RENDERSYSTEM_H__
  25. #define __D3D9RENDERSYSTEM_H__
  26. #include "CmD3D9Prerequisites.h"
  27. #include "CmString.h"
  28. #include "CmRenderSystem.h"
  29. #include "CmRenderSystemCapabilities.h"
  30. #include "CmD3D9Mappings.h"
  31. #include "CmCgProgramFactory.h"
  32. namespace CamelotFramework
  33. {
  34. /**
  35. Implementation of DirectX9 as a rendering system.
  36. */
  37. class CM_D3D9_EXPORT D3D9RenderSystem : public RenderSystem
  38. {
  39. public:
  40. // constructor
  41. D3D9RenderSystem( HINSTANCE hInstance );
  42. // destructor
  43. ~D3D9RenderSystem();
  44. /**
  45. * @copydoc RenderSystem::getName()
  46. */
  47. const String& getName() const;
  48. /**
  49. * @copydoc RenderSystem::getShadingLanguageName()
  50. */
  51. const String& getShadingLanguageName() const;
  52. /**
  53. * @copydoc RenderSystem::setRenderTarget()
  54. */
  55. void setRenderTarget(RenderTargetPtr target);
  56. /**
  57. * @copydoc RenderSystem::bindGpuProgram()
  58. */
  59. void bindGpuProgram(HGpuProgram prg);
  60. /**
  61. * @copydoc RenderSystem::unbindGpuProgram()
  62. */
  63. void unbindGpuProgram(GpuProgramType gptype);
  64. /**
  65. * @copydoc RenderSystem::bindGpuParams()
  66. */
  67. void bindGpuParams(GpuProgramType gptype, BindableGpuParams& params);
  68. /**
  69. * @copydoc RenderSystem::setVertexBuffers()
  70. */
  71. void setVertexBuffers(UINT32 index, VertexBufferPtr* buffers, UINT32 numBuffers);
  72. /**
  73. * @copydoc RenderSystem::setIndexBuffer()
  74. */
  75. void setIndexBuffer(const IndexBufferPtr& buffer);
  76. /**
  77. * @copydoc RenderSystem::setVertexDeclaration()
  78. */
  79. void setVertexDeclaration(VertexDeclarationPtr vertexDeclaration);
  80. /**
  81. * @copydoc RenderSystem::setDrawOperation()
  82. */
  83. void setDrawOperation(DrawOperationType op);
  84. /**
  85. * @copydoc RenderSystem::setSamplerState()
  86. */
  87. void setTexture(GpuProgramType gptype, UINT16 unit, bool enabled, const TexturePtr &texPtr);
  88. /**
  89. * @copydoc RenderSystem::setSamplerState()
  90. */
  91. void setSamplerState(GpuProgramType gptype, UINT16 unit, const SamplerStatePtr& state);
  92. /**
  93. * @copydoc RenderSystem::setBlendState()
  94. */
  95. void setBlendState(const BlendStatePtr& blendState);
  96. /**
  97. * @copydoc RenderSystem::setRasterizerState()
  98. */
  99. void setRasterizerState(const RasterizerStatePtr& rasterizerState);
  100. /**
  101. * @copydoc RenderSystem::setDepthStencilState()
  102. */
  103. void setDepthStencilState(const DepthStencilStatePtr& depthStencilState, UINT32 stencilRefValue);
  104. /**
  105. * @copydoc RenderSystem::setViewport()
  106. */
  107. void setViewport(const ViewportPtr& vp);
  108. /**
  109. * @copydoc RenderSystem::beginFrame()
  110. */
  111. void beginFrame();
  112. /**
  113. * @copydoc RenderSystem::endFrame()
  114. */
  115. void endFrame();
  116. /**
  117. * @copydoc RenderSystem::draw()
  118. */
  119. void draw(UINT32 vertexOffset, UINT32 vertexCount);
  120. /**
  121. * @copydoc RenderSystem::drawIndexed()
  122. */
  123. void drawIndexed(UINT32 startIndex, UINT32 indexCount, UINT32 vertexOffset, UINT32 vertexCount);
  124. void setScissorRect(UINT32 left, UINT32 top, UINT32 right, UINT32 bottom);
  125. /**
  126. * @copydoc RenderSystem::clearRenderTarget()
  127. */
  128. void clearRenderTarget(UINT32 buffers, const Color& color = Color::Black, float depth = 1.0f, UINT16 stencil = 0);
  129. /**
  130. * @copydoc RenderSystem::clearViewport()
  131. */
  132. void clearViewport(UINT32 buffers, const Color& color = Color::Black, float depth = 1.0f, UINT16 stencil = 0);
  133. void convertProjectionMatrix(const Matrix4& matrix, Matrix4& dest, bool forGpuProgram = false);
  134. float getHorizontalTexelOffset();
  135. float getVerticalTexelOffset();
  136. float getMinimumDepthInputValue();
  137. float getMaximumDepthInputValue();
  138. VertexElementType getColorVertexElementType() const;
  139. /************************************************************************/
  140. /* Internal use by DX9 RenderSystem only */
  141. /************************************************************************/
  142. static D3D9ResourceManager* getResourceManager();
  143. static D3D9DeviceManager* getDeviceManager();
  144. static IDirect3D9* getDirect3D9();
  145. static UINT getResourceCreationDeviceCount();
  146. static IDirect3DDevice9* getResourceCreationDevice(UINT index);
  147. static IDirect3DDevice9* getActiveD3D9Device();
  148. /// Take in some requested FSAA settings and output supported D3D settings
  149. void determineFSAASettings(IDirect3DDevice9* d3d9Device, UINT32 fsaa, const String& fsaaHint, D3DFORMAT d3dPixelFormat,
  150. bool fullScreen, D3DMULTISAMPLE_TYPE *outMultisampleType, DWORD *outMultisampleQuality) const;
  151. void registerWindow(RenderWindow& renderWindow);
  152. private:
  153. /// Direct3D
  154. IDirect3D9* mpD3D;
  155. /// instance
  156. HINSTANCE mhInstance;
  157. UINT32 mViewportLeft, mViewportTop, mViewportWidth, mViewportHeight;
  158. // Scissor test rectangle
  159. RECT mScissorRect;
  160. /// List of D3D drivers installed (video cards)
  161. mutable D3D9DriverList* mDriverList; // TODO - Mutable because it gets constructed in getDirect3DDrivers(). Change that.
  162. /// Currently active driver
  163. D3D9Driver* mActiveD3DDriver;
  164. /// NVPerfHUD allowed?
  165. bool mUseNVPerfHUD;
  166. /// Fast singleton access.
  167. static D3D9RenderSystem* msD3D9RenderSystem;
  168. DrawOperationType mCurrentDrawOperation;
  169. /// structure holding texture unit settings for every stage
  170. struct sD3DTextureStageDesc
  171. {
  172. /// the type of the texture
  173. D3D9Mappings::eD3DTexType texType;
  174. /// which texCoordIndex to use
  175. size_t coordIndex;
  176. /// texture
  177. IDirect3DBaseTexture9 *pTex;
  178. /// vertex texture
  179. IDirect3DBaseTexture9 *pVertexTex;
  180. };
  181. UINT32 mNumTexStages;
  182. sD3DTextureStageDesc* mTexStageDesc;
  183. D3D9DriverList* getDirect3DDrivers() const;
  184. // state management methods, very primitive !!!
  185. HRESULT __SetRenderState(D3DRENDERSTATETYPE state, DWORD value);
  186. HRESULT __SetSamplerState(DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value);
  187. HRESULT __SetTextureStageState(DWORD stage, D3DTEXTURESTAGESTATETYPE type, DWORD value);
  188. HRESULT __SetFloatRenderState(D3DRENDERSTATETYPE state, float value)
  189. {
  190. return __SetRenderState(state, *((LPDWORD)(&value)));
  191. }
  192. /// return anisotropy level
  193. DWORD _getCurrentAnisotropy(UINT32 unit);
  194. /// check if a FSAA is supported
  195. bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
  196. D3D9HLSLProgramFactory* mHLSLProgramFactory;
  197. CgProgramFactory* mCgProgramFactory;
  198. D3D9ResourceManager* mResourceManager;
  199. D3D9DeviceManager* mDeviceManager;
  200. /// Internal method for populating the capabilities structure
  201. virtual RenderSystemCapabilities* createRenderSystemCapabilities() const;
  202. RenderSystemCapabilities* updateRenderSystemCapabilities(D3D9RenderWindow* renderWindow);
  203. /** See RenderSystem definition */
  204. virtual void initialiseFromRenderSystemCapabilities(RenderSystemCapabilities* caps);
  205. void convertVertexShaderCaps(RenderSystemCapabilities* rsc) const;
  206. void convertPixelShaderCaps(RenderSystemCapabilities* rsc) const;
  207. protected:
  208. // I know that's a lot of friends, but I'd rather have friend classes than exposing the needed methods
  209. // as public interface.
  210. friend class D3D9Texture;
  211. friend class D3D9RenderWindow;
  212. friend class D3D9Device;
  213. friend class D3D9TextureManager;
  214. friend class D3D9DeviceManager;
  215. friend class D3D9RenderWindowManager;
  216. void initialize_internal(AsyncOp& asyncOp);
  217. void destroy_internal();
  218. void setClipPlanesImpl(const PlaneList& clipPlanes);
  219. String getErrorDescription( long errorNumber ) const;
  220. void setClipPlane (UINT16 index, float A, float B, float C, float D);
  221. void enableClipPlane (UINT16 index, bool enable);
  222. HINSTANCE getInstanceHandle() const { return mhInstance; }
  223. /**
  224. * @brief Returns the D3D9 specific mode used for drawing, depending on the
  225. * currently set draw operation;
  226. */
  227. D3DPRIMITIVETYPE getD3D9PrimitiveType() const;
  228. /**
  229. * @brief Converts the number of points to number of primitives
  230. * based on the specified draw operation.
  231. */
  232. UINT32 pointCountToPrimCount(DrawOperationType type, UINT32 elementCount) const;
  233. /** Check whether or not filtering is supported for the precise texture format requested
  234. with the given usage options.
  235. */
  236. bool checkTextureFilteringSupported(TextureType ttype, PixelFormat format, int usage);
  237. /************************************************************************/
  238. /* Sampler states */
  239. /************************************************************************/
  240. /** Sets the texture addressing mode for a texture unit.*/
  241. void setTextureAddressingMode(UINT16 stage, const UVWAddressingMode& uvw);
  242. /** Sets a single filter for a given texture unit.
  243. @param unit The texture unit to set the filtering options for
  244. @param ftype The filter type
  245. @param filter The filter to be used
  246. */
  247. void setTextureFiltering(UINT16 unit, FilterType ftype, FilterOptions filter);
  248. /** Sets the maximal anisotropy for the specified texture unit.*/
  249. void setTextureAnisotropy(UINT16 unit, unsigned int maxAnisotropy);
  250. /** Sets the texture border colour for a texture unit.*/
  251. void setTextureBorderColor(UINT16 stage, const Color& color);
  252. /** Sets the mipmap bias value for a given texture unit.
  253. @remarks
  254. This allows you to adjust the mipmap calculation up or down for a
  255. given texture unit. Negative values force a larger mipmap to be used,
  256. positive values force a smaller mipmap to be used. Units are in numbers
  257. of levels, so +1 forces the mipmaps to one smaller level.
  258. @note Only does something if render system has capability RSC_MIPMAP_LOD_BIAS.
  259. */
  260. void setTextureMipmapBias(UINT16 unit, float bias);
  261. /************************************************************************/
  262. /* Blend states */
  263. /************************************************************************/
  264. /** Sets the global blending factors for combining subsequent renders with the existing frame contents.
  265. The result of the blending operation is:</p>
  266. <p align="center">final = (texture * sourceFactor) + (pixel * destFactor)</p>
  267. Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
  268. enumerated type.
  269. By changing the operation you can change addition between the source and destination pixels to a different operator.
  270. @param sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
  271. @param destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
  272. @param op The blend operation mode for combining pixels
  273. */
  274. void setSceneBlending( BlendFactor sourceFactor, BlendFactor destFactor, BlendOperation op );
  275. /** Sets the global blending factors for combining subsequent renders with the existing frame contents.
  276. The result of the blending operation is:</p>
  277. <p align="center">final = (texture * sourceFactor) + (pixel * destFactor)</p>
  278. Each of the factors is specified as one of a number of options, as specified in the SceneBlendFactor
  279. enumerated type.
  280. @param sourceFactor The source factor in the above calculation, i.e. multiplied by the texture colour components.
  281. @param destFactor The destination factor in the above calculation, i.e. multiplied by the pixel colour components.
  282. @param sourceFactorAlpha The source factor in the above calculation for the alpha channel, i.e. multiplied by the texture alpha components.
  283. @param destFactorAlpha The destination factor in the above calculation for the alpha channel, i.e. multiplied by the pixel alpha components.
  284. @param op The blend operation mode for combining pixels
  285. @param alphaOp The blend operation mode for combining pixel alpha values
  286. */
  287. void setSceneBlending( BlendFactor sourceFactor, BlendFactor destFactor, BlendFactor sourceFactorAlpha,
  288. BlendFactor destFactorAlpha, BlendOperation op, BlendOperation alphaOp );
  289. /** Sets the global alpha rejection approach for future renders.
  290. By default images are rendered regardless of texture alpha. This method lets you change that.
  291. @param func The comparison function which must pass for a pixel to be written.
  292. @param val The value to compare each pixels alpha value to (0-255)
  293. */
  294. void setAlphaTest(CompareFunction func, unsigned char value);
  295. /**
  296. * @brief Enable alpha coverage if supported.
  297. */
  298. void setAlphaToCoverage(bool enabled);
  299. /** Sets whether or not colour buffer writing is enabled, and for which channels.
  300. @remarks
  301. For some advanced effects, you may wish to turn off the writing of certain colour
  302. channels, or even all of the colour channels so that only the depth buffer is updated
  303. in a rendering pass. However, the chances are that you really want to use this option
  304. through the Material class.
  305. @param red, green, blue, alpha Whether writing is enabled for each of the 4 colour channels. */
  306. void setColorBufferWriteEnabled(bool red, bool green, bool blue, bool alpha);
  307. /************************************************************************/
  308. /* Rasterizer states */
  309. /************************************************************************/
  310. /** Sets the culling mode for the render system based on the 'vertex winding'.
  311. A typical way for the rendering engine to cull triangles is based on the
  312. 'vertex winding' of triangles. Vertex winding refers to the direction in
  313. which the vertices are passed or indexed to in the rendering operation as viewed
  314. from the camera, and will wither be clockwise or anticlockwise (that's 'counterclockwise' for
  315. you Americans out there ;) The default is CULL_CLOCKWISE i.e. that only triangles whose vertices
  316. are passed/indexed in anticlockwise order are rendered - this is a common approach and is used in 3D studio models
  317. for example. You can alter this culling mode if you wish but it is not advised unless you know what you are doing.
  318. You may wish to use the CULL_NONE option for mesh data that you cull yourself where the vertex
  319. winding is uncertain.
  320. */
  321. void setCullingMode(CullingMode mode);
  322. /** Sets how to rasterise triangles, as points, wireframe or solid polys. */
  323. void setPolygonMode(PolygonMode level);
  324. /** Sets the depth bias, NB you should use the Material version of this.
  325. @remarks
  326. When polygons are coplanar, you can get problems with 'depth fighting' where
  327. the pixels from the two polys compete for the same screen pixel. This is particularly
  328. a problem for decals (polys attached to another surface to represent details such as
  329. bulletholes etc.).
  330. @par
  331. A way to combat this problem is to use a depth bias to adjust the depth buffer value
  332. used for the decal such that it is slightly higher than the true value, ensuring that
  333. the decal appears on top.
  334. @note
  335. The final bias value is a combination of a constant bias and a bias proportional
  336. to the maximum depth slope of the polygon being rendered. The final bias
  337. is constantBias + slopeScaleBias * maxslope. Slope scale biasing is
  338. generally preferable but is not available on older hardware.
  339. @param constantBias The constant bias value, expressed as a value in
  340. homogeneous depth coordinates.
  341. @param slopeScaleBias The bias value which is factored by the maximum slope
  342. of the polygon, see the description above. This is not supported by all
  343. cards.
  344. */
  345. void setDepthBias(float constantBias, float slopeScaleBias);
  346. /**
  347. * @brief Scissor test allows you to 'mask off' rendering in all but a given rectangular area
  348. * identified by the rectangle set by setScissorRect().
  349. */
  350. void setScissorTestEnable(bool enable);
  351. /**
  352. * @brief Only applies when rendering to a multisample render target.
  353. * If disabled all of the samples will be taken from the center of the pixel,
  354. * effectively making the image aliased. Default value is true where samples are
  355. * picked randomly within the pixel.
  356. */
  357. void setMultisampleAntialiasEnable(bool enable);
  358. /**
  359. * @brief Only applies when rendering to a non-multisample render target.
  360. * If enabled, lines will be antialiased. Default state is disabled.
  361. */
  362. void setAntialiasedLineEnable(bool enable);
  363. /************************************************************************/
  364. /* Depth stencil state */
  365. /************************************************************************/
  366. /** Sets the mode of operation for depth buffer tests from this point onwards.
  367. Sometimes you may wish to alter the behaviour of the depth buffer to achieve
  368. special effects. Because it's unlikely that you'll set these options for an entire frame,
  369. but rather use them to tweak settings between rendering objects, this is an internal
  370. method (indicated by the '_' prefix) which will be used by a SceneManager implementation
  371. rather than directly from the client application.
  372. If this method is never called the settings are automatically the same as the default parameters.
  373. @param depthTest If true, the depth buffer is tested for each pixel and the frame buffer is only updated
  374. if the depth function test succeeds. If false, no test is performed and pixels are always written.
  375. @param depthWrite If true, the depth buffer is updated with the depth of the new pixel if the depth test succeeds.
  376. If false, the depth buffer is left unchanged even if a new pixel is written.
  377. @param depthFunction Sets the function required for the depth test.
  378. */
  379. void setDepthBufferParams(bool depthTest = true, bool depthWrite = true, CompareFunction depthFunction = CMPF_LESS_EQUAL);
  380. /** Sets whether or not the depth buffer check is performed before a pixel write.
  381. @param enabled If true, the depth buffer is tested for each pixel and the frame buffer is only updated
  382. if the depth function test succeeds. If false, no test is performed and pixels are always written.
  383. */
  384. void setDepthBufferCheckEnabled(bool enabled = true);
  385. /** Sets whether or not the depth buffer is updated after a pixel write.
  386. @param enabled If true, the depth buffer is updated with the depth of the new pixel if the depth test succeeds.
  387. If false, the depth buffer is left unchanged even if a new pixel is written.
  388. */
  389. void setDepthBufferWriteEnabled(bool enabled = true);
  390. /** Sets the comparison function for the depth buffer check.
  391. Advanced use only - allows you to choose the function applied to compare the depth values of
  392. new and existing pixels in the depth buffer. Only an issue if the deoth buffer check is enabled
  393. (see _setDepthBufferCheckEnabled)
  394. @param func The comparison between the new depth and the existing depth which must return true
  395. for the new pixel to be written.
  396. */
  397. void setDepthBufferFunction(CompareFunction func = CMPF_LESS_EQUAL);
  398. /** Turns stencil buffer checking on or off.
  399. @remarks
  400. Stencilling (masking off areas of the rendering target based on the stencil
  401. buffer) can be turned on or off using this method. By default, stencilling is
  402. disabled.
  403. */
  404. void setStencilCheckEnabled(bool enabled);
  405. /** This method allows you to set stencil buffer operations in one call.
  406. @param stencilFailOp The action to perform when the stencil check fails
  407. @param depthFailOp The action to perform when the stencil check passes, but the
  408. depth buffer check still fails
  409. @param passOp The action to take when both the stencil and depth check pass.
  410. @param ccw If set to true, the stencil operations will be applied to counterclockwise
  411. faces. Otherwise they will be applied to clockwise faces.
  412. */
  413. void setStencilBufferOperations(StencilOperation stencilFailOp = SOP_KEEP,
  414. StencilOperation depthFailOp = SOP_KEEP, StencilOperation passOp = SOP_KEEP,
  415. bool ccw = true);
  416. /**
  417. * @brief Sets a stencil buffer comparison function. The result of this will cause one of 3 actions depending on whether the test fails,
  418. * succeeds but with the depth buffer check still failing, or succeeds with the
  419. * depth buffer check passing too.
  420. * @param ccw If set to true, the stencil operations will be applied to counterclockwise
  421. * faces. Otherwise they will be applied to clockwise faces.
  422. */
  423. void setStencilBufferFunc(CompareFunction func = CMPF_ALWAYS_PASS, bool ccw = true);
  424. /**
  425. * @brief The bitmask applied to both the stencil value and the reference value
  426. * before comparison
  427. */
  428. void setStencilBufferReadMask(UINT32 mask = 0xFFFFFFFF);
  429. /**
  430. * @brief The bitmask applied to the stencil value before writing it to the stencil buffer.
  431. */
  432. void setStencilBufferWriteMask(UINT32 mask = 0xFFFFFFFF);
  433. /**
  434. * @brief Sets a reference values used for stencil buffer comparisons.
  435. * Actual comparison function and stencil operations are set by setting the DepthStencilState.
  436. */
  437. void setStencilRefValue(UINT32 refValue);
  438. void clearArea(UINT32 buffers, const Color& color = Color::Black, float depth = 1.0f, UINT16 stencil = 0, const RectI& clearArea = RectI::EMPTY);
  439. /// Notify when a device has been lost.
  440. void notifyOnDeviceLost(D3D9Device* device);
  441. /// Notify when a device has been reset.
  442. void notifyOnDeviceReset(D3D9Device* device);
  443. };
  444. }
  445. #endif