Main Page
Namespaces
Classes
Files
File List
File Members
include
Graphics
GteVertexFormat.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.0.0 (2016/06/19)
7
8
#pragma once
9
10
#include <
Graphics/GteDataFormat.h
>
11
12
namespace
gte
13
{
14
15
// Enumerations for DX11.
16
enum
GTE_IMPEXP
VASemantic
17
{
18
VA_NO_SEMANTIC
,
19
VA_POSITION
,
20
VA_BLENDWEIGHT
,
21
VA_BLENDINDICES
,
22
VA_NORMAL
,
23
VA_PSIZE
,
24
VA_TEXCOORD
,
25
VA_TANGENT
,
26
VA_BINORMAL
,
27
VA_TESSFACTOR
,
28
VA_POSITIONT
,
29
VA_COLOR
,
30
VA_FOG
,
31
VA_DEPTH
,
32
VA_SAMPLE
,
33
VA_NUM_SEMANTICS
34
};
35
36
enum
GTE_IMPEXP
VAConstant
37
{
38
// TODO: Modify to the numbers for Shader Model 5 (DX11).
39
40
// The maximum number of attributes for a vertex format.
41
VA_MAX_ATTRIBUTES
= 16,
42
43
// The maximum number of texture coordinate units.
44
VA_MAX_TCOORD_UNITS
= 8,
45
46
// The maximum number of color units.
47
VA_MAX_COLOR_UNITS = 2
48
};
49
50
class
GTE_IMPEXP
VertexFormat
51
{
52
public
:
53
// Construction.
54
VertexFormat
();
55
56
// Create a packed vertex format, where all attributes are contiguous in
57
// memory. The order of the attributes is determined by the order of
58
// Bind calls.
59
bool
Bind(VASemantic semantic, DFType
type
,
unsigned
int
unit);
60
61
// Member access. GetAttribute returns 'true' when the input i is
62
// such that 0 <= i < GetNumAttributes(), in which case the returned
63
// semantic, type, unit, and offset are valid.
64
unsigned
int
GetVertexSize()
const
;
65
int
GetNumAttributes()
const
;
66
bool
GetAttribute(
int
i, VASemantic& semantic, DFType& type,
67
unsigned
int
& unit,
unsigned
int
&
offset
)
const
;
68
69
// Determine whether a semantic/unit exists. If so, return the
70
// index i that can be used to obtain more information about the
71
// attribute by the functions after this. If not, return -1.
72
int
GetIndex(VASemantic semantic,
unsigned
int
unit)
const
;
73
DFType GetType(
int
i)
const
;
74
unsigned
int
GetOffset(
int
i)
const
;
75
76
private
:
77
class
GTE_IMPEXP
Attribute
78
{
79
public
:
80
Attribute
();
81
VASemantic
semantic
;
82
DFType
type
;
83
unsigned
int
unit
;
84
unsigned
int
offset
;
85
};
86
87
int
mNumAttributes
;
88
unsigned
int
mVertexSize
;
89
Attribute
mAttributes[
VA_MAX_ATTRIBUTES
];
90
};
91
92
}
VA_TEXCOORD
VA_TEXCOORD
Definition:
GteVertexFormat.h:18
VA_NO_SEMANTIC
VA_NO_SEMANTIC
Definition:
GteVertexFormat.h:18
VA_MAX_TCOORD_UNITS
VA_MAX_TCOORD_UNITS
Definition:
GteVertexFormat.h:44
VA_NORMAL
VA_NORMAL
Definition:
GteVertexFormat.h:18
gte::VertexFormat::Attribute::unit
unsigned int unit
Definition:
GteVertexFormat.h:83
gte::VertexFormat::mNumAttributes
int mNumAttributes
Definition:
GteVertexFormat.h:87
VA_MAX_ATTRIBUTES
VA_MAX_ATTRIBUTES
Definition:
GteVertexFormat.h:41
gte::VertexFormat::Attribute::semantic
VASemantic semantic
Definition:
GteVertexFormat.h:81
VA_BLENDWEIGHT
VA_BLENDWEIGHT
Definition:
GteVertexFormat.h:18
VA_BLENDINDICES
VA_BLENDINDICES
Definition:
GteVertexFormat.h:18
VA_SAMPLE
VA_SAMPLE
Definition:
GteVertexFormat.h:18
VA_FOG
VA_FOG
Definition:
GteVertexFormat.h:18
gte::VertexFormat::Attribute::offset
unsigned int offset
Definition:
GteVertexFormat.h:84
gte::VertexFormat::Attribute
Definition:
GteVertexFormat.h:77
VA_POSITION
VA_POSITION
Definition:
GteVertexFormat.h:18
gte
Definition:
GLX/GteWICFileIO.h:16
VA_BINORMAL
VA_BINORMAL
Definition:
GteVertexFormat.h:18
VA_TESSFACTOR
VA_TESSFACTOR
Definition:
GteVertexFormat.h:18
VA_TANGENT
VA_TANGENT
Definition:
GteVertexFormat.h:18
gte::VertexFormat::Attribute::type
DFType type
Definition:
GteVertexFormat.h:82
VA_COLOR
VA_COLOR
Definition:
GteVertexFormat.h:18
VA_POSITIONT
VA_POSITIONT
Definition:
GteVertexFormat.h:18
VA_DEPTH
VA_DEPTH
Definition:
GteVertexFormat.h:18
offset
GLintptr offset
Definition:
glcorearb.h:660
VA_PSIZE
VA_PSIZE
Definition:
GteVertexFormat.h:18
gte::VertexFormat
Definition:
GteVertexFormat.h:50
GteDataFormat.h
GTE_IMPEXP
#define GTE_IMPEXP
Definition:
GTEngineDEF.h:63
type
GLint GLint GLsizei GLint GLenum GLenum type
Definition:
glcorearb.h:103
gte::VertexFormat::mVertexSize
unsigned int mVertexSize
Definition:
GteVertexFormat.h:88
geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:02