C++ SDK Reference  12.5
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguy_graphics_api.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 1992-2013 Boston Dynamics
4  * ALL RIGHTS RESERVED.
5  *
6  * These coded instructions, statements, and computer programs
7  * contain unpublished proprietary information of Boston Dynamics
8  * and are protected by Copyright Laws of the United States.
9  * They may not be used, duplicated, or disclosed in any form, in
10  * whole or in part, without the prior written consent from Boston
11  * Dynamics.
12  *
13  * RESTRICTED RIGHTS LEGEND
14  * Use, duplication, or disclosure by the government is subject
15  * to restrictions as set forth in FAR 52.227.19(c)(2) or
16  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
17  * Computer Software clause at DFARS 252.227-7013 and/or in
18  * similar or successor clauses in the FAR, or the DOD or NASA
19  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
20  * Commercial Computer Software--Restricted Rights at 48 CFR
21  * 52.227-19, as applicable. Unpublished-rights reserved under
22  * the Copyright Laws of the United States.
23  * Contractor/Manufacturer is:
24  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
25  */
26 
27 /*********************************************************************
28  **
29  *t DI-Guy API, Info Graphics Module
30  **
31  *b Link against: libdiguy_graphics_api
32  */
33 
34 #ifndef __diguy_graphics_api_H
35 #define __diguy_graphics_api_H
36 
37 #include <diguy_api.h>
38 #include <diguy_typedefs.h>
40 
41 // these typedefs have actually been moved to diguy_typedefs.h but very few files depend on this
42 // header file so it's not worth breaking backwards compatibility to remove these.
43 #include <diguyGraphicsLink.h> // for diguyGraphicsLinkCreateFunc
44 #include <diguyGraphicsShape.h> // for diguyGraphicsShapeCreateFunc
45 #include <diguyGraphicsFile.h> // for diguyGraphicsFileCreateFunc
46 #include <diguyGraphicsState.h> // for diguyGraphicsStateCreateFunc
47 #include <diguyGraphicsMaterial.h> // for diguyGraphicsMaterialCreateFunc
48 #include <diguyGraphicsTexture.h> // for diguyGraphicsTextureCreateFunc
49 #include <diguyGraphicsMesh.h> // for diguyGraphicsMeshCreateFunc
50 #include <diguyGraphicsShaderProgram.h> // for diguyGraphicsShaderProgramCreateFunc
51 #include <diguyGraphicsShaderInstance.h> // for diguyGraphicsShaderInstanceCreateFunc
52 
54 
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58 
59 
60 /*****************************************************************************/
67 /*l
68  *b Description:
69  **
70  ** This function initializes the DI-Guy Runtime API for accessing
71  ** information about DI-Guy graphics and geometry.
72  **
73  ** Use diguy_graphics_get_defaults() to fill out the init structure
74  ** before changing specific entries.
75  **
76  *b Arguments:
77  **
78  *a init - pointer to type bdiGraphicsInitGraphicsAPI; passing NULL
79  *a will cause defaults to be used for all values
80  **
81  *b Returns:
82  **
83  ** 0 on success, non-zero error code on failure
84  **
85  ** Refer to diguy_constants.h for error code values.
86  **
87  ** \ingroup diguyGraphicsAPI
88  */
89 BDI_DECLSPEC_diguy_graphics int
91 
92 /*l
93  *b Description:
94  **
95  ** Fills out the init structure with default values. Selected entries
96  ** can then be changed before calling diguy_graphics_initialize().
97  **
98  ** The default values are:
99  *- - init->use_array_format_for_vertex_buffer_data = 0;
100  *- - init->default_vertex_type = DIGUY_GRAPHICS_INDEX_TYPE_USHORT;
101  *- - init->use_shaders = 1;
102  *- - init->shader_language = DIGUY_GRAPHICS_SHADER_LANGUAGE_GLSL;
103  *- - init->transpose_shader_matrices = 0;
104  *- - init->use_4x3_shader_matrices = 1;
105  *- - init->use_cached_optimized_geometry = 1;
106  *- - init->use_cached_compressed_textures = 1;
107  *- - init->use_sRGB_corrected_textures = 1;
108  *- - init->characters_have_world_space_triangle_query = 0;
109  *- - init->scene_objects_have_world_space_triangle_query = 0;
110  *- - init->use_linear_traversal_draw = 1;
111  **
112  *b Arguments:
113  **
114  *a init - pointer to type bdiGraphicsInitGraphicsAPI
115  **
116  *b Returns:
117  **
118  ** 0 on success, -1 on failure
119  */
120 BDI_DECLSPEC_diguy_graphics int
122 
123 /*l
124  *b Description:
125  **
126  ** Fills out the init structure with default OSG values. Selected entries
127  ** can then be changed before calling diguy_graphics_initialize().
128  **
129  ** The differences for the default values are:
130  *- - init->transpose_shader_matrices = 1;
131  *- - init->use_4x3_shader_matrices = 0;
132  *- - init->use_sRGB_corrected_textures = 0;
133  **
134  *b Arguments:
135  **
136  *a init - pointer to type bdiGraphicsInitGraphicsAPI
137  **
138  *b Returns:
139  **
140  ** 0 on success, -1 on failure
141  */
142 BDI_DECLSPEC_diguy_graphics int
144 
145 /*l
146  *b Description:
147  **
148  ** Fills out the init structure with default values. Selected entries
149  ** can then be changed before calling diguy_graphics_initialize().
150  **
151  ** The differences for the default values are:
152  *- - init->transpose_shader_matrices = 1
153  *- - init->use_4x3_shader_matrices = 0
154  *- - init->shader_language = DIGUY_GRAPHICS_SHADER_LANGUAGE_HLSL
155  **
156  *b Arguments:
157  **
158  *a init - pointer to type bdiGraphicsInitGraphicsAPI
159  **
160  *b Returns:
161  **
162  ** 0 on success, -1 on failure
163  */
164 
165 BDI_DECLSPEC_diguy_graphics int
167 
168 /*l
169  *b Description:
170  **
171  ** This function turns far position rendering on or off. It must be
172  ** called after diguy_graphics_initialize().
173  **
174  *b Arguments:
175  **
176  *a flag - pass 1 to turn far positions on, 0 to turn them off
177  **
178  */
179 BDI_DECLSPEC_diguy_graphics
181 
182 /*l
183  *b Description:
184  **
185  ** This function gets the status of far position rendering.
186  ** It can only be called after diguy_graphics_initialize().
187  **
188  *b Returns:
189  **
190  ** 1 if far position rendering is on, 0 if not
191  **
192  */
193 BDI_DECLSPEC_diguy_graphics
195 
196 
197 /*****************************************************************************/
208 BDI_DECLSPEC_diguy_graphics int
210 
214 BDI_DECLSPEC_diguy_graphics int
216 
220 BDI_DECLSPEC_diguy_graphics int
222 
226 BDI_DECLSPEC_diguy_graphics int
228 
232 BDI_DECLSPEC_diguy_graphics int
234 
238 BDI_DECLSPEC_diguy_graphics int
240 
244 BDI_DECLSPEC_diguy_graphics int
246 
250 BDI_DECLSPEC_diguy_graphics int
252 
256 BDI_DECLSPEC_diguy_graphics int
258 
262 BDI_DECLSPEC_diguy_graphics int
264 
268 BDI_DECLSPEC_diguy_graphics int
270 
271 #ifdef __cplusplus
272 }
273 #endif
274 
275 
276 #endif /* __diguy_graphics_api_H */
277 
278 
279 /*
280  * Copyright (C) 1992-2013 Boston Dynamics
281  * ALL RIGHTS RESERVED.
282  *
283  * These coded instructions, statements, and computer programs
284  * contain unpublished proprietary information of Boston Dynamics
285  * and are protected by Copyright Laws of the United States.
286  * They may not be used, duplicated, or disclosed in any form, in
287  * whole or in part, without the prior written consent from Boston
288  * Dynamics.
289  *
290  * RESTRICTED RIGHTS LEGEND
291  * Use, duplication, or disclosure by the government is subject
292  * to restrictions as set forth in FAR 52.227.19(c)(2) or
293  * subparagraph (c)(1)(ii) of the Rights in Technical Data and
294  * Computer Software clause at DFARS 252.227-7013 and/or in
295  * similar or successor clauses in the FAR, or the DOD or NASA
296  * FAR Supplement, or to subparagraphs (c)(1) and (c)(2) of the
297  * Commercial Computer Software--Restricted Rights at 48 CFR
298  * 52.227-19, as applicable. Unpublished-rights reserved under
299  * the Copyright Laws of the United States.
300  * Contractor/Manufacturer is:
301  * Boston Dynamics/78 Fourth Avenue/Waltham MA 02451.
302  */
303