DI-Guy SDK Documentation  13.5
diguyGraphicsVertexFormats.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2020 MAK Technologies, Inc.
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  *<
57  *i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4
58  **
59  ** Vertices for skinned meshes require more info; specifically, they
60  ** need the indices of the links/bones that influence them and the
61  ** weights of said influences. DI-Guy supports at most 4 link
62  ** influences per vertex.
63  **
64  ** Indices are stored as floats instead of an int or unsigned int
65  ** because data passed to shaders in attribute variables (at least for
66  ** glsl shaders) needs to be in float form, not int.
67  **
68  ** These values are interleaved like so:
69  *>
70  *- vntiw vntiw vntiw vntiw ...
71  *<
72  ** Where 'i' and 'w' each represent four floats specifying indices
73  ** and weights, respectively.
74  **
75  ** This format is commonly used by skinned meshes. It could be used
76  ** by static meshes, but doing so would waste memory.
77  **
78  *<
79  ** \ingroup diguyGraphicsAPI
80  */
81 typedef enum
82 {
89 
90 /****************************************************************************/
91 /*l
92  *b Description:
93  **
94  ** This enumeration lists the type that indices stored in index buffer
95  ** data might have.
96  **
97  ** Also see diguyGraphicsMesh::get_index_type().
98  **
99  ** Note that indices in index buffer data are different than the indices
100  ** contained in vertex buffer data. Index buffer indices specify which
101  ** *vertices* in vertex buffer data are used to create polygons in a mesh
102  ** (e.g., for the first triangle, use vertices 0, 1, and 2), while indices
103  ** stored in vertex buffer data specify which *links* affect the final
104  ** position of the vertex.
105  **
106  *i DIGUY_GRAPHICS_INDEX_TYPE_UINT
107  **
108  ** Index buffer data is stored as unsigned integers (4 bytes).
109  **
110  *i DIGUY_GRAPHICS_INDEX_TYPE_USHORT
111  **
112  ** Index buffer data is stored as unsigned short integers (2 bytes).
113  **
114  ** Unless the mesh has more then 65k verts the data will be unsigned shorts.
115  **
116  ** \ingroup diguyGraphicsAPI
117  */
118 typedef enum
119 {
123 
125 
126 
127 #endif /* __diguyGraphicsVertexFormats_H */
128 
Definition: diguyGraphicsVertexFormats.h:84
Definition: diguyGraphicsVertexFormats.h:80
Definition: diguyGraphicsVertexFormats.h:82
Definition: diguyGraphicsVertexFormats.h:116
Definition: diguyGraphicsVertexFormats.h:81
Definition: diguyGraphicsVertexFormats.h:118
diguyGraphicsIndexType
This enumeration lists the type that indices stored in index buffer data might have.
Definition: diguyGraphicsVertexFormats.h:114
Definition: diguyGraphicsVertexFormats.h:117
Definition: diguyGraphicsVertexFormats.h:83
diguyGraphicsVertexFormat
This enumeration lists types of vertex data formats DI-Guy may use.
Definition: diguyGraphicsVertexFormats.h:78