File: v3dtex.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 (85 lines) | stat: -rw-r--r-- 2,202 bytes parent folder | download | duplicates (7)
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
/*
				 V3D Texture
 */

#ifndef V3DTEX_H
#define V3DTEX_H

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


/*
 *	Texture Formats:
 */
typedef enum {
	V3D_TEX_FORMAT_RGB,
	V3D_TEX_FORMAT_RGBA,
	V3D_TEX_FORMAT_LUMINANCE,
	V3D_TEX_FORMAT_LUMINANCE_ALPHA
} v3d_tex_format;


/*
 *	Texture Reference:
 */
typedef struct {

	char		*name;		/* Reference name (any arbitary name) */
	char		*filename;	/* Full path file name */

	float		priority;	/* Texture memory residency priority
					 * (0.0. to 1.0, 1.0 is highest) */

	void		**data;		/* Array of GLint id's for each texture */
	int		total_frames;	/* Number of textures (size of member data */

	int		width,		/* Size of each frame in pixels */
			height;

	int		dimensions;	/* 1, 2, or 3 */

} v3d_texture_ref_struct;

extern void V3DTextureSelectFrame(v3d_texture_ref_struct *t, int frame_num);
extern void V3DTextureSelect(v3d_texture_ref_struct *t);
extern v3d_texture_ref_struct *V3DTextureLoadFromFile2D(
	const char *path,	/* Filename containing texture data */
	const char *name,	/* Name of texture for referancing */
	v3d_tex_format dest_fmt,
	void *client_data,
	int (*progress_cb)(void *, int, int)
);
extern v3d_texture_ref_struct *V3DTextureLoadFromFile2DPreempt(
	const char *path,	/* Filename containing texture data */
	const char *name,	/* Name of texture for referancing */
	v3d_tex_format dest_fmt
);
extern v3d_texture_ref_struct *V3DTextureLoadFromData1D(
	const void *data,	/* Texture data */
	const char *name,	/* Name of texture for referancing */
	int width,
	int bytes_per_pixel,	/* Bytes per pixel of data */
	v3d_tex_format dest_fmt,
	void *client_data,
	int (*progress_cb)(void *, int, int)
);
extern v3d_texture_ref_struct *V3DTextureLoadFromData2D(
	const void *data,	/* Texture data */
	const char *name,	/* Name of texture for referancing */
	int width, int height,
	int bytes_per_pixel,	/* Bytes per pixel of data */
	v3d_tex_format dest_fmt,
	void *client_data,
	int (*progress_cb)(void *, int, int)
);
extern void V3DTexturePriority(v3d_texture_ref_struct *t, float priority);
extern void V3DTextureDestroy(v3d_texture_ref_struct *t);


#ifdef __cplusplus
}  
#endif /* __cplusplus */

#endif	/* V3DTEX_H */