CmRenderOperation.h 3.1 KB

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