CmRenderOperation.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. #pragma once
  25. #include "CmPrerequisites.h"
  26. #include "CmVertexDeclaration.h"
  27. #include "CmVertexData.h"
  28. #include "CmIndexData.h"
  29. namespace CamelotFramework
  30. {
  31. /// The rendering operation type to perform
  32. enum DrawOperationType {
  33. /// A list of points, 1 vertex per point
  34. DOT_POINT_LIST = 1,
  35. /// A list of lines, 2 vertices per line
  36. DOT_LINE_LIST = 2,
  37. /// A strip of connected lines, 1 vertex per line plus 1 start vertex
  38. DOT_LINE_STRIP = 3,
  39. /// A list of triangles, 3 vertices per triangle
  40. DOT_TRIANGLE_LIST = 4,
  41. /// A strip of triangles, 3 vertices for the first triangle, and 1 per triangle after that
  42. DOT_TRIANGLE_STRIP = 5,
  43. /// A fan of triangles, 3 vertices for the first triangle, and 1 per triangle after that
  44. DOT_TRIANGLE_FAN = 6
  45. };
  46. /** \addtogroup Core
  47. * @{
  48. */
  49. /** \addtogroup RenderSystem
  50. * @{
  51. */
  52. /** Rendering command that is used for rendering of a single object
  53. using a single pass */
  54. class RenderOperation
  55. {
  56. public:
  57. /// Vertex source data
  58. VertexData *vertexData;
  59. /// The type of operation to perform
  60. DrawOperationType operationType;
  61. /** Specifies whether to use indexes to determine the vertices to use as input. If false, the vertices are
  62. simply read in sequence to define the primitives. If true, indexes are used instead to identify vertices
  63. anywhere in the buffer, and allowing vertices to be used more than once.
  64. If true, then the indexBuffer, indexStart and numIndexes properties must be valid. */
  65. bool useIndexes;
  66. /// Index data - only valid if useIndexes is true
  67. IndexData *indexData;
  68. RenderOperation() :
  69. vertexData(0), operationType(DOT_TRIANGLE_LIST), useIndexes(true),
  70. indexData(0) {}
  71. };
  72. /** @} */
  73. /** @} */
  74. }