File: x3d.h

package info (click to toggle)
searchandrescue 0.8.2-10
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,656 kB
  • ctags: 6,111
  • sloc: ansic: 89,072; cpp: 7,691; sh: 90; makefile: 80
file content (93 lines) | stat: -rw-r--r-- 1,942 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
			       X3D Format Library
 */

#ifndef X3D_H
#define X3D_H

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <GL/gl.h>


/*
 *	Mazimum length of a parameter name:
 */
#define X3D_PARM_MAX	80


/*
 *	X3D format interpretation values:
 */
typedef struct {

#define X3D_VALUE_FLAG_COORDINATE_SYSTEM	(1 << 0)
#define X3D_VALUE_FLAG_SCALE			(1 << 1)
#define X3D_VALUE_FLAG_OFFSET			(1 << 2)
#define X3D_VALUE_FLAG_SKIP_COLORS		(1 << 3)
#define X3D_VALUE_FLAG_SKIP_TEXTURES		(1 << 4)
#define X3D_VALUE_FLAG_SKIP_NORMALS		(1 << 5)
#define X3D_VALUE_FLAG_SKIP_TEXCOORDS		(1 << 6)
#define X3D_VALUE_FLAG_SKIP_VERTICES		(1 << 7)
#define X3D_VALUE_FLAG_SKIP_TRANSLATES		(1 << 8)
#define X3D_VALUE_FLAG_SKIP_ROTATES		(1 << 9)
#define X3D_VALUE_FLAG_SKIP_STATE_CHANGES	(1 << 10)
	unsigned long	flags;

#define X3D_COORDINATE_SYSTEM_XYZ	0	/* x, y, z */
#define X3D_COORDINATE_SYSTEM_GL	1	/* x, z, -y */
	int	coordinate_system;

	GLfloat		scale_x,		/* Coefficient. */
			scale_y,
			scale_z;

	GLfloat		offset_x,		/* Meters, applied after scale. */
			offset_y,
			offset_z;

} X3DInterpValues;
#define X3D_INTERP_VALUES(p)	((X3DInterpValues *)(p))
#define X3D_DEFAULT_VALUE_FLAGS	X3D_VALUE_FLAG_COORDINATE_SYSTEM


/*
 *	X3D texture reference:
 */
typedef struct {

	char	*name;		/* Name of this texture. */
	GLuint	id;		/* GL texture id. */

} X3DTextureRef;
#define X3D_TEXTURE_REF(p)	((X3DTextureRef *)(p))


extern GLuint X3DOpenDataGLList(
	char **data,
	const X3DInterpValues *v,
	X3DTextureRef **texture, int total_textures
);
extern void X3DOpenDataGLOutput(
	char **data,
	const X3DInterpValues *v,
	X3DTextureRef **texture, int total_textures
);

extern X3DTextureRef *X3DTextureRefAppend(
	X3DTextureRef ***texture, int *total_textures,
	const char *name,
	GLuint id
);
extern void X3DTextureDeleteAll(
	X3DTextureRef ***texture, int *total_textures
);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif	/* X3D_H */