Harmonic Flow Framework (libhffwk)
Cross platform C++ 2D Game Engine Framework
Geometry.h
Go to the documentation of this file.
1 /*
2  Harmonic Flow Framework
3  Copyright (C) 2011-2018 Andreas Widen <andreas@harmonicflow.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #pragma once
22 
23 /** @file
24  * @brief Interface useful when rendering custom Geometry.
25  */
26 
27 #include "debug/CrtDbgInc.h"
28 #include "HFDataTypes.h"
29 #include <glm/vec2.hpp> // glm::vec2
30 #include <glm/vec3.hpp> // glm::vec3
31 
32 #include "Shader.h"
33 #include "Graphics.h"
34 
35 #include <vector>
36 
37 namespace HFCore
38 {
39  /**
40  * @brief Interface useful when rendering custom Geometry.
41  *
42  * Custom Geometry gives you full control of the rendering and you can
43  * render pretty much anything this way such as primitives or textures
44  * etc. It can be used to render 3D.
45  *
46  * Example code:
47  * @code
48  * // create Geometry:
49  * HFCore::Geometry *triangle =
50  * HFCORE_ENV->createGeometry(HFCore::Geometry::VERTEX_TYPE_POSCOL,
51  * HF_BUFFER_USAGE_STATIC, 3);
52  * assert(triangle != NULL);
53  *
54  * // Set the 3 vertices needed:
55  * triangle->setVertexPosCol(0, x0, y0, 0, HFCore::Color::getColorWhite());
56  * triangle->setVertexPosCol(1, x1, y1, 0, HFCore::Color::getColorWhite());
57  * triangle->setVertexPosCol(2, x2, y2, 0, HFCore::Color::getColorWhite());
58  *
59  * // Set Shader to use:
60  * triangle->setShader(someShader);
61  *
62  * // Let's render the triangle:
63  * g->drawGeometryArrays(triangle, 0, 3,
64  * HFCore::Graphics::RENDERTYPE_TRIANGLES);
65  *
66  * // when done, remember to delete:
67  * HF_SAFE_DELETE(triangle);
68  * @endcode
69  */
70  class Geometry
71  {
72  public:
73  /**
74  * @brief Enum holding custom vertex data type.
75  *
76  * Geometry::VERTEX_DATA_TYPE_COLORU32 is defined as
77  * uint32_hf and packed format is GL: RGBA, D3D9: BGRA/ARGB. See
78  * HFCore::Color::getVertexColorLE() for more information.
79  *
80  * @see HFCore::Color::getVertexColorLE()
81  */
82  typedef enum VertexDataType
83  {
84  VERTEX_DATA_TYPE_NOTSET = -1, ///< Vertex data type: Not set.
85  VERTEX_DATA_TYPE_FLOAT1 = 0, ///< Vertex data type: float.
86  VERTEX_DATA_TYPE_FLOAT2, ///< Vertex data type: glm::vec2.
87  VERTEX_DATA_TYPE_FLOAT3, ///< Vertex data type: glm::vec3.
88  VERTEX_DATA_TYPE_FLOAT4, ///< Vertex data type: glm::vec4.
89  VERTEX_DATA_TYPE_COLORU32, ///< Vertex data type: uint32_hf.
90  VERTEX_DATA_TYPE_UBYTE4 ///< Vertex data type: Four-component, unsigned byte.
92 
93  /**
94  * @brief Enum holding custom vertex usage type.
95  *
96  * @note These enum values are for Direct3D specifically and will
97  * be discarded in OpenGL but make sure to set these correctly
98  * for good cross platform support.
99  */
100  typedef enum VertexUsageType
101  {
102  VERTEX_USAGE_TYPE_NOTSET = -1, ///< Vertex usage type: Not set.
103  VERTEX_USAGE_TYPE_POSITION = 0, ///< Vertex usage type: Position.
104  VERTEX_USAGE_TYPE_COLOR, ///< Vertex usage type: Color.
105  VERTEX_USAGE_TYPE_COLOR_SPECULAR, ///< Vertex usage type: Color Specular.
106  VERTEX_USAGE_TYPE_TEXCOORD, ///< Vertex usage type: Texture UV coords.
107  VERTEX_USAGE_TYPE_NORMAL, ///< Vertex usage type: Normal.
108  VERTEX_USAGE_TYPE_TANGENT, ///< Vertex usage type: Tangent.
109  VERTEX_USAGE_TYPE_BLENDWEIGHT, ///< Vertex usage type: Blending weight data.
110  VERTEX_USAGE_TYPE_BLENDINDICES ///< Vertex usage type: Blending indices data.
111  } VertexUsageType;
112 
113  /**
114  * @brief Struct holding custom vertex attributes.
115  */
116  typedef struct VertexAttribute
117  {
118  std::string shaderAttribName; ///< Shader attribute name (must be set for GLSL).
119  VertexDataType vertexDataType; ///< Vertex data type.
120  VertexUsageType vertexUsageType; ///< Vertex usage type (must be set for HLSL).
121  uint32_hf offsetBytes; ///< Offset in bytes between vertex attributes.
122  bool normalized; ///< Determine whether data-value be normalized.
123  } VertexAttribute;
124 
125  /**
126  * @brief Struct holding vertex position and color.
127  */
128  typedef struct VertexPosCol
129  {
130  glm::vec3 position; ///< Vertex position.
131  uint32_hf color; ///< Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
132 
133  /**
134  * @brief Overload of binary operator ==.
135  *
136  * This operator compares strict equality between two
137  * Geometry::VertexPosCol structs.
138  *
139  * @param other VertexPosCol to compare against this.
140  *
141  * @return true if equal, else false.
142  */
143  bool operator==(const VertexPosCol &other) const
144  {
145  return (position == other.position &&
146  color == other.color);
147  }
148  } VertexPosCol;
149 
150  /**
151  * @brief Struct holding vertex position and texture UV coords.
152  */
153  typedef struct VertexPosTex
154  {
155  glm::vec3 position; ///< Vertex position.
156  glm::vec2 uv; ///< Vertex texture uv coords.
157 
158  /**
159  * @brief Overload of binary operator ==.
160  *
161  * This operator compares strict equality between two
162  * Geometry::VertexPosTex structs.
163  *
164  * @param other VertexPosTex to compare against this.
165  *
166  * @return true if equal, else false.
167  */
168  bool operator==(const VertexPosTex &other) const
169  {
170  return (position == other.position &&
171  uv == other.uv);
172  }
173  } VertexPosTex;
174 
175  /**
176  * @brief Struct holding vertex position, color and texture UV
177  * coords.
178  */
179  typedef struct VertexPosColTex
180  {
181  glm::vec3 position; ///< Vertex position.
182  uint32_hf color; ///< Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
183  glm::vec2 uv; ///< Vertex texture uv coords.
184 
185  /**
186  * @brief Overload of binary operator ==.
187  *
188  * This operator compares strict equality between two
189  * Geometry::VertexPosColTex structs.
190  *
191  * @param other VertexPosColTex to compare against this.
192  *
193  * @return true if equal, else false.
194  */
195  bool operator==(const VertexPosColTex &other) const
196  {
197  return (position == other.position &&
198  color == other.color &&
199  uv == other.uv);
200  }
201  } VertexPosColTex;
202 
203  /**
204  * @brief Struct holding vertex position, color and normal.
205  */
206  typedef struct VertexPosColNor
207  {
208  glm::vec3 position; ///< Vertex position.
209  uint32_hf color; ///< Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
210  glm::vec3 normal; ///< Vertex normal.
211 
212  /**
213  * @brief Overload of binary operator ==.
214  *
215  * This operator compares strict equality between two
216  * Geometry::VertexPosColNor structs.
217  *
218  * @param other VertexPosColNor to compare against this.
219  *
220  * @return true if equal, else false.
221  */
222  bool operator==(const VertexPosColNor &other) const
223  {
224  return (position == other.position &&
225  color == other.color &&
226  normal == other.normal);
227  }
228  } VertexPosColNor;
229 
230  /**
231  * @brief Struct holding vertex position, normal and texture UV
232  * coords.
233  */
234  typedef struct VertexPosNorTex
235  {
236  glm::vec3 position; ///< Vertex position.
237  glm::vec3 normal; ///< Vertex normal.
238  glm::vec2 uv; ///< Vertex texture uv coords.
239 
240  /**
241  * @brief Overload of binary operator ==.
242  *
243  * This operator compares strict equality between two
244  * Geometry::VertexPosNorTex structs.
245  *
246  * @param other VertexPosNorTex to compare against this.
247  *
248  * @return true if equal, else false.
249  */
250  bool operator==(const VertexPosNorTex &other) const
251  {
252  return (position == other.position &&
253  normal == other.normal &&
254  uv == other.uv);
255  }
256  } VertexPosNorTex;
257 
258  /**
259  * @brief Struct holding vertex position, color, normal and
260  * texture UV coords.
261  */
262  typedef struct VertexPosColNorTex
263  {
264  glm::vec3 position; ///< Vertex position.
265  uint32_hf color; ///< Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
266  glm::vec3 normal; ///< Vertex normal.
267  glm::vec2 uv; ///< Vertex texture uv coords.
268 
269  /**
270  * @brief Overload of binary operator ==.
271  *
272  * This operator compares strict equality between two
273  * Geometry::VertexPosColNorTex structs.
274  *
275  * @param other VertexPosColNorTex to compare against this.
276  *
277  * @return true if equal, else false.
278  */
279  bool operator==(const VertexPosColNorTex &other) const
280  {
281  return (position == other.position &&
282  color == other.color &&
283  normal == other.normal &&
284  uv == other.uv);
285  }
287 
288  /**
289  * @brief Struct holding shader attribute names (needed for GLSL
290  * if default values needs to be changed).
291  *
292  * Default names are set to:
293  * @code
294  * mShaderAttrNames.position = "in_Position";
295  * mShaderAttrNames.color = "in_Color";
296  * mShaderAttrNames.normal = "in_Normal";
297  * mShaderAttrNames.uv = "in_UV";
298  * @endcode
299  */
300  typedef struct ShaderAttribNames
301  {
302  std::string position; ///< Shader attribute name for: position.
303  std::string color; ///< Shader attribute name for: color.
304  std::string normal; ///< Shader attribute name for: normal.
305  std::string uv; ///< Shader attribute name for: uv.
307 
308  /**
309  * @brief Struct holding texture and Shader uniform parameter
310  * name.
311  */
312  typedef struct Texture
313  {
314  Image *image; ///< Pointer to Image.
315  std::string shaderParamName; ///< Shader uniform parameter name.
316  } Texture;
317 
318  /**
319  * @brief Vertex type enum.
320  */
321  typedef enum VertexType
322  {
323  VERTEX_TYPE_NOTSET = -1, ///< Vertex type: Not set.
324  VERTEX_TYPE_CUSTOM = 0, ///< Vertex type: Custom.
325  VERTEX_TYPE_POSCOL, ///< Vertex type: Position and color.
326  VERTEX_TYPE_POSTEX, ///< Vertex type: Position and texture uv.
327  VERTEX_TYPE_POSCOLTEX, ///< Vertex type: Position, color and texture uv.
328  VERTEX_TYPE_POSCOLNOR, ///< Vertex type: Position, color and normal.
329  VERTEX_TYPE_POSNORTEX, ///< Vertex type: Position, normal and texture uv.
330  VERTEX_TYPE_POSCOLNORTEX ///< Vertex type: Position, color, normal and texture uv.
331  } VertexType;
332 
333  /**
334  * @brief Index type enum.
335  */
336  typedef enum IndexType
337  {
338  INDEX_TYPE_NOTSET = -1, ///< Index type: Not set.
339  INDEX_TYPE_U16 = 0, ///< Index type: uint16_hf.
340  INDEX_TYPE_U32 ///< Index type: uint32_hf.
341  } IndexType;
342 
343  /**
344  * @brief typedef for Vector holding VertexPosCol struct.
345  */
346  typedef std::vector<VertexPosCol> VertexPosColVector;
347 
348  /**
349  * @brief typedef for Vector holding VertexPosTex struct.
350  */
351  typedef std::vector<VertexPosTex> VertexPosTexVector;
352 
353  /**
354  * @brief typedef for Vector holding VertexPosColTex struct.
355  */
356  typedef std::vector<VertexPosColTex> VertexPosColTexVector;
357 
358  /**
359  * @brief typedef for Vector holding VertexPosColNor struct.
360  */
361  typedef std::vector<VertexPosColNor> VertexPosColNorVector;
362 
363  /**
364  * @brief typedef for Vector holding VertexPosNorTex struct.
365  */
366  typedef std::vector<VertexPosNorTex> VertexPosNorTexVector;
367 
368  /**
369  * @brief typedef for Vector holding VertexPosColNorTex struct.
370  */
371  typedef std::vector<VertexPosColNorTex> VertexPosColNorTexVector;
372 
373  /**
374  * @brief typedef for Vector holding Texture struct.
375  */
376  typedef std::vector<Texture> VertexTextureVector;
377 
378  /**
379  * @brief typedef for Vector holding vertex indices as uint32_hf.
380  */
381  typedef std::vector<uint32_hf> VertexIndicesU32Vector;
382 
383  /**
384  * @brief typedef for Vector holding vertex indices as uint16_hf.
385  */
386  typedef std::vector<uint16_hf> VertexIndicesU16Vector;
387 
388  /**
389  * @brief typedef for Vector holding custom vertex attributes.
390  */
391  typedef std::vector<VertexAttribute> VertexAttributeVector;
392 
393  /**
394  * @brief Constructor.
395  *
396  * @param vertexType Geometry::VertexType enum.
397  * @param bufferUsage HF_BufferUsage enum.
398  * @param bufferSize Number of vector elements except for
399  * Geometry::VERTEX_TYPE_CUSTOM where bufferSize should be
400  * in bytes.
401  */
403  HF_BufferUsage bufferUsage,
404  uint32_hf bufferSize) {}
405 
406  /**
407  * @brief Constructor.
408  *
409  * @param bufferUsage HF_BufferUsage enum.
410  * @param vertexPosCol Geometry::VertexPosColVector vector.
411  */
413  VertexPosColVector *vertexPosCol) {}
414 
415  /**
416  * @brief Constructor.
417  *
418  * @param bufferUsage HF_BufferUsage enum.
419  * @param vertexPosTex Geometry::VertexPosTexVector vector.
420  * @param vertexTextures Geometry::VertexTextureVector vector.
421  */
423  VertexPosTexVector *vertexPosTex,
424  VertexTextureVector *vertexTextures = NULL) {}
425 
426  /**
427  * @brief Constructor.
428  *
429  * @param bufferUsage HF_BufferUsage enum.
430  * @param vertexPosColTex Geometry::VertexPosColTexVector vector.
431  * @param vertexTextures Geometry::VertexTextureVector vector.
432  */
434  VertexPosColTexVector *vertexPosColTex,
435  VertexTextureVector *vertexTextures = NULL) {}
436 
437  /**
438  * @brief Constructor.
439  *
440  * @param bufferUsage HF_BufferUsage enum.
441  * @param vertexPosColNor Geometry::VertexPosColNorVector vector.
442  */
444  VertexPosColNorVector *vertexPosColNor) {}
445 
446  /**
447  * @brief Constructor.
448  *
449  * @param bufferUsage HF_BufferUsage enum.
450  * @param vertexPosNorTex Geometry::VertexPosNorTexVector vector.
451  * @param vertexTextures Geometry::VertexTextureVector vector.
452  */
454  VertexPosNorTexVector *vertexPosNorTex,
455  VertexTextureVector *vertexTextures = NULL) {}
456 
457  /**
458  * @brief Constructor.
459  *
460  * @param bufferUsage HF_BufferUsage enum.
461  * @param vertexPosColNorTex
462  * Geometry::VertexPosColNorTexVector vector.
463  * @param vertexTextures Geometry::VertexTextureVector vector.
464  */
466  VertexPosColNorTexVector *vertexPosColNorTex,
467  VertexTextureVector *vertexTextures = NULL) {}
468 
469  /**
470  * @brief Constructor.
471  *
472  * @param bufferUsage HF_BufferUsage enum.
473  * @param vertexAttribVector Geometry::VertexAttributeVector.
474  * @param data Pointer to vertex data.
475  * @param numVertices Number of vertices.
476  * @param dataSizeBytes Size of data in bytes.
477  */
479  VertexAttributeVector *vertexAttribVector,
480  void *data, uint32_hf numVertices,
481  uint32_hf dataSizeBytes) {}
482 
483  /**
484  * @brief Destructor.
485  */
486  virtual ~Geometry() {}
487 
488  /**
489  * @brief Set Geometry::ShaderAttribNames names.
490  *
491  * This method is useful for OpenGL GLSL if you want to change
492  * default Shader attribute names. These values are not
493  * considered in Direct3D9 HLSL as input values are set
494  * differently in HLSL.
495  *
496  * Default values are set to:
497  * @code
498  * HFCore::Geometry::ShaderAttribNames names;
499  * names.position = "in_Position";
500  * names.color = "in_Color";
501  * names.normal = "in_Normal";
502  * names.uv = "in_UV";
503  * @endcode
504  *
505  * To use default values, set the following in OpenGL GLSL shader:
506  * @code
507  * attribute vec3 in_Position; // always needed
508  * attribute vec4 in_Color; // always needed
509  * attribute vec3 in_Normal; // needed if used
510  * attribute vec2 in_UV; // needed if used
511  * @endcode
512  *
513  * @param names Geometry::ShaderAttribNames names.
514  *
515  * @see getShaderAttributeNames()
516  */
517  virtual void setShaderAttributeNames(ShaderAttribNames names) = 0;
518 
519  /**
520  * @brief Get Geometry::ShaderAttribNames names.
521  *
522  * @return Geometry::ShaderAttribNames names.
523  *
524  * @see setShaderAttributeNames()
525  */
527 
528  /**
529  * @brief Get Geometry::VertexType enum.
530  *
531  * @return Geometry::VertexType enum.
532  */
533  virtual VertexType getVertexType() = 0;
534 
535  /**
536  * @brief Get Geometry::IndexType enum.
537  *
538  * @return Geometry::IndexType enum.
539  */
540  virtual IndexType getIndexType() = 0;
541 
542  /**
543  * @brief Set buffer usage.
544  *
545  * Internal buffers will be re-created if changed so keep this
546  * in mind.
547  *
548  * @param bufferUsage HF_BufferUsage enum.
549  *
550  * @see getBufferUsage()
551  */
552  virtual void setBufferUsage(HF_BufferUsage bufferUsage) = 0;
553 
554  /**
555  * @brief Get buffer usage.
556  *
557  * @return HF_BufferUsage enum.
558  *
559  * @see setBufferUsage()
560  */
561  virtual HF_BufferUsage getBufferUsage() = 0;
562 
563  /**
564  * @brief Set the drawmode.
565  *
566  * @param drawMode Graphics::DrawMode to use.
567  *
568  * @see getDrawMode()
569  */
570  virtual void setDrawMode(Graphics::DrawMode drawMode) = 0;
571 
572  /**
573  * @brief Get the drawmode.
574  *
575  * @return The Graphics::DrawMode.
576  *
577  * @see setDrawMode()
578  */
579  virtual Graphics::DrawMode getDrawMode() = 0;
580 
581  /**
582  * @brief Get number of vertices.
583  *
584  * @return The number of vertices.
585  */
586  virtual uint32_hf getNumVerts() = 0;
587 
588  /**
589  * @brief Get number of indices.
590  *
591  * @return The number of indices.
592  */
593  virtual uint32_hf getNumIndices() = 0;
594 
595  /**
596  * @brief Get number of textures.
597  *
598  * @return The number of textures.
599  */
600  virtual uint32_hf getNumTextures() = 0;
601 
602  /**
603  * @brief Set the Geometry::VertexPosColVector to use.
604  *
605  * @param vertexPosCol Geometry::VertexPosColVector vector.
606  *
607  * @see setCustomVertexData()
608  * @see updateVertexBuffer()
609  * @see getVertexPosColVector()
610  * @see clearVertexVector()
611  */
612  virtual void setVertexVector(VertexPosColVector *vertexPosCol) = 0;
613 
614  /**
615  * @brief Set the Geometry::VertexPosTexVector to use.
616  *
617  * @param vertexPosTex Geometry::VertexPosTexVector vector.
618  *
619  * @see setCustomVertexData()
620  * @see updateVertexBuffer()
621  * @see getVertexPosTexVector()
622  * @see clearVertexVector()
623  */
624  virtual void setVertexVector(VertexPosTexVector *vertexPosTex) = 0;
625 
626  /**
627  * @brief Set the Geometry::VertexPosColTexVector to use.
628  *
629  * @param vertexPosColTex Geometry::VertexPosColTexVector vector.
630  *
631  * @see setCustomVertexData()
632  * @see updateVertexBuffer()
633  * @see getVertexPosColTexVector()
634  * @see clearVertexVector()
635  */
636  virtual void setVertexVector(VertexPosColTexVector *vertexPosColTex) = 0;
637 
638  /**
639  * @brief Set the Geometry::VertexPosColNorVector to use.
640  *
641  * @param vertexPosColNor Geometry::VertexPosColNorVector
642  * vector.
643  *
644  * @see setCustomVertexData()
645  * @see updateVertexBuffer()
646  * @see getVertexPosColNorVector()
647  * @see clearVertexVector()
648  */
649  virtual void setVertexVector(VertexPosColNorVector *vertexPosColNor) = 0;
650 
651  /**
652  * @brief Set the Geometry::VertexPosNorTexVector to use.
653  *
654  * @param vertexPosNorTex Geometry::VertexPosNorTexVector
655  * vector.
656  *
657  * @see setCustomVertexData()
658  * @see updateVertexBuffer()
659  * @see getVertexPosNorTexVector()
660  * @see clearVertexVector()
661  */
662  virtual void setVertexVector(VertexPosNorTexVector *vertexPosNorTex) = 0;
663 
664  /**
665  * @brief Set the Geometry::VertexPosColNorTexVector to use.
666  *
667  * @param vertexPosColNorTex
668  * Geometry::VertexPosColNorTexVector vector.
669  *
670  * @see setCustomVertexData()
671  * @see updateVertexBuffer()
672  * @see getVertexPosColNorTexVector()
673  * @see clearVertexVector()
674  */
675  virtual void setVertexVector(VertexPosColNorTexVector *vertexPosColNorTex) = 0;
676 
677  /**
678  * @brief Set Custom Vertex Attributes and data.
679  *
680  * This method is useful when you've your own structs etc
681  * containing the vertex data and attributes or if you need more
682  * attributes then available in defined structs.
683  *
684  * @param vertexAttributeVector Geometry::VertexAttributeVector
685  * containing all vertex attributes.
686  * @param data Pointer to vertex data.
687  * @param numVertices Number of vertices.
688  * @param dataSizeBytes Size of data in bytes.
689  *
690  * @see setVertexVector()
691  * @see updateVertexBuffer()
692  * @see clearVertexVector()
693  */
694  virtual void setCustomVertexData(VertexAttributeVector *vertexAttributeVector,
695  void *data, uint32_hf numVertices,
696  uint32_hf dataSizeBytes) = 0;
697 
698  /**
699  * @brief Updates subset of vertex buffer.
700  *
701  * Example code:
702  * @code
703  * // updates vertices 16 - 128:
704  * uint32_hf stSize = sizeof(HFCore::Geometry::VertexPosTex);
705  * geometry->updateVertexBuffer(16 * stSize, 112 * stSize);
706  * @endcode
707  *
708  * @param offsetBytes Specifies the offset into the buffer
709  * where data replacement will begin, measured in bytes.
710  * @param sizeBytes Specifies the size in bytes of the buffer
711  * region being replaced.
712  *
713  * @see setCustomVertexData()
714  * @see setVertexVector()
715  * @see clearVertexVector()
716  */
717  virtual void updateVertexBuffer(uint32_hf offsetBytes, uint32_hf sizeBytes) = 0;
718 
719  /**
720  * @brief Get Geometry::VertexPosColVector vector.
721  *
722  * @return Geometry::VertexPosColVector vector.
723  *
724  * @see setVertexVector()
725  * @see updateVertexBuffer()
726  * @see clearVertexVector()
727  */
728  virtual VertexPosColVector getVertexPosColVector() = 0;
729 
730  /**
731  * @brief Get Geometry::VertexPosTexVector vector.
732  *
733  * @return Geometry::VertexPosTexVector vector.
734  *
735  * @see setVertexVector()
736  * @see updateVertexBuffer()
737  * @see clearVertexVector()
738  */
739  virtual VertexPosTexVector getVertexPosTexVector() = 0;
740 
741  /**
742  * @brief Get Geometry::VertexPosColTexVector vector.
743  *
744  * @return Geometry::VertexPosColTexVector vector.
745  *
746  * @see setVertexVector()
747  * @see updateVertexBuffer()
748  * @see clearVertexVector()
749  */
750  virtual VertexPosColTexVector getVertexPosColTexVector() = 0;
751 
752  /**
753  * @brief Get Geometry::VertexPosColNorVector vector.
754  *
755  * @return Geometry::VertexPosColNorVector vector.
756  *
757  * @see setVertexVector()
758  * @see updateVertexBuffer()
759  * @see clearVertexVector()
760  */
761  virtual VertexPosColNorVector getVertexPosColNorVector() = 0;
762 
763  /**
764  * @brief Get Geometry::VertexPosNorTexVector vector.
765  *
766  * @return Geometry::VertexPosNorTexVector vector.
767  *
768  * @see setVertexVector()
769  * @see updateVertexBuffer()
770  * @see clearVertexVector()
771  */
772  virtual VertexPosNorTexVector getVertexPosNorTexVector() = 0;
773 
774  /**
775  * @brief Get Geometry::VertexPosColNorTexVector vector.
776  *
777  * @return Geometry::VertexPosColNorTexVector vector.
778  *
779  * @see updateVertexBuffer()
780  * @see setVertexVector()
781  * @see clearVertexVector()
782  */
783  virtual VertexPosColNorTexVector getVertexPosColNorTexVector() = 0;
784 
785  /**
786  * @brief Clear vertex vector.
787  *
788  * @param vertexType Geometry::VertexType enum.
789  *
790  * @see updateVertexBuffer()
791  * @see setCustomVertexData()
792  * @see setVertexVector()
793  * @see getVertexPosColVector()
794  * @see getVertexPosColTexVector()
795  * @see getVertexPosColNorVector()
796  * @see getVertexPosColNorTexVector()
797  */
798  virtual void clearVertexVector(VertexType vertexType) = 0;
799 
800  /**
801  * @brief Set the Geometry::VertexTextureVector to use.
802  *
803  * @param vertexTextures Geometry::VertexTextureVector vector.
804  *
805  * @see getVertexTextureVector()
806  * @see clearVertexTextureVector()
807  */
808  virtual void setVertexTextureVector(VertexTextureVector *vertexTextures) = 0;
809 
810  /**
811  * @brief Get Geometry::VertexTextureVector vector.
812  *
813  * @return Geometry::VertexTextureVector vector.
814  *
815  * @see setVertexTextureVector()
816  * @see clearVertexTextureVector()
817  */
818  virtual VertexTextureVector getVertexTextureVector() = 0;
819 
820  /**
821  * @brief Clear vertex texture vector.
822  *
823  * @see setVertexTextureVector()
824  * @see getVertexTextureVector()
825  */
826  virtual void clearVertexTextureVector() = 0;
827 
828  /**
829  * @brief Set the Geometry::VertexIndicesU32Vector to use.
830  *
831  * @param vertexIndices Geometry::VertexIndicesU32Vector vector.
832  *
833  * @see updateIndexBuffer()
834  * @see getVertexIndicesU32Vector()
835  * @see clearVertexIndicesU32Vector()
836  */
837  virtual void setVertexIndicesU32Vector(VertexIndicesU32Vector *vertexIndices) = 0;
838 
839  /**
840  * @brief Get Geometry::VertexIndicesU32Vector vector.
841  *
842  * @return Geometry::VertexIndicesU32Vector vector.
843  *
844  * @see updateIndexBuffer()
845  * @see setVertexIndicesU32Vector()
846  * @see clearVertexIndicesU32Vector()
847  */
848  virtual VertexIndicesU32Vector getVertexIndicesU32Vector() = 0;
849 
850  /**
851  * @brief Clear vertex indices vector.
852  *
853  * @see updateIndexBuffer()
854  * @see setVertexIndicesU32Vector()
855  * @see getVertexIndicesU32Vector()
856  */
857  virtual void clearVertexIndicesU32Vector() = 0;
858 
859  /**
860  * @brief Set the Geometry::VertexIndicesU16Vector to use.
861  *
862  * @param vertexIndices Geometry::VertexIndicesU16Vector vector.
863  *
864  * @see updateIndexBuffer()
865  * @see getVertexIndicesU16Vector()
866  * @see clearVertexIndicesU16Vector()
867  */
868  virtual void setVertexIndicesU16Vector(VertexIndicesU16Vector *vertexIndices) = 0;
869 
870  /**
871  * @brief Get Geometry::VertexIndicesU16Vector vector.
872  *
873  * @return Geometry::VertexIndicesU16Vector vector.
874  *
875  * @see updateIndexBuffer()
876  * @see setVertexIndicesU16Vector()
877  * @see clearVertexIndicesU16Vector()
878  */
879  virtual VertexIndicesU16Vector getVertexIndicesU16Vector() = 0;
880 
881  /**
882  * @brief Clear vertex indices vector.
883  *
884  * @see updateIndexBuffer()
885  * @see setVertexIndicesU16Vector()
886  * @see getVertexIndicesU16Vector()
887  */
888  virtual void clearVertexIndicesU16Vector() = 0;
889 
890  /**
891  * @brief Updates subset of index buffer.
892  *
893  * Example code:
894  * @code
895  * // updates indices 16 - 128:
896  * geometry->updateIndexBuffer(16 * sizeof(uint16_hf),
897  * 112 * sizeof(uint16_hf));
898  * @endcode
899  *
900  * @param offsetBytes Specifies the offset into the buffer
901  * where data replacement will begin, measured in bytes.
902  * @param sizeBytes Specifies the size in bytes of the buffer
903  * region being replaced.
904  *
905  * @see setVertexIndicesU16Vector()
906  * @see getVertexIndicesU16Vector()
907  * @see setVertexIndicesU32Vector()
908  * @see getVertexIndicesU32Vector()
909  * @see clearVertexVector()
910  */
911  virtual void updateIndexBuffer(uint32_hf offsetBytes, uint32_hf sizeBytes) = 0;
912 
913  /**
914  * @brief Set vertex position.
915  *
916  * Use this method to update a value. Set initial vector by
917  * calling setVertexVector().
918  *
919  * @param i Index of vertex.
920  * @param x X position.
921  * @param y Y position.
922  *
923  * @see getVertexPositionV2()
924  * @see getVertexPositionV3()
925  * @see setVertexVector()
926  * @see clearVertexVector()
927  */
928  virtual void setVertexPosition(uint32_hf i, fp32_hf x, fp32_hf y) = 0;
929 
930  /**
931  * @brief Set vertex position.
932  *
933  * Use this method to update a value. Set initial vector by
934  * calling setVertexVector().
935  *
936  * @param i Index of vertex.
937  * @param x X position.
938  * @param y Y position.
939  * @param z Z position.
940  *
941  * @see getVertexPositionV2()
942  * @see getVertexPositionV3()
943  * @see setVertexVector()
944  * @see clearVertexVector()
945  */
946  virtual void setVertexPosition(uint32_hf i, fp32_hf x, fp32_hf y, fp32_hf z) = 0;
947 
948  /**
949  * @brief Set vertex position.
950  *
951  * Use this method to update a value. Set initial vector by
952  * calling setVertexVector().
953  *
954  * @param i Index of vertex.
955  * @param position Vector holding position.
956  *
957  * @see getVertexPositionV2()
958  * @see getVertexPositionV3()
959  * @see setVertexVector()
960  * @see clearVertexVector()
961  */
962  virtual void setVertexPosition(uint32_hf i, glm::vec2 &position) = 0;
963 
964  /**
965  * @brief Set vertex position.
966  *
967  * Use this method to update a value. Set initial vector by
968  * calling setVertexVector().
969  *
970  * @param i Index of vertex.
971  * @param position Vector holding position.
972  *
973  * @see getVertexPositionV2()
974  * @see getVertexPositionV3()
975  * @see setVertexVector()
976  * @see clearVertexVector()
977  */
978  virtual void setVertexPosition(uint32_hf i, glm::vec3 &position) = 0;
979 
980  /**
981  * @brief Get vertex position.
982  *
983  * Use this method to get a value. Set initial vector by
984  * calling setVertexVector().
985  *
986  * @param i Index of vertex.
987  *
988  * @return Vertex position.
989  *
990  * @see setVertexPosition()
991  * @see setVertexVector()
992  * @see clearVertexVector()
993  */
994  virtual glm::vec2 getVertexPositionV2(uint32_hf i) = 0;
995 
996  /**
997  * @brief Get vertex position.
998  *
999  * Use this method to get a value. Set initial vector by
1000  * calling setVertexVector().
1001  *
1002  * @param i Index of vertex.
1003  *
1004  * @return Vertex position.
1005  *
1006  * @see setVertexPosition()
1007  * @see setVertexVector()
1008  * @see clearVertexVector()
1009  */
1010  virtual glm::vec3 getVertexPositionV3(uint32_hf i) = 0;
1011 
1012  /**
1013  * @brief Set vertex color.
1014  *
1015  * Use this method to update a value. Set initial vector by
1016  * calling setVertexVector().
1017  *
1018  * @param i Index of vertex.
1019  * @param color Color to set.
1020  *
1021  * @see getVertexColor()
1022  * @see setVertexVector()
1023  * @see clearVertexVector()
1024  */
1025  virtual void setVertexColor(uint32_hf i, Color color) = 0;
1026 
1027  /**
1028  * @brief Set vertex color.
1029  *
1030  * Use this method to update a value. Set initial vector by
1031  * calling setVertexVector().
1032  *
1033  * @param i Index of vertex.
1034  * @param color Vector holding rgb values.
1035  *
1036  * @see getVertexColor()
1037  * @see setVertexVector()
1038  * @see clearVertexVector()
1039  */
1040  virtual void setVertexColor(uint32_hf i, glm::vec3 &color) = 0;
1041 
1042  /**
1043  * @brief Set vertex color.
1044  *
1045  * Use this method to update a value. Set initial vector by
1046  * calling setVertexVector().
1047  *
1048  * @param i Index of vertex.
1049  * @param color Vector holding rgba values.
1050  *
1051  * @see getVertexColor()
1052  * @see setVertexVector()
1053  * @see clearVertexVector()
1054  */
1055  virtual void setVertexColor(uint32_hf i, glm::vec4 &color) = 0;
1056 
1057  /**
1058  * @brief Get vertex color.
1059  *
1060  * Use this method to get a value. Set initial vector by
1061  * calling setVertexVector().
1062  *
1063  * @param i Index of vertex.
1064  *
1065  * @return Vertex color.
1066  *
1067  * @see setVertexColor()
1068  * @see setVertexVector()
1069  * @see clearVertexVector()
1070  */
1071  virtual Color getVertexColor(uint32_hf i) = 0;
1072 
1073  /**
1074  * @brief Get vertex color.
1075  *
1076  * Use this method to get a value. Set initial vector by
1077  * calling setVertexVector().
1078  *
1079  * @param i Index of vertex.
1080  *
1081  * @return Vertex color (rgb).
1082  *
1083  * @see setVertexColor()
1084  * @see setVertexVector()
1085  * @see clearVertexVector()
1086  */
1087  virtual glm::vec3 getVertexColorV3(uint32_hf i) = 0;
1088 
1089  /**
1090  * @brief Get vertex color.
1091  *
1092  * Use this method to get a value. Set initial vector by
1093  * calling setVertexVector().
1094  *
1095  * @param i Index of vertex.
1096  *
1097  * @return Vertex color (rgba).
1098  *
1099  * @see setVertexColor()
1100  * @see setVertexVector()
1101  * @see clearVertexVector()
1102  */
1103  virtual glm::vec4 getVertexColorV4(uint32_hf i) = 0;
1104 
1105  /**
1106  * @brief Set vertex normal.
1107  *
1108  * Use this method to update a value. Set initial vector by
1109  * calling setVertexVector().
1110  *
1111  * @param i Index of vertex.
1112  * @param x X normal.
1113  * @param y Y normal.
1114  * @param z Z normal.
1115  *
1116  * @see getVertexNormal()
1117  * @see setVertexVector()
1118  * @see clearVertexVector()
1119  */
1120  virtual void setVertexNormal(uint32_hf i, fp32_hf x, fp32_hf y, fp32_hf z) = 0;
1121 
1122  /**
1123  * @brief Set vertex normal.
1124  *
1125  * Use this method to update a value. Set initial vector by
1126  * calling setVertexVector().
1127  *
1128  * @param i Index of vertex.
1129  * @param normal Vector holding normal.
1130  *
1131  * @see getVertexNormal()
1132  * @see setVertexVector()
1133  * @see clearVertexVector()
1134  */
1135  virtual void setVertexNormal(uint32_hf i, glm::vec3 &normal) = 0;
1136 
1137  /**
1138  * @brief Get vertex normal.
1139  *
1140  * Use this method to get a value. Set initial vector by
1141  * calling setVertexVector().
1142  *
1143  * @param i Index of vertex.
1144  *
1145  * @return Vertex normal.
1146  *
1147  * @see setVertexNormal()
1148  * @see setVertexVector()
1149  * @see clearVertexVector()
1150  */
1151  virtual glm::vec3 getVertexNormal(uint32_hf i) = 0;
1152 
1153  /**
1154  * @brief Set vertex texture UV coordinates.
1155  *
1156  * Use this method to update a value. Set initial vector by
1157  * calling setVertexVector().
1158  *
1159  * @param i Index of vertex.
1160  * @param u Texture U coordinate.
1161  * @param v Texture V coordinate.
1162  *
1163  * @see getVertexTextureUVCoords()
1164  * @see setVertexVector()
1165  * @see clearVertexVector()
1166  */
1167  virtual void setVertexTextureUVCoords(uint32_hf i, fp32_hf u, fp32_hf v) = 0;
1168 
1169  /**
1170  * @brief Set vertex texture UV coordinates.
1171  *
1172  * Use this method to update a value. Set initial vector by
1173  * calling setVertexVector().
1174  *
1175  * @param i Index of vertex.
1176  * @param uv UV Vector holding UV coordinates.
1177  *
1178  * @see getVertexTextureUVCoords()
1179  * @see setVertexVector()
1180  * @see clearVertexVector()
1181  */
1182  virtual void setVertexTextureUVCoords(uint32_hf i, glm::vec2 &uv) = 0;
1183 
1184  /**
1185  * @brief Get vertex texture UV coordinates.
1186  *
1187  * Use this method to get a value. Set initial vector by
1188  * calling setVertexVector().
1189  *
1190  * @param i Index of vertex.
1191  *
1192  * @return Vertex texture UV coordinates.
1193  *
1194  * @see setVertexTextureUVCoords()
1195  * @see setVertexVector()
1196  * @see clearVertexVector()
1197  */
1198  virtual glm::vec2 getVertexTextureUVCoords(uint32_hf i) = 0;
1199 
1200  /**
1201  * @brief Set vertex position and color.
1202  *
1203  * Use this method to update a value. Set initial vector by
1204  * calling setVertexVector().
1205  *
1206  * @param i Index of vertex.
1207  * @param posx X position.
1208  * @param posy Y position.
1209  * @param posz Z position.
1210  * @param color Color to set.
1211  *
1212  * @see addVertexPosCol()
1213  * @see setVertexVector()
1214  * @see getVertexPosColVector()
1215  * @see clearVertexVector()
1216  */
1217  virtual void setVertexPosCol(uint32_hf i, fp32_hf posx, fp32_hf posy,
1218  fp32_hf posz, Color color) = 0;
1219 
1220  /**
1221  * @brief Set vertex position and color.
1222  *
1223  * Use this method to update a value. Set initial vector by
1224  * calling setVertexVector().
1225  *
1226  * @param i Index of vertex.
1227  * @param v Geometry::VertexPosCol struct.
1228  *
1229  * @see addVertexPosCol()
1230  * @see setVertexVector()
1231  * @see getVertexPosColVector()
1232  * @see clearVertexVector()
1233  */
1234  virtual void setVertexPosCol(uint32_hf i, VertexPosCol v) = 0;
1235 
1236  /**
1237  * @brief Set vertex position and texture UV coordinates.
1238  *
1239  * Use this method to update a value. Set initial vector by
1240  * calling setVertexVector().
1241  *
1242  * @param i Index of vertex.
1243  * @param posx X position.
1244  * @param posy Y position.
1245  * @param posz Z position.
1246  * @param u Texture U coordinate.
1247  * @param v Texture V coordinate.
1248  *
1249  * @see addVertexPosTex()
1250  * @see setVertexVector()
1251  * @see getVertexPosTexVector()
1252  * @see clearVertexVector()
1253  */
1254  virtual void setVertexPosTex(uint32_hf i, fp32_hf posx, fp32_hf posy,
1255  fp32_hf posz, fp32_hf u, fp32_hf v) = 0;
1256 
1257  /**
1258  * @brief Set vertex position and texture UV coordinates.
1259  *
1260  * Use this method to update a value. Set initial vector by
1261  * calling setVertexVector().
1262  *
1263  * @param i Index of vertex.
1264  * @param v Geometry::VertexPosTex struct.
1265  *
1266  * @see addVertexPosTex()
1267  * @see setVertexVector()
1268  * @see getVertexPosTexVector()
1269  * @see clearVertexVector()
1270  */
1271  virtual void setVertexPosTex(uint32_hf i, VertexPosTex v) = 0;
1272 
1273  /**
1274  * @brief Set vertex position, color and texture UV coordinates.
1275  *
1276  * Use this method to update a value. Set initial vector by
1277  * calling setVertexVector().
1278  *
1279  * @param i Index of vertex.
1280  * @param posx X position.
1281  * @param posy Y position.
1282  * @param posz Z position.
1283  * @param color Color to set.
1284  * @param u Texture U coordinate.
1285  * @param v Texture V coordinate.
1286  *
1287  * @see addVertexPosColTex()
1288  * @see setVertexVector()
1289  * @see getVertexPosColTexVector()
1290  * @see clearVertexVector()
1291  */
1292  virtual void setVertexPosColTex(uint32_hf i, fp32_hf posx, fp32_hf posy,
1293  fp32_hf posz, Color color, fp32_hf u, fp32_hf v) = 0;
1294 
1295  /**
1296  * @brief Set vertex position, color and texture UV coordinates.
1297  *
1298  * Use this method to update a value. Set initial vector by
1299  * calling setVertexVector().
1300  *
1301  * @param i Index of vertex.
1302  * @param v Geometry::VertexPosColTex struct.
1303  *
1304  * @see addVertexPosColTex()
1305  * @see setVertexVector()
1306  * @see getVertexPosColTexVector()
1307  * @see clearVertexVector()
1308  */
1309  virtual void setVertexPosColTex(uint32_hf i, VertexPosColTex v) = 0;
1310 
1311  /**
1312  * @brief Set vertex position, color and normal.
1313  *
1314  * Use this method to update a value. Set initial vector by
1315  * calling setVertexVector().
1316  *
1317  * @param i Index of vertex.
1318  * @param posx X position.
1319  * @param posy Y position.
1320  * @param posz Z position.
1321  * @param color Color to set.
1322  * @param norx X normal.
1323  * @param nory Y normal.
1324  * @param norz Z normal.
1325  *
1326  * @see addVertexPosColNor()
1327  * @see setVertexVector()
1328  * @see getVertexPosColNorVector()
1329  * @see clearVertexVector()
1330  */
1331  virtual void setVertexPosColNor(uint32_hf i, fp32_hf posx, fp32_hf posy,
1332  fp32_hf posz, Color color, fp32_hf norx,
1333  fp32_hf nory, fp32_hf norz) = 0;
1334 
1335  /**
1336  * @brief Set vertex position, color and normal.
1337  *
1338  * Use this method to update a value. Set initial vector by
1339  * calling setVertexVector().
1340  *
1341  * @param i Index of vertex.
1342  * @param v Geometry::VertexPosColNor struct.
1343  *
1344  * @see addVertexPosColNor()
1345  * @see setVertexVector()
1346  * @see getVertexPosColNorVector()
1347  * @see clearVertexVector()
1348  */
1349  virtual void setVertexPosColNor(uint32_hf i, VertexPosColNor v) = 0;
1350 
1351  /**
1352  * @brief Set vertex position, normal and texture UV coordinates.
1353  *
1354  * Use this method to update a value. Set initial vector by
1355  * calling setVertexVector().
1356  *
1357  * @param i Index of vertex.
1358  * @param posx X position.
1359  * @param posy Y position.
1360  * @param posz Z position.
1361  * @param norx X normal.
1362  * @param nory Y normal.
1363  * @param norz Z normal.
1364  * @param u Texture U coordinate.
1365  * @param v Texture V coordinate.
1366  *
1367  * @see addVertexPosNorTex()
1368  * @see setVertexVector()
1369  * @see getVertexPosNorTexVector()
1370  * @see clearVertexVector()
1371  */
1372  virtual void setVertexPosNorTex(uint32_hf i, fp32_hf posx, fp32_hf posy,
1373  fp32_hf posz, fp32_hf norx, fp32_hf nory,
1374  fp32_hf norz, fp32_hf u, fp32_hf v) = 0;
1375 
1376  /**
1377  * @brief Set vertex position, normal and texture UV coordinates.
1378  *
1379  * Use this method to update a value. Set initial vector by
1380  * calling setVertexVector().
1381  *
1382  * @param i Index of vertex.
1383  * @param v Geometry::VertexPosNorTex struct.
1384  *
1385  * @see addVertexPosNorTex()
1386  * @see setVertexVector()
1387  * @see getVertexPosNorTexVector()
1388  * @see clearVertexVector()
1389  */
1390  virtual void setVertexPosNorTex(uint32_hf i, VertexPosNorTex v) = 0;
1391 
1392  /**
1393  * @brief Set vertex position, color, normal and texture UV
1394  * coordinates.
1395  *
1396  * Use this method to update a value. Set initial vector by
1397  * calling setVertexVector().
1398  *
1399  * @param i Index of vertex.
1400  * @param posx X position.
1401  * @param posy Y position.
1402  * @param posz Z position.
1403  * @param color Color to set.
1404  * @param norx X normal.
1405  * @param nory Y normal.
1406  * @param norz Z normal.
1407  * @param u Texture U coordinate.
1408  * @param v Texture V coordinate.
1409  *
1410  * @see addVertexPosColNorTex()
1411  * @see setVertexVector()
1412  * @see getVertexPosColNorTexVector()
1413  * @see clearVertexVector()
1414  */
1415  virtual void setVertexPosColNorTex(uint32_hf i, fp32_hf posx, fp32_hf posy,
1416  fp32_hf posz, Color color, fp32_hf norx,
1417  fp32_hf nory, fp32_hf norz, fp32_hf u,
1418  fp32_hf v) = 0;
1419 
1420  /**
1421  * @brief Set vertex position, color, normal and texture UV
1422  * coordinates.
1423  *
1424  * Use this method to update a value. Set initial vector by
1425  * calling setVertexVector().
1426  *
1427  * @param i Index of vertex.
1428  * @param v Geometry::VertexPosColNorTex struct.
1429  *
1430  * @see addVertexPosColNorTex()
1431  * @see setVertexVector()
1432  * @see getVertexPosColNorTexVector()
1433  * @see clearVertexVector()
1434  */
1435  virtual void setVertexPosColNorTex(uint32_hf i, VertexPosColNorTex v) = 0;
1436 
1437  /**
1438  * @brief Add vertex position and color to internal vector.
1439  *
1440  * @param posx X position.
1441  * @param posy Y position.
1442  * @param posz Z position.
1443  * @param color Color to set.
1444  *
1445  * @see setVertexPosCol()
1446  * @see setVertexVector()
1447  * @see getVertexPosColVector()
1448  * @see clearVertexVector()
1449  */
1450  virtual void addVertexPosCol(fp32_hf posx, fp32_hf posy,
1451  fp32_hf posz, Color color) = 0;
1452 
1453  /**
1454  * @brief Add vertex position and color to internal vector.
1455  *
1456  * @param v Geometry::VertexPosCol struct.
1457  *
1458  * @see setVertexPosCol()
1459  * @see setVertexVector()
1460  * @see getVertexPosColVector()
1461  * @see clearVertexVector()
1462  */
1463  virtual void addVertexPosCol(VertexPosCol v) = 0;
1464 
1465  /**
1466  * @brief Add vertex position and texture UV coordinates to
1467  * internal vector.
1468  *
1469  * @param posx X position.
1470  * @param posy Y position.
1471  * @param posz Z position.
1472  * @param u Texture U coordinate.
1473  * @param v Texture V coordinate.
1474  *
1475  * @see setVertexPosTex()
1476  * @see setVertexVector()
1477  * @see getVertexPosTexVector()
1478  * @see clearVertexVector()
1479  */
1480  virtual void addVertexPosTex(fp32_hf posx, fp32_hf posy, fp32_hf posz,
1481  fp32_hf u, fp32_hf v) = 0;
1482 
1483  /**
1484  * @brief Add vertex position and texture UV coordinates to
1485  * internal vector.
1486  *
1487  * @param v Geometry::VertexPosTex struct.
1488  *
1489  * @see setVertexPosTex()
1490  * @see setVertexVector()
1491  * @see getVertexPosTexVector()
1492  * @see clearVertexVector()
1493  */
1494  virtual void addVertexPosTex(VertexPosTex v) = 0;
1495 
1496  /**
1497  * @brief Add vertex position, color and texture UV coordinates
1498  * to internal vector.
1499  *
1500  * @param posx X position.
1501  * @param posy Y position.
1502  * @param posz Z position.
1503  * @param color Color to set.
1504  * @param u Texture U coordinate.
1505  * @param v Texture V coordinate.
1506  *
1507  * @see setVertexPosColTex()
1508  * @see setVertexVector()
1509  * @see getVertexPosColTexVector()
1510  * @see clearVertexVector()
1511  */
1512  virtual void addVertexPosColTex(fp32_hf posx, fp32_hf posy, fp32_hf posz,
1513  Color color, fp32_hf u, fp32_hf v) = 0;
1514 
1515  /**
1516  * @brief Add vertex position, color and texture UV coordinates
1517  * to internal vector.
1518  *
1519  * @param v Geometry::VertexPosColTex struct.
1520  *
1521  * @see setVertexPosColTex()
1522  * @see setVertexVector()
1523  * @see getVertexPosColTexVector()
1524  * @see clearVertexVector()
1525  */
1526  virtual void addVertexPosColTex(VertexPosColTex v) = 0;
1527 
1528  /**
1529  * @brief Add vertex position, color and normal to internal
1530  * vector.
1531  *
1532  * @param posx X position.
1533  * @param posy Y position.
1534  * @param posz Z position.
1535  * @param color Color to set.
1536  * @param norx X normal.
1537  * @param nory Y normal.
1538  * @param norz Z normal.
1539  *
1540  * @see setVertexPosColNor()
1541  * @see setVertexVector()
1542  * @see getVertexPosColNorVector()
1543  * @see clearVertexVector()
1544  */
1545  virtual void addVertexPosColNor(fp32_hf posx, fp32_hf posy, fp32_hf posz,
1546  Color color, fp32_hf norx, fp32_hf nory,
1547  fp32_hf norz) = 0;
1548 
1549  /**
1550  * @brief Add vertex position, color and normal to internal
1551  * vector.
1552  *
1553  * @param v Geometry::VertexPosColNor struct.
1554  *
1555  * @see setVertexPosColNor()
1556  * @see setVertexVector()
1557  * @see getVertexPosColNorVector()
1558  * @see clearVertexVector()
1559  */
1560  virtual void addVertexPosColNor(VertexPosColNor v) = 0;
1561 
1562  /**
1563  * @brief Add vertex position, normal and texture UV coordinates
1564  * to internal vector.
1565  *
1566  * @param posx X position.
1567  * @param posy Y position.
1568  * @param posz Z position.
1569  * @param norx X normal.
1570  * @param nory Y normal.
1571  * @param norz Z normal.
1572  * @param u Texture U coordinate.
1573  * @param v Texture V coordinate.
1574  *
1575  * @see setVertexPosNorTex()
1576  * @see setVertexVector()
1577  * @see getVertexPosNorTexVector()
1578  * @see clearVertexVector()
1579  */
1580  virtual void addVertexPosNorTex(fp32_hf posx, fp32_hf posy, fp32_hf posz,
1581  fp32_hf norx, fp32_hf nory, fp32_hf norz,
1582  fp32_hf u, fp32_hf v) = 0;
1583 
1584  /**
1585  * @brief Add vertex position, normal and texture UV coordinates
1586  * to internal vector.
1587  *
1588  * @param v Geometry::VertexPosNorTex struct.
1589  *
1590  * @see setVertexPosNorTex()
1591  * @see setVertexVector()
1592  * @see getVertexPosNorTexVector()
1593  * @see clearVertexVector()
1594  */
1595  virtual void addVertexPosNorTex(VertexPosNorTex v) = 0;
1596 
1597  /**
1598  * @brief Add vertex position, color, normal and texture UV
1599  * coordinates to internal vector.
1600  *
1601  * @param posx X position.
1602  * @param posy Y position.
1603  * @param posz Z position.
1604  * @param color Color to set.
1605  * @param norx X normal.
1606  * @param nory Y normal.
1607  * @param norz Z normal.
1608  * @param u Texture U coordinate.
1609  * @param v Texture V coordinate.
1610  *
1611  * @see setVertexPosColNorTex()
1612  * @see setVertexVector()
1613  * @see getVertexPosColNorTexVector()
1614  * @see clearVertexVector()
1615  */
1616  virtual void addVertexPosColNorTex(fp32_hf posx, fp32_hf posy, fp32_hf posz,
1617  Color color, fp32_hf norx, fp32_hf nory,
1618  fp32_hf norz, fp32_hf u, fp32_hf v) = 0;
1619 
1620  /**
1621  * @brief Add vertex position, color, normal and texture UV
1622  * coordinates to internal vector.
1623  *
1624  * @param v Geometry::VertexPosColNorTex struct.
1625  *
1626  * @see setVertexPosColNorTex()
1627  * @see setVertexVector()
1628  * @see getVertexPosColNorTexVector()
1629  * @see clearVertexVector()
1630  */
1631  virtual void addVertexPosColNorTex(VertexPosColNorTex v) = 0;
1632 
1633  /**
1634  * @brief Set vertex index (indices buffer).
1635  *
1636  * Use this method to update a value. Set initial vector by
1637  * calling setVertexIndicesU32Vector().
1638  *
1639  * @param i Index of index buffer.
1640  * @param val Value to set.
1641  *
1642  * @see getVertexIndexU32()
1643  * @see setVertexIndicesU32Vector()
1644  * @see clearVertexIndicesU32Vector()
1645  * @see addVertexIndexU32()
1646  */
1647  virtual void setVertexIndexU32(uint32_hf i, uint32_hf val) = 0;
1648 
1649  /**
1650  * @brief Get vertex index.
1651  *
1652  * Use this method to get a value. Set initial vector by
1653  * calling setVertexIndicesU32Vector().
1654  *
1655  * @param i Index of vertex.
1656  *
1657  * @return Vertex index.
1658  *
1659  * @see setVertexIndexU32()
1660  * @see setVertexIndicesU32Vector()
1661  * @see clearVertexIndicesU32Vector()
1662  * @see addVertexIndexU32()
1663  */
1664  virtual uint32_hf getVertexIndexU32(uint32_hf i) = 0;
1665 
1666  /**
1667  * @brief Add vertex index to internal vector.
1668  *
1669  * @param val Value to set.
1670  *
1671  * @see setVertexIndexU32()
1672  * @see getVertexIndexU32()
1673  * @see setVertexIndicesU32Vector()
1674  * @see clearVertexIndicesU32Vector()
1675  */
1676  virtual void addVertexIndexU32(uint32_hf val) = 0;
1677 
1678  /**
1679  * @brief Set vertex index (indices buffer).
1680  *
1681  * Use this method to update a value. Set initial vector by
1682  * calling setVertexIndicesU16Vector().
1683  *
1684  * @param i Index of index buffer.
1685  * @param val Value to set.
1686  *
1687  * @see getVertexIndexU16()
1688  * @see setVertexIndicesU16Vector()
1689  * @see clearVertexIndicesU16Vector()
1690  * @see addVertexIndexU16()
1691  */
1692  virtual void setVertexIndexU16(uint32_hf i, uint16_hf val) = 0;
1693 
1694  /**
1695  * @brief Get vertex index.
1696  *
1697  * Use this method to get a value. Set initial vector by
1698  * calling setVertexIndicesU16Vector().
1699  *
1700  * @param i Index of vertex.
1701  *
1702  * @return Vertex index.
1703  *
1704  * @see setVertexIndexU16()
1705  * @see setVertexIndicesU16Vector()
1706  * @see clearVertexIndicesU16Vector()
1707  * @see addVertexIndexU16()
1708  */
1709  virtual uint16_hf getVertexIndexU16(uint32_hf i) = 0;
1710 
1711  /**
1712  * @brief Add vertex index to internal vector.
1713  *
1714  * @param val Value to set.
1715  *
1716  * @see setVertexIndexU16()
1717  * @see getVertexIndexU16()
1718  * @see setVertexIndicesU16Vector()
1719  * @see clearVertexIndicesU16Vector()
1720  */
1721  virtual void addVertexIndexU16(uint16_hf val) = 0;
1722 
1723  /**
1724  * @brief Set Texture struct.
1725  *
1726  * Use this method to update a value. Set initial vector by
1727  * calling setVertexTextureVector().
1728  *
1729  * Current Shader set will be updated automatically internally:
1730  * @code
1731  * mShader->setParameter(texture->shaderParamName,
1732  * texture->image);
1733  * @endcode
1734  *
1735  * @param i Index of texture.
1736  * @param texture Texture struct to use.
1737  *
1738  * @see getTexture()
1739  * @see setVertexTextureVector()
1740  * @see clearVertexTextureVector()
1741  * @see addTexture()
1742  */
1743  virtual void setTexture(uint32_hf i, Texture texture) = 0;
1744 
1745  /**
1746  * @brief Get Texture struct.
1747  *
1748  * Use this method to get a value. Set initial vector by
1749  * calling setVertexTextureVector().
1750  *
1751  * @param i Index of texture.
1752  *
1753  * @return Texture struct.
1754  *
1755  * @see setTexture()
1756  * @see setVertexTextureVector()
1757  * @see clearVertexTextureVector()
1758  * @see addTexture()
1759  */
1760  virtual Texture getTexture(uint32_hf i) = 0;
1761 
1762  /**
1763  * @brief Add Texture to internal vector.
1764  *
1765  * @param texture Texture struct.
1766  *
1767  * @see setTexture()
1768  * @see getTexture()
1769  * @see setVertexTextureVector()
1770  * @see clearVertexTextureVector()
1771  */
1772  virtual void addTexture(Texture texture) = 0;
1773 
1774  /**
1775  * @brief Set Graphics::MagFilter to use for Image's.
1776  *
1777  * @param magFilter Graphics::MagFilter to use.
1778  *
1779  * @see setTextureMinFilter()
1780  * @see getTextureMagFilter()
1781  * @see getTextureMinFilter()
1782  */
1783  virtual void setTextureMagFilter(Graphics::MagFilter magFilter) = 0;
1784 
1785  /**
1786  * @brief Set Graphics::MinFilter to use for Image's.
1787  *
1788  * @param minFilter Graphics::MinFilter to use.
1789  *
1790  * @see setTextureMagFilter()
1791  * @see getTextureMagFilter()
1792  * @see getTextureMinFilter()
1793  */
1794  virtual void setTextureMinFilter(Graphics::MinFilter minFilter) = 0;
1795 
1796  /**
1797  * @brief Get Graphics::MagFilter in use.
1798  *
1799  * @return Graphics::MagFilter in use.
1800  *
1801  * @see setTextureMagFilter()
1802  * @see setTextureMinFilter()
1803  * @see getTextureMinFilter()
1804  */
1806 
1807  /**
1808  * @brief Get Graphics::MinFilter in use.
1809  *
1810  * @return Graphics::MinFilter in use.
1811  *
1812  * @see setTextureMagFilter()
1813  * @see setTextureMinFilter()
1814  * @see getTextureMagFilter()
1815  */
1817 
1818  /**
1819  * @brief Set Shader to use.
1820  *
1821  * @param shader Pointer to Shader.
1822  *
1823  * @see getShader()
1824  */
1825  virtual void setShader(Shader *shader) = 0;
1826 
1827  /**
1828  * @brief Get pointer to Shader in use.
1829  *
1830  * @return Pointer to Shader in use, or NULL if not set.
1831  *
1832  * @see setShader()
1833  */
1834  virtual Shader *getShader() = 0;
1835  };
1836 }
bool operator==(const VertexPosColNorTex &other) const
Overload of binary operator ==.
Definition: Geometry.h:279
unsigned int uint32_hf
A type definition for unsigned int.
Definition: HFDataTypes.h:354
bool operator==(const VertexPosColNor &other) const
Overload of binary operator ==.
Definition: Geometry.h:222
Struct holding vertex position, color, normal and texture UV coords.
Definition: Geometry.h:262
Interface for all rendering related things.
virtual Shader * getShader()=0
Get pointer to Shader in use.
std::vector< VertexPosColNor > VertexPosColNorVector
typedef for Vector holding VertexPosColNor struct.
Definition: Geometry.h:361
Geometry(HF_BufferUsage bufferUsage, VertexPosTexVector *vertexPosTex, VertexTextureVector *vertexTextures=NULL)
Constructor.
Definition: Geometry.h:422
virtual void setVertexPosition(uint32_hf i, fp32_hf x, fp32_hf y)=0
Set vertex position.
uint32_hf color
Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
Definition: Geometry.h:265
virtual void setBufferUsage(HF_BufferUsage bufferUsage)=0
Set buffer usage.
glm::vec3 normal
Vertex normal.
Definition: Geometry.h:266
virtual void clearVertexIndicesU16Vector()=0
Clear vertex indices vector.
Vertex data type: float.
Definition: Geometry.h:85
MinFilter
Minification filter to use for Images.
Definition: Graphics.h:177
Vertex type: Position, normal and texture uv.
Definition: Geometry.h:329
Index type: uint32_hf.
Definition: Geometry.h:340
virtual glm::vec4 getVertexColorV4(uint32_hf i)=0
Get vertex color.
Vertex data type: Not set.
Definition: Geometry.h:84
bool operator==(const VertexPosCol &other) const
Overload of binary operator ==.
Definition: Geometry.h:143
std::vector< VertexPosTex > VertexPosTexVector
typedef for Vector holding VertexPosTex struct.
Definition: Geometry.h:351
Interface useful when rendering custom Geometry.
Definition: Geometry.h:70
virtual void setShader(Shader *shader)=0
Set Shader to use.
Vertex type: Position and texture uv.
Definition: Geometry.h:326
std::string uv
Shader attribute name for: uv.
Definition: Geometry.h:305
Vertex data type: uint32_hf.
Definition: Geometry.h:89
virtual VertexPosColNorVector getVertexPosColNorVector()=0
Get Geometry::VertexPosColNorVector vector.
DrawMode
Draw / Blend modes.
Definition: Graphics.h:141
glm::vec3 position
Vertex position.
Definition: Geometry.h:264
virtual void clearVertexIndicesU32Vector()=0
Clear vertex indices vector.
glm::vec3 normal
Vertex normal.
Definition: Geometry.h:237
Geometry(HF_BufferUsage bufferUsage, VertexPosNorTexVector *vertexPosNorTex, VertexTextureVector *vertexTextures=NULL)
Constructor.
Definition: Geometry.h:453
virtual void updateVertexBuffer(uint32_hf offsetBytes, uint32_hf sizeBytes)=0
Updates subset of vertex buffer.
virtual Graphics::MagFilter getTextureMagFilter()=0
Get Graphics::MagFilter in use.
struct HFCore::Geometry::VertexPosColNorTex VertexPosColNorTex
Struct holding vertex position, color, normal and texture UV coords.
virtual glm::vec3 getVertexNormal(uint32_hf i)=0
Get vertex normal.
bool normalized
Determine whether data-value be normalized.
Definition: Geometry.h:122
Vertex usage type: Position.
Definition: Geometry.h:103
Struct holding vertex position and texture UV coords.
Definition: Geometry.h:153
Vertex data type: glm::vec3.
Definition: Geometry.h:87
virtual void setVertexPosCol(uint32_hf i, fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color)=0
Set vertex position and color.
Vertex usage type: Normal.
Definition: Geometry.h:107
virtual void setVertexPosColNorTex(uint32_hf i, fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color, fp32_hf norx, fp32_hf nory, fp32_hf norz, fp32_hf u, fp32_hf v)=0
Set vertex position, color, normal and texture UV coordinates.
virtual void updateIndexBuffer(uint32_hf offsetBytes, uint32_hf sizeBytes)=0
Updates subset of index buffer.
Struct holding vertex position, color and texture UV coords.
Definition: Geometry.h:179
virtual void addTexture(Texture texture)=0
Add Texture to internal vector.
virtual void setVertexIndexU16(uint32_hf i, uint16_hf val)=0
Set vertex index (indices buffer).
Struct holding vertex position, color and normal.
Definition: Geometry.h:206
virtual uint16_hf getVertexIndexU16(uint32_hf i)=0
Get vertex index.
virtual VertexPosTexVector getVertexPosTexVector()=0
Get Geometry::VertexPosTexVector vector.
glm::vec3 position
Vertex position.
Definition: Geometry.h:155
virtual VertexPosNorTexVector getVertexPosNorTexVector()=0
Get Geometry::VertexPosNorTexVector vector.
Framework data types, defines, typedef&#39;s, enum and structs.
virtual VertexPosColNorTexVector getVertexPosColNorTexVector()=0
Get Geometry::VertexPosColNorTexVector vector.
Vertex usage type: Color Specular.
Definition: Geometry.h:105
virtual void addVertexPosColNor(fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color, fp32_hf norx, fp32_hf nory, fp32_hf norz)=0
Add vertex position, color and normal to internal vector.
VertexType
Vertex type enum.
Definition: Geometry.h:321
virtual void setVertexIndicesU32Vector(VertexIndicesU32Vector *vertexIndices)=0
Set the Geometry::VertexIndicesU32Vector to use.
virtual uint32_hf getNumVerts()=0
Get number of vertices.
Struct holding custom vertex attributes.
Definition: Geometry.h:116
virtual VertexType getVertexType()=0
Get Geometry::VertexType enum.
unsigned short int uint16_hf
A type definition for unsigned short.
Definition: HFDataTypes.h:344
std::vector< VertexAttribute > VertexAttributeVector
typedef for Vector holding custom vertex attributes.
Definition: Geometry.h:391
struct HFCore::Geometry::VertexPosColNor VertexPosColNor
Struct holding vertex position, color and normal.
glm::vec2 uv
Vertex texture uv coords.
Definition: Geometry.h:238
std::vector< VertexPosColNorTex > VertexPosColNorTexVector
typedef for Vector holding VertexPosColNorTex struct.
Definition: Geometry.h:371
Vertex usage type: Tangent.
Definition: Geometry.h:108
virtual void addVertexPosColNorTex(fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color, fp32_hf norx, fp32_hf nory, fp32_hf norz, fp32_hf u, fp32_hf v)=0
Add vertex position, color, normal and texture UV coordinates to internal vector. ...
Geometry(HF_BufferUsage bufferUsage, VertexPosColVector *vertexPosCol)
Constructor.
Definition: Geometry.h:412
VertexUsageType
Enum holding custom vertex usage type.
Definition: Geometry.h:100
Vertex usage type: Not set.
Definition: Geometry.h:102
virtual void addVertexPosColTex(fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color, fp32_hf u, fp32_hf v)=0
Add vertex position, color and texture UV coordinates to internal vector.
virtual glm::vec2 getVertexTextureUVCoords(uint32_hf i)=0
Get vertex texture UV coordinates.
VertexUsageType vertexUsageType
Vertex usage type (must be set for HLSL).
Definition: Geometry.h:120
IndexType
Index type enum.
Definition: Geometry.h:336
Interface for Resource type Shader.
virtual void addVertexPosCol(fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color)=0
Add vertex position and color to internal vector.
Geometry(HF_BufferUsage bufferUsage, VertexPosColNorVector *vertexPosColNor)
Constructor.
Definition: Geometry.h:443
virtual IndexType getIndexType()=0
Get Geometry::IndexType enum.
virtual VertexIndicesU32Vector getVertexIndicesU32Vector()=0
Get Geometry::VertexIndicesU32Vector vector.
Vertex type: Position, color and texture uv.
Definition: Geometry.h:327
std::string shaderAttribName
Shader attribute name (must be set for GLSL).
Definition: Geometry.h:118
Struct holding texture and Shader uniform parameter name.
Definition: Geometry.h:312
#define NULL
Convenient define for 0.
Definition: HFDataTypes.h:42
struct HFCore::Geometry::ShaderAttribNames ShaderAttribNames
Struct holding shader attribute names (needed for GLSL if default values needs to be changed)...
Image * image
Pointer to Image.
Definition: Geometry.h:314
Struct holding shader attribute names (needed for GLSL if default values needs to be changed)...
Definition: Geometry.h:300
virtual void addVertexPosTex(fp32_hf posx, fp32_hf posy, fp32_hf posz, fp32_hf u, fp32_hf v)=0
Add vertex position and texture UV coordinates to internal vector.
struct HFCore::Geometry::VertexPosNorTex VertexPosNorTex
Struct holding vertex position, normal and texture UV coords.
struct HFCore::Geometry::VertexPosColTex VertexPosColTex
Struct holding vertex position, color and texture UV coords.
MagFilter
Magnification filter to use for Images.
Definition: Graphics.h:154
std::string shaderParamName
Shader uniform parameter name.
Definition: Geometry.h:315
std::vector< VertexPosCol > VertexPosColVector
typedef for Vector holding VertexPosCol struct.
Definition: Geometry.h:346
virtual VertexIndicesU16Vector getVertexIndicesU16Vector()=0
Get Geometry::VertexIndicesU16Vector vector.
Interface for RGBA Color.
Definition: Color.h:51
glm::vec3 position
Vertex position.
Definition: Geometry.h:181
virtual void setVertexColor(uint32_hf i, Color color)=0
Set vertex color.
virtual glm::vec3 getVertexPositionV3(uint32_hf i)=0
Get vertex position.
virtual Graphics::MinFilter getTextureMinFilter()=0
Get Graphics::MinFilter in use.
Vertex usage type: Color.
Definition: Geometry.h:104
virtual uint32_hf getNumIndices()=0
Get number of indices.
Vertex usage type: Texture UV coords.
Definition: Geometry.h:106
uint32_hf color
Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
Definition: Geometry.h:182
std::vector< VertexPosNorTex > VertexPosNorTexVector
typedef for Vector holding VertexPosNorTex struct.
Definition: Geometry.h:366
virtual void addVertexPosNorTex(fp32_hf posx, fp32_hf posy, fp32_hf posz, fp32_hf norx, fp32_hf nory, fp32_hf norz, fp32_hf u, fp32_hf v)=0
Add vertex position, normal and texture UV coordinates to internal vector.
std::vector< Texture > VertexTextureVector
typedef for Vector holding Texture struct.
Definition: Geometry.h:376
virtual void setDrawMode(Graphics::DrawMode drawMode)=0
Set the drawmode.
virtual Color getVertexColor(uint32_hf i)=0
Get vertex color.
virtual void setVertexPosColTex(uint32_hf i, fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color, fp32_hf u, fp32_hf v)=0
Set vertex position, color and texture UV coordinates.
std::vector< uint16_hf > VertexIndicesU16Vector
typedef for Vector holding vertex indices as uint16_hf.
Definition: Geometry.h:386
Vertex usage type: Blending weight data.
Definition: Geometry.h:109
virtual void setVertexIndexU32(uint32_hf i, uint32_hf val)=0
Set vertex index (indices buffer).
virtual glm::vec3 getVertexColorV3(uint32_hf i)=0
Get vertex color.
virtual ~Geometry()
Destructor.
Definition: Geometry.h:486
uint32_hf color
Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
Definition: Geometry.h:209
virtual void setVertexNormal(uint32_hf i, fp32_hf x, fp32_hf y, fp32_hf z)=0
Set vertex normal.
virtual void setShaderAttributeNames(ShaderAttribNames names)=0
Set Geometry::ShaderAttribNames names.
glm::vec2 uv
Vertex texture uv coords.
Definition: Geometry.h:267
std::vector< VertexPosColTex > VertexPosColTexVector
typedef for Vector holding VertexPosColTex struct.
Definition: Geometry.h:356
virtual void setTexture(uint32_hf i, Texture texture)=0
Set Texture struct.
virtual void addVertexIndexU16(uint16_hf val)=0
Add vertex index to internal vector.
struct HFCore::Geometry::Texture Texture
Struct holding texture and Shader uniform parameter name.
Interface for Resource type Shader.
Definition: Shader.h:108
Index type: Not set.
Definition: Geometry.h:338
bool operator==(const VertexPosColTex &other) const
Overload of binary operator ==.
Definition: Geometry.h:195
Vertex data type: glm::vec2.
Definition: Geometry.h:86
struct HFCore::Geometry::VertexAttribute VertexAttribute
Struct holding custom vertex attributes.
Vertex data type: Four-component, unsigned byte.
Definition: Geometry.h:90
uint32_hf color
Vertex color (Packed format GL: RGBA, D3D9: BGRA/ARGB).
Definition: Geometry.h:131
glm::vec3 position
Vertex position.
Definition: Geometry.h:208
Vertex type: Position, color and normal.
Definition: Geometry.h:328
virtual VertexPosColVector getVertexPosColVector()=0
Get Geometry::VertexPosColVector vector.
virtual void clearVertexVector(VertexType vertexType)=0
Clear vertex vector.
virtual VertexPosColTexVector getVertexPosColTexVector()=0
Get Geometry::VertexPosColTexVector vector.
virtual void setVertexPosNorTex(uint32_hf i, fp32_hf posx, fp32_hf posy, fp32_hf posz, fp32_hf norx, fp32_hf nory, fp32_hf norz, fp32_hf u, fp32_hf v)=0
Set vertex position, normal and texture UV coordinates.
virtual void setTextureMagFilter(Graphics::MagFilter magFilter)=0
Set Graphics::MagFilter to use for Image&#39;s.
virtual glm::vec2 getVertexPositionV2(uint32_hf i)=0
Get vertex position.
virtual void setVertexIndicesU16Vector(VertexIndicesU16Vector *vertexIndices)=0
Set the Geometry::VertexIndicesU16Vector to use.
virtual Texture getTexture(uint32_hf i)=0
Get Texture struct.
Definition: Actor.h:34
struct HFCore::Geometry::VertexPosCol VertexPosCol
Struct holding vertex position and color.
uint32_hf offsetBytes
Offset in bytes between vertex attributes.
Definition: Geometry.h:121
bool operator==(const VertexPosTex &other) const
Overload of binary operator ==.
Definition: Geometry.h:168
Interface for Resource type Image.
Definition: Image.h:63
virtual VertexTextureVector getVertexTextureVector()=0
Get Geometry::VertexTextureVector vector.
virtual void setVertexTextureVector(VertexTextureVector *vertexTextures)=0
Set the Geometry::VertexTextureVector to use.
Vertex type: Not set.
Definition: Geometry.h:323
virtual void setVertexPosTex(uint32_hf i, fp32_hf posx, fp32_hf posy, fp32_hf posz, fp32_hf u, fp32_hf v)=0
Set vertex position and texture UV coordinates.
virtual uint32_hf getVertexIndexU32(uint32_hf i)=0
Get vertex index.
Index type: uint16_hf.
Definition: Geometry.h:339
virtual ShaderAttribNames getShaderAttributeNames()=0
Get Geometry::ShaderAttribNames names.
std::string color
Shader attribute name for: color.
Definition: Geometry.h:303
Struct holding vertex position and color.
Definition: Geometry.h:128
virtual void setCustomVertexData(VertexAttributeVector *vertexAttributeVector, void *data, uint32_hf numVertices, uint32_hf dataSizeBytes)=0
Set Custom Vertex Attributes and data.
virtual void setVertexTextureUVCoords(uint32_hf i, fp32_hf u, fp32_hf v)=0
Set vertex texture UV coordinates.
virtual void clearVertexTextureVector()=0
Clear vertex texture vector.
std::vector< uint32_hf > VertexIndicesU32Vector
typedef for Vector holding vertex indices as uint32_hf.
Definition: Geometry.h:381
glm::vec2 uv
Vertex texture uv coords.
Definition: Geometry.h:183
Geometry(HF_BufferUsage bufferUsage, VertexPosColTexVector *vertexPosColTex, VertexTextureVector *vertexTextures=NULL)
Constructor.
Definition: Geometry.h:433
Struct holding vertex position, normal and texture UV coords.
Definition: Geometry.h:234
Vertex type: Position and color.
Definition: Geometry.h:325
Geometry(Geometry::VertexType vertexType, HF_BufferUsage bufferUsage, uint32_hf bufferSize)
Constructor.
Definition: Geometry.h:402
virtual void addVertexIndexU32(uint32_hf val)=0
Add vertex index to internal vector.
Geometry(HF_BufferUsage bufferUsage, VertexPosColNorTexVector *vertexPosColNorTex, VertexTextureVector *vertexTextures=NULL)
Constructor.
Definition: Geometry.h:465
VertexDataType vertexDataType
Vertex data type.
Definition: Geometry.h:119
Vertex usage type: Blending indices data.
Definition: Geometry.h:110
virtual uint32_hf getNumTextures()=0
Get number of textures.
Geometry(HF_BufferUsage bufferUsage, VertexAttributeVector *vertexAttribVector, void *data, uint32_hf numVertices, uint32_hf dataSizeBytes)
Constructor.
Definition: Geometry.h:478
Vertex type: Position, color, normal and texture uv.
Definition: Geometry.h:330
std::string normal
Shader attribute name for: normal.
Definition: Geometry.h:304
virtual void setVertexVector(VertexPosColVector *vertexPosCol)=0
Set the Geometry::VertexPosColVector to use.
VertexDataType
Enum holding custom vertex data type.
Definition: Geometry.h:82
Vertex data type: glm::vec4.
Definition: Geometry.h:88
glm::vec3 normal
Vertex normal.
Definition: Geometry.h:210
virtual void setTextureMinFilter(Graphics::MinFilter minFilter)=0
Set Graphics::MinFilter to use for Image&#39;s.
struct HFCore::Geometry::VertexPosTex VertexPosTex
Struct holding vertex position and texture UV coords.
virtual void setVertexPosColNor(uint32_hf i, fp32_hf posx, fp32_hf posy, fp32_hf posz, Color color, fp32_hf norx, fp32_hf nory, fp32_hf norz)=0
Set vertex position, color and normal.
glm::vec3 position
Vertex position.
Definition: Geometry.h:236
glm::vec2 uv
Vertex texture uv coords.
Definition: Geometry.h:156
virtual Graphics::DrawMode getDrawMode()=0
Get the drawmode.
float fp32_hf
A type definition for float.
Definition: HFDataTypes.h:359
virtual HF_BufferUsage getBufferUsage()=0
Get buffer usage.
bool operator==(const VertexPosNorTex &other) const
Overload of binary operator ==.
Definition: Geometry.h:250
glm::vec3 position
Vertex position.
Definition: Geometry.h:130
std::string position
Shader attribute name for: position.
Definition: Geometry.h:302
HF_BufferUsage
Buffer usage enum.
Definition: HFDataTypes.h:643