OGLGraphics.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. //
  2. // Urho3D Engine
  3. // Copyright (c) 2008-2012 Lasse Öörni
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to deal
  7. // in the Software without restriction, including without limitation the rights
  8. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. // copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  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. #pragma once
  24. #include "ArrayPtr.h"
  25. #include "Color.h"
  26. #include "GraphicsDefs.h"
  27. #include "HashMap.h"
  28. #include "Matrix3x4.h"
  29. #include "Object.h"
  30. #include "Rect.h"
  31. class Image;
  32. class IndexBuffer;
  33. class Matrix3;
  34. class Matrix4;
  35. class Matrix3x4;
  36. class GPUObject;
  37. class GraphicsImpl;
  38. class RenderSurface;
  39. class ShaderProgram;
  40. class ShaderVariation;
  41. class Texture;
  42. class Texture2D;
  43. class TextureCube;
  44. class Vector3;
  45. class Vector4;
  46. class VertexBuffer;
  47. typedef Map<Pair<ShaderVariation*, ShaderVariation*>, SharedPtr<ShaderProgram> > ShaderProgramMap;
  48. static const unsigned NUM_SCREEN_BUFFERS = 2;
  49. static const unsigned NUM_TEMP_MATRICES = 8;
  50. /// CPU-side scratch buffer for vertex data updates.
  51. struct ScratchBuffer
  52. {
  53. ScratchBuffer() :
  54. size_(0),
  55. reserved_(false)
  56. {
  57. }
  58. /// Buffer data.
  59. SharedArrayPtr<unsigned char> data_;
  60. /// Data size.
  61. unsigned size_;
  62. /// Reserved flag.
  63. bool reserved_;
  64. };
  65. /// %Graphics subsystem. Manages the application window, rendering state and GPU resources.
  66. class Graphics : public Object
  67. {
  68. OBJECT(Graphics);
  69. public:
  70. /// Construct.
  71. Graphics(Context* context_);
  72. /// Destruct. Release the OpenGL context and close the window.
  73. virtual ~Graphics();
  74. /// Set window title.
  75. void SetWindowTitle(const String& windowTitle);
  76. /// Set screen mode. Return true if successful.
  77. bool SetMode(int width, int height, bool fullscreen, bool vsync, bool tripleBuffer, int multiSample);
  78. /// Set screen resolution only. Return true if successful.
  79. bool SetMode(int width, int height);
  80. /// Toggle between full screen and windowed mode.
  81. bool ToggleFullscreen();
  82. /// Close the window.
  83. void Close();
  84. /// Take a screenshot.
  85. bool TakeScreenShot(Image& destImage);
  86. /// Begin frame rendering. Return true if device available and can render.
  87. bool BeginFrame();
  88. /// End frame rendering and swap buffers.
  89. void EndFrame();
  90. /// Clear any or all of rendertarget, depth buffer and stencil buffer.
  91. void Clear(unsigned flags, const Color& color = Color(0.0f, 0.0f, 0.0f, 0.0f), float depth = 1.0f, unsigned stencil = 0);
  92. /// Resolve multisampled backbuffer to a texture rendertarget.
  93. bool ResolveToTexture(Texture2D* destination, const IntRect& viewport);
  94. /// Draw non-indexed geometry.
  95. void Draw(PrimitiveType type, unsigned vertexStart, unsigned vertexCount);
  96. /// Draw indexed geometry.
  97. void Draw(PrimitiveType type, unsigned indexStart, unsigned indexCount, unsigned minVertex, unsigned vertexCount);
  98. /// Draw indexed, instanced geometry. No-op on OpenGL.
  99. void DrawInstanced(PrimitiveType type, unsigned indexStart, unsigned indexCount, unsigned minVertex, unsigned vertexCount, unsigned instanceCount);
  100. /// Set vertex buffer.
  101. void SetVertexBuffer(VertexBuffer* buffer);
  102. /// Set multiple vertex buffers.
  103. bool SetVertexBuffers(const Vector<VertexBuffer*>& buffers, const PODVector<unsigned>& elementMasks, unsigned instanceOffset = 0);
  104. /// Set multiple vertex buffers.
  105. bool SetVertexBuffers(const Vector<SharedPtr<VertexBuffer> >& buffers, const PODVector<unsigned>& elementMasks, unsigned instanceOffset = 0);
  106. /// Set index buffer.
  107. void SetIndexBuffer(IndexBuffer* buffer);
  108. /// Set shaders.
  109. void SetShaders(ShaderVariation* vs, ShaderVariation* ps);
  110. /// Set shader float constants.
  111. void SetShaderParameter(StringHash param, const float* data, unsigned count);
  112. /// Set shader float constant.
  113. void SetShaderParameter(StringHash param, float value);
  114. /// Set shader color constant.
  115. void SetShaderParameter(StringHash param, const Color& color);
  116. /// Set shader 3x3 matrix constant.
  117. void SetShaderParameter(StringHash param, const Matrix3& matrix);
  118. /// Set shader 3D vector constant.
  119. void SetShaderParameter(StringHash param, const Vector3& vector);
  120. /// Set shader 4x4 matrix constant.
  121. void SetShaderParameter(StringHash param, const Matrix4& matrix);
  122. /// Set shader 4D vector constant.
  123. void SetShaderParameter(StringHash param, const Vector4& vector);
  124. /// Set shader 4x3 matrix constant.
  125. void SetShaderParameter(StringHash param, const Matrix3x4& matrix);
  126. /// Check whether a shader parameter group needs update. Does not actually check whether parameters exist in the shaders.
  127. bool NeedParameterUpdate(ShaderParameterGroup group, const void* source);
  128. /// Check whether a shader parameter exists on the currently set shaders.
  129. bool HasShaderParameter(ShaderType type, StringHash param);
  130. /// Check whether the current pixel shader uses a texture unit.
  131. bool HasTextureUnit(TextureUnit unit);
  132. /// Clear remembered shader parameter source group.
  133. void ClearParameterSource(ShaderParameterGroup group);
  134. /// Clear remembered shader parameter sources.
  135. void ClearParameterSources();
  136. /// Clear remembered transform shader parameter sources.
  137. void ClearTransformSources();
  138. /// Clean up unused shader programs.
  139. void CleanupShaderPrograms();
  140. /// Set texture.
  141. void SetTexture(unsigned index, Texture* texture);
  142. /// Bind texture unit 0 for update. Called by Texture.
  143. void SetTextureForUpdate(Texture* texture);
  144. /// Set default texture filtering mode.
  145. void SetDefaultTextureFilterMode(TextureFilterMode mode);
  146. /// Set texture anisotropy.
  147. void SetTextureAnisotropy(unsigned level);
  148. /// Dirty texture parameters of all textures (when global settings change.)
  149. void SetTextureParametersDirty();
  150. /// Reset all rendertargets, depth-stencil surface and viewport.
  151. void ResetRenderTargets();
  152. /// Reset specific rendertarget.
  153. void ResetRenderTarget(unsigned index);
  154. /// Reset depth-stencil surface.
  155. void ResetDepthStencil();
  156. /// Set rendertarget.
  157. void SetRenderTarget(unsigned index, RenderSurface* renderTarget);
  158. /// Set rendertarget.
  159. void SetRenderTarget(unsigned index, Texture2D* texture);
  160. /// Set depth-stencil surface.
  161. void SetDepthStencil(RenderSurface* depthStencil);
  162. /// Set depth-stencil surface.
  163. void SetDepthStencil(Texture2D* texture);
  164. /// %Set view texture (deferred rendering final output rendertarget) to prevent it from being sampled.
  165. void SetViewTexture(Texture* texture);
  166. /// Set viewport.
  167. void SetViewport(const IntRect& rect);
  168. /// Set blending mode.
  169. void SetBlendMode(BlendMode mode);
  170. /// Set color write on/off.
  171. void SetColorWrite(bool enable);
  172. /// Set hardware culling mode.
  173. void SetCullMode(CullMode mode);
  174. /// Set depth bias.
  175. void SetDepthBias(float constantBias, float slopeScaledBias);
  176. /// Set depth compare.
  177. void SetDepthTest(CompareMode mode);
  178. /// Set depth write on/off.
  179. void SetDepthWrite(bool enable);
  180. /// Set scissor test.
  181. void SetScissorTest(bool enable, const Rect& rect = Rect::FULL, bool borderInclusive = true);
  182. /// Set scissor test.
  183. void SetScissorTest(bool enable, const IntRect& rect);
  184. /// Set stencil test.
  185. void SetStencilTest(bool enable, CompareMode mode = CMP_ALWAYS, StencilOp pass = OP_KEEP, StencilOp fail = OP_KEEP, StencilOp zFail = OP_KEEP, unsigned stencilRef = 0, unsigned compareMask = M_MAX_UNSIGNED, unsigned writeMask = M_MAX_UNSIGNED);
  186. /// Set vertex buffer stream frequency. No-op on OpenGL.
  187. void SetStreamFrequency(unsigned index, unsigned frequency);
  188. /// Reset stream frequencies. No-op on OpenGL.
  189. void ResetStreamFrequencies();
  190. /// Set force Shader Model 2 flag. No effect on OpenGL.
  191. void SetForceSM2(bool enable);
  192. /// Return whether rendering initialized.
  193. bool IsInitialized() const;
  194. /// Return graphics implementation, which holds the actual API-specific resources.
  195. GraphicsImpl* GetImpl() const { return impl_; }
  196. /// Return window title.
  197. const String& GetWindowTitle() const { return windowTitle_; }
  198. /// Return window width.
  199. int GetWidth() const { return width_; }
  200. /// Return window height.
  201. int GetHeight() const { return height_; }
  202. /// Return multisample mode (1 = no multisampling.)
  203. int GetMultiSample() const { return multiSample_; }
  204. /// Return whether window is fullscreen.
  205. bool GetFullscreen() const { return fullscreen_; }
  206. /// Return whether vertical sync is on.
  207. bool GetVSync() const { return vsync_; }
  208. /// Return whether triple buffering is enabled.
  209. bool GetTripleBuffer() const { return tripleBuffer_; }
  210. /// Return whether device is lost, and can not yet render.
  211. bool IsDeviceLost() const;
  212. /// Return number of primitives drawn this frame.
  213. unsigned GetNumPrimitives() const { return numPrimitives_; }
  214. /// Return number of batches drawn this frame.
  215. unsigned GetNumBatches() const { return numBatches_; }
  216. /// Return dummy color texture format for shadow maps.
  217. unsigned GetDummyColorFormat() const { return 0; }
  218. /// Return shadow map depth texture format, or 0 if not supported.
  219. unsigned GetShadowMapFormat() const { return shadowMapFormat_; }
  220. /// Return 24-bit shadow map depth texture format, or 0 if not supported.
  221. unsigned GetHiresShadowMapFormat() const { return hiresShadowMapFormat_; }
  222. /// Return whether Shader Model 3 is supported. Always false on OpenGL.
  223. bool GetSM3Support() const { return false; }
  224. /// Return whether light pre-pass rendering is supported.
  225. bool GetLightPrepassSupport() const { return lightPrepassSupport_; }
  226. /// Return whether deferred rendering is supported.
  227. bool GetDeferredSupport() const { return deferredSupport_; }
  228. /// Return whether hardware depth texture is supported. On OpenGL ES this means the depth texture extension.
  229. bool GetHardwareDepthSupport() const { return hardwareDepthSupport_; }
  230. /// Return whether shadow map depth compare is done in hardware. Always true on OpenGL.
  231. bool GetHardwareShadowSupport() const { return true; }
  232. /// Return whether 24-bit shadow maps are supported. Assume true on OpenGL.
  233. bool GetHiresShadowSupport() const { return true; }
  234. /// Return whether stream offset is supported. Always false on OpenGL.
  235. bool GetStreamOffsetSupport() const { return false; }
  236. /// Return whether DXT texture compression is supported.
  237. bool GetCompressedTextureSupport() const { return compressedTextureSupport_; }
  238. /// Return supported fullscreen resolutions.
  239. PODVector<IntVector2> GetResolutions() const;
  240. /// Return supported multisampling levels.
  241. PODVector<int> GetMultiSampleLevels() const;
  242. /// Return vertex buffer by index.
  243. VertexBuffer* GetVertexBuffer(unsigned index) const;
  244. /// Return index buffer.
  245. IndexBuffer* GetIndexBuffer() const { return indexBuffer_; }
  246. /// Return vertex shader.
  247. ShaderVariation* GetVertexShader() const { return vertexShader_; }
  248. /// Return pixel shader.
  249. ShaderVariation* GetPixelShader() const { return pixelShader_; }
  250. /// Return shader program.
  251. ShaderProgram* GetShaderProgram() const { return shaderProgram_; }
  252. /// Return texture unit index by name.
  253. TextureUnit GetTextureUnit(const String& name);
  254. /// Return texture unit name by index.
  255. const String& GetTextureUnitName(TextureUnit unit);
  256. /// Return texture by texture unit index.
  257. Texture* GetTexture(unsigned index) const;
  258. /// Return default texture filtering mode.
  259. TextureFilterMode GetDefaultTextureFilterMode() const { return defaultTextureFilterMode_; }
  260. /// Return rendertarget by index.
  261. RenderSurface* GetRenderTarget(unsigned index) const;
  262. /// Return depth-stencil surface.
  263. RenderSurface* GetDepthStencil() const { return depthStencil_; }
  264. /// Return readable depth-stencil texture. Not created automatically on OpenGL.
  265. Texture2D* GetDepthTexture() const { return 0; }
  266. /// Return the viewport coordinates.
  267. IntRect GetViewport() const { return viewport_; }
  268. /// Return texture anisotropy.
  269. unsigned GetTextureAnisotropy() const { return textureAnisotropy_; }
  270. /// Return blending mode.
  271. BlendMode GetBlendMode() const { return blendMode_; }
  272. /// Return whether color write is enabled.
  273. bool GetColorWrite() const { return colorWrite_; }
  274. /// Return hardware culling mode.
  275. CullMode GetCullMode() const { return cullMode_; }
  276. /// Return depth constant bias.
  277. float GetDepthConstantBias() const { return constantDepthBias_; }
  278. /// Return depth slope scaled bias.
  279. float GetDepthSlopeScaledBias() const { return slopeScaledDepthBias_; }
  280. /// Return depth compare mode.
  281. CompareMode GetDepthTest() const { return depthTestMode_; }
  282. /// Return whether depth write is enabled.
  283. bool GetDepthWrite() const { return depthWrite_; }
  284. /// Return whether stencil test is enabled.
  285. bool GetStencilTest() const { return stencilTest_; }
  286. /// Return whether scissor test is enabled.
  287. bool GetScissorTest() const { return scissorTest_; }
  288. /// Return scissor rectangle coordinates.
  289. const IntRect& GetScissorRect() const { return scissorRect_; }
  290. /// Return stencil compare mode.
  291. CompareMode GetStencilTestMode() const { return stencilTestMode_; }
  292. /// Return stencil operation to do if stencil test passes.
  293. StencilOp GetStencilPass() const { return stencilPass_; }
  294. /// Return stencil operation to do if stencil test fails.
  295. StencilOp GetStencilFail() const { return stencilFail_; }
  296. /// Return stencil operation to do if depth compare fails.
  297. StencilOp GetStencilZFail() const { return stencilZFail_; }
  298. /// Return stencil reference value.
  299. unsigned GetStencilRef() const { return stencilRef_; }
  300. /// Return stencil compare bitmask.
  301. unsigned GetStencilCompareMask() const { return stencilCompareMask_; }
  302. /// Return stencil write bitmask.
  303. unsigned GetStencilWriteMask() const { return stencilWriteMask_; }
  304. /// Return stream frequency by vertex buffer index. Always returns 0 on OpenGL.
  305. unsigned GetStreamFrequency(unsigned index) const { return 0; }
  306. /// Return rendertarget width and height.
  307. IntVector2 GetRenderTargetDimensions() const;
  308. /// Return force Shader Model 2 flag. Always false on OpenGL.
  309. bool GetForceSM2() const { return false; }
  310. /// Add a GPU object to keep track of. Called by GPUObject.
  311. void AddGPUObject(GPUObject* object);
  312. /// Remove a GPU object. Called by GPUObject.
  313. void RemoveGPUObject(GPUObject* object);
  314. /// Reserve a CPU-side scratch buffer.
  315. void* ReserveScratchBuffer(unsigned size);
  316. /// Free a CPU-side scratch buffer.
  317. void FreeScratchBuffer(void* buffer);
  318. /// Release/clear GPU objects and optionally close the window.
  319. void Release(bool clearGPUObjects, bool closeWindow);
  320. /// Restore GPU objects and reinitialize state. Requires an open window.
  321. void Restore();
  322. /// Clean up a render surface from all FBOs.
  323. void CleanupRenderSurface(RenderSurface* surface);
  324. /// Return the API-specific alpha texture format.
  325. static unsigned GetAlphaFormat();
  326. /// Return the API-specific luminance texture format.
  327. static unsigned GetLuminanceFormat();
  328. /// Return the API-specific luminance alpha texture format.
  329. static unsigned GetLuminanceAlphaFormat();
  330. /// Return the API-specific RGB texture format.
  331. static unsigned GetRGBFormat();
  332. /// Return the API-specific RGBA texture format.
  333. static unsigned GetRGBAFormat();
  334. /// Return the API-specific single channel float texture format.
  335. static unsigned GetFloatFormat();
  336. /// Return the API-specific linear depth texture format.
  337. static unsigned GetLinearDepthFormat();
  338. /// Return the API-specific hardware depth-stencil texture format.
  339. static unsigned GetDepthStencilFormat();
  340. private:
  341. /// Check supported rendering features.
  342. void CheckFeatureSupport();
  343. /// Select FBO and commit changes.
  344. void CommitFramebuffer();
  345. /// Check FBO completeness.
  346. bool CheckFramebuffer();
  347. /// Cleanup unused and unbound FBO's.
  348. void CleanupFramebuffers(bool contextLost);
  349. /// Reset cached rendering state.
  350. void ResetCachedState();
  351. /// Initialize texture unit mappings.
  352. void SetTextureUnitMappings();
  353. /// Implementation.
  354. GraphicsImpl* impl_;
  355. /// Window title.
  356. String windowTitle_;
  357. /// Window width.
  358. int width_;
  359. /// Window height.
  360. int height_;
  361. /// Multisampling mode.
  362. int multiSample_;
  363. /// Fullscreen flag.
  364. bool fullscreen_;
  365. /// Vertical sync flag.
  366. bool vsync_;
  367. /// Triple buffering flag.
  368. bool tripleBuffer_;
  369. /// Light prepass support flag.
  370. bool lightPrepassSupport_;
  371. /// Deferred rendering support flag.
  372. bool deferredSupport_;
  373. /// Hardware depth support flag.
  374. bool hardwareDepthSupport_;
  375. /// Compressed texture support flag.
  376. bool compressedTextureSupport_;
  377. /// Number of primitives this frame.
  378. unsigned numPrimitives_;
  379. /// Number of batches this frame.
  380. unsigned numBatches_;
  381. /// GPU objects.
  382. Vector<GPUObject*> gpuObjects_;
  383. /// Scratch buffers.
  384. Vector<ScratchBuffer> scratchBuffers_;
  385. /// Shadow map depth texture format.
  386. unsigned shadowMapFormat_;
  387. /// Shadow map 24-bit depth texture format.
  388. unsigned hiresShadowMapFormat_;
  389. /// Vertex buffers in use.
  390. VertexBuffer* vertexBuffers_[MAX_VERTEX_STREAMS];
  391. /// Element mask in use.
  392. unsigned elementMasks_[MAX_VERTEX_STREAMS];
  393. /// Index buffer in use.
  394. IndexBuffer* indexBuffer_;
  395. /// Vertex shader in use.
  396. ShaderVariation* vertexShader_;
  397. /// Pixel shader in use.
  398. ShaderVariation* pixelShader_;
  399. /// Shader program in use.
  400. ShaderProgram* shaderProgram_;
  401. /// Linked shader programs.
  402. ShaderProgramMap shaderPrograms_;
  403. /// Shader parameters global frame number.
  404. unsigned shaderParameterFrame_;
  405. /// Textures in use.
  406. Texture* textures_[MAX_TEXTURE_UNITS];
  407. /// OpenGL texture types in use.
  408. unsigned textureTypes_[MAX_TEXTURE_UNITS];
  409. /// Texture unit mappings.
  410. Map<String, TextureUnit> textureUnits_;
  411. /// Rendertargets in use.
  412. RenderSurface* renderTargets_[MAX_RENDERTARGETS];
  413. /// Depth-stencil surface in use.
  414. RenderSurface* depthStencil_;
  415. /// View texture.
  416. Texture* viewTexture_;
  417. /// Viewport coordinates.
  418. IntRect viewport_;
  419. /// Texture anisotropy level.
  420. unsigned textureAnisotropy_;
  421. /// Blending mode.
  422. BlendMode blendMode_;
  423. /// Color write enable.
  424. bool colorWrite_;
  425. /// Hardware culling mode.
  426. CullMode cullMode_;
  427. /// Depth constant bias.
  428. float constantDepthBias_;
  429. /// Depth slope scaled bias.
  430. float slopeScaledDepthBias_;
  431. /// Depth compare mode.
  432. CompareMode depthTestMode_;
  433. /// Depth write enable flag.
  434. bool depthWrite_;
  435. /// Scissor test rectangle.
  436. IntRect scissorRect_;
  437. /// Scissor test enable flag.
  438. bool scissorTest_;
  439. /// Stencil test compare mode.
  440. CompareMode stencilTestMode_;
  441. /// Stencil operation on pass.
  442. StencilOp stencilPass_;
  443. /// Stencil operation on fail.
  444. StencilOp stencilFail_;
  445. /// Stencil operation on depth fail.
  446. StencilOp stencilZFail_;
  447. /// Stencil test enable flag.
  448. bool stencilTest_;
  449. /// Stencil test reference value.
  450. unsigned stencilRef_;
  451. /// Stencil compare bitmask.
  452. unsigned stencilCompareMask_;
  453. /// Stencil write bitmask.
  454. unsigned stencilWriteMask_;
  455. /// Default texture filtering mode.
  456. TextureFilterMode defaultTextureFilterMode_;
  457. /// Map for additional depth textures, to emulate Direct3D9 ability to mix render texture and backbuffer rendering.
  458. HashMap<int, SharedPtr<Texture2D> > depthTextures_;
  459. /// Remembered shader parameter sources.
  460. const void* shaderParameterSources_[MAX_SHADER_PARAMETER_GROUPS];
  461. /// Temp matrices for transposing shader parameters.
  462. Matrix3 tempMatrices3_[NUM_TEMP_MATRICES];
  463. /// Temp matrices for transposing shader parameters.
  464. Matrix4 tempMatrices4_[NUM_TEMP_MATRICES];
  465. };
  466. /// Register Graphics library objects.
  467. void RegisterGraphicsLibrary(Context* context_);