GteVertexAttribute.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.3.0 (2016/08/29)
7 
8 #pragma once
9 
10 #include <GTEngineDEF.h>
11 #include <string>
12 
13 namespace gte
14 {
15 
17 {
18  inline VertexAttribute();
19  inline VertexAttribute(std::string const& inSemantic, void* inSource, size_t inStride);
20 
21  // The 'semantic' string allows you to query for a specific vertex
22  // attribute and use the 'source' and 'stride' to access the data
23  // of the attribute. For example, you might use the semantics
24  // "position" (px,py,pz), "normal" (nx,ny,nz), "tcoord" (texture
25  // coordinates (u,v)), "dpdu" (derivative of position with respect
26  // to u), or "dpdv" (derivative of position with respect to v) for
27  // mesh vertices.
28  //
29  // The source pointer must be 4-byte aligned. The stride must be
30  // positive and a multiple of 4. The pointer alignment constraint is
31  // guaranteed on 32-bit and 64-bit architectures. The stride constraint
32  // is reasonable given that (usually) geometric attributes are usually
33  // arrays of 'float' or 'double'.
34 
36  void* source;
37  size_t stride;
38 };
39 
41  :
42  semantic(""),
43  source(nullptr),
44  stride(0)
45 {
46 }
47 
48 inline VertexAttribute::VertexAttribute(std::string const& inSemantic, void* inSource, size_t inStride)
49  :
50  semantic(inSemantic),
51  source(inSource),
52  stride(inStride)
53 {
54 }
55 
56 }
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:798
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
GLint GLenum GLboolean GLsizei stride
Definition: glcorearb.h:867


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:02