DI-Guy SDK Documentation
13.1
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
diguyGraphicsVertexFormats.h
Go to the documentation of this file.
1
2
/*********************************************************************
3
** Copyright (c) 1992-2015 VT MAK
4
** All rights reserved.
5
*********************************************************************/
6
7
/*********************************************************************/
14
#ifndef __diguyGraphicsVertexFormats_H
15
#define __diguyGraphicsVertexFormats_H
16
17
#ifdef SWIG
18
%module
diguyGraphicsVertexFormats
19
#else
20
#define CPLUSPLUS_ONLY
21
#include <
diguy_constants.h
>
22
#include <
declspec_diguy.h
>
23
#endif
24
25
26
/****************************************************************************/
27
/*l
28
*b Description:
29
**
30
** This enumeration lists types of vertex data formats DI-Guy may use.
31
** In general the same vertex format meshes will use cannot be
32
** the same for all meshes, as static meshes don't use indices and
33
** weights, but dynamic meshes (e.g., skinned meshes) do.
34
**
35
** The data member use_array_format_for_vertex_buffer_data of the
36
** bdiGraphicsInitGraphicsAPI structure can be used to specify
37
** whether interleaved or array format is to be used.
38
**
39
** See diguyGraphicsMesh::get_vertex_format().
40
**
41
*i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2
42
**
43
** The most basic vertex format DI-Guy supports: One vertex position,
44
** one normal, and one UV texture coordinate. These values are
45
** interleaved like so:
46
*>
47
** vnt vnt vnt vnt ...
48
*<
49
** Where 'v' represents three floats specifying vertex position, 'n'
50
** represents three floats specifying normal direction, and 't'
51
** represents two floats specifying texture indices.
52
**
53
** This format is commonly used by static meshes. It cannot be used
54
** by skinned meshes.
55
**
56
*i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_ARRAYS
57
**
58
** This vertex format puts all vertices first, followed by all normals,
59
** followed by all texture indices:
60
*>
61
*- vvvv vvvv ... nnnn nnnn .. tttt tttt ...
62
**
63
** This format is commonly used by static meshes. It cannot be used
64
** by skinned meshes.
65
*<
66
*i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4
67
**
68
** Vertices for skinned meshes require more info; specifically, they
69
** need the indices of the links/bones that influence them and the
70
** weights of said influences. DI-Guy supports at most 4 link
71
** influences per vertex.
72
**
73
** Indices are stored as floats instead of an int or unsigned int
74
** because data passed to shaders in attribute variables (at least for
75
** glsl shaders) needs to be in float form, not int.
76
**
77
** These values are interleaved like so:
78
*>
79
*- vntiw vntiw vntiw vntiw ...
80
*<
81
** Where 'i' and 'w' each represent four floats specifying indices
82
** and weights, respectively.
83
**
84
** This format is commonly used by skinned meshes. It could be used
85
** by static meshes, but doing so would waste memory.
86
**
87
*i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4_ARRAYS
88
**
89
** Similar to DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4, but values
90
** are not interleaved:
91
*>
92
*- vvvv ... nnnn .. tttt ... iiii ... wwww ...
93
**
94
** This format is commonly used by skinned meshes. It could be used
95
** by static meshes, but doing so would waste memory.
96
*<
97
*/
98
typedef
enum
99
{
100
DIGUY_GRAPHICS_VERTEX_FORMAT_UNKNOWN
= -1,
101
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2
= 0,
102
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_ARRAYS
= 1,
103
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4
= 2,
104
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4_ARRAYS
= 3,
105
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4_I4F_W4
= 4,
106
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4
= 5
107
}
diguyGraphicsVertexFormat
;
108
109
110
/****************************************************************************/
111
/*l
112
*b Description:
113
**
114
** This enumeration lists the types that indices stored in index buffer
115
** data might have.
116
**
117
** The data member default_vertex_type of the bdiGraphicsInitGraphicsAPI
118
** structure can be used to specify which index type is needed.
119
**
120
** Also see diguyGraphicsMesh::get_index_type().
121
**
122
** Note that indices in index buffer data are different than the indices
123
** contained in vertex buffer data. Index buffer indices specify which
124
** *vertices* in vertex buffer data are used to create polygons in a mesh
125
** (e.g., for the first triangle, use vertices 0, 1, and 2), while indices
126
** stored in vertex buffer data specify which *links* affect the final
127
** position of the vertex.
128
**
129
*i DIGUY_GRAPHICS_INDEX_TYPE_UINT
130
**
131
** Index buffer data is stored as unsigned integers (4 bytes).
132
**
133
*i DIGUY_GRAPHICS_INDEX_TYPE_USHORT
134
**
135
** Index buffer data is stored as unsigned short integers (2 bytes).
136
**
137
*i DIGUY_GRAPHICS_INDEX_TYPE_D3D_WORD
138
**
139
** Index buffer data is stored as Windows WORD type. This is a 32 bit
140
** unsigned integer, so it's really the same as
141
** DIGUY_GRAPHICS_INDEX_TYPE_UINT.
142
*/
143
typedef
enum
144
{
145
DIGUY_GRAPHICS_INDEX_TYPE_UNKNOWN
= -1,
146
DIGUY_GRAPHICS_INDEX_TYPE_UINT
= 0,
147
DIGUY_GRAPHICS_INDEX_TYPE_USHORT
= 1,
148
DIGUY_GRAPHICS_INDEX_TYPE_D3D_WORD
= 2
149
150
}
diguyGraphicsIndexType
;
151
152
153
#endif
/* __diguyGraphicsVertexFormats_H */
154
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4
Definition:
diguyGraphicsVertexFormats.h:103
DIGUY_GRAPHICS_INDEX_TYPE_UINT
Definition:
diguyGraphicsVertexFormats.h:141
diguy_constants.h
DIGUY_GRAPHICS_INDEX_TYPE_USHORT
Definition:
diguyGraphicsVertexFormats.h:142
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_ARRAYS
Definition:
diguyGraphicsVertexFormats.h:99
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4_I4F_W4
Definition:
diguyGraphicsVertexFormats.h:102
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2
Definition:
diguyGraphicsVertexFormats.h:98
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4_ARRAYS
Definition:
diguyGraphicsVertexFormats.h:101
diguyGraphicsVertexFormats
declspec_diguy.h
DIGUY_GRAPHICS_INDEX_TYPE_UNKNOWN
Definition:
diguyGraphicsVertexFormats.h:140
DIGUY_GRAPHICS_INDEX_TYPE_D3D_WORD
Definition:
diguyGraphicsVertexFormats.h:143
DIGUY_GRAPHICS_VERTEX_FORMAT_UNKNOWN
Definition:
diguyGraphicsVertexFormats.h:97
diguyGraphicsIndexType
diguyGraphicsIndexType
This enumeration lists the types that indices stored in index buffer data might have.
Definition:
diguyGraphicsVertexFormats.h:138
diguyGraphicsVertexFormat
diguyGraphicsVertexFormat
This enumeration lists types of vertex data formats DI-Guy may use.
Definition:
diguyGraphicsVertexFormats.h:95
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4
Definition:
diguyGraphicsVertexFormats.h:100
include
diguyGraphicsVertexFormats.h
Generated on Mon Sep 7 2015 20:33:56 for DI-Guy SDK Documentation by
1.8.9.1