/
mojodds.h
62 lines (50 loc) · 1.91 KB
1
2
3
4
5
6
/**
* MojoDDS; tools for dealing with DDS files.
*
* Please see the file LICENSE.txt in the source's root directory.
*/
7
8
9
10
#ifndef _INCL_MOJODDS_H_
#define _INCL_MOJODDS_H_
/* !!! FIXME: flesh this file out. */
11
12
13
#ifdef __cplusplus
extern "C" {
#endif
14
15
16
17
18
19
20
21
typedef enum MOJODDS_textureType
{
MOJODDS_TEXTURE_2D,
MOJODDS_TEXTURE_CUBE,
MOJODDS_TEXTURE_VOLUME
} MOJODDS_textureType;
22
23
24
/* order and values for these matter, they are used for calculating offsets
lucky for us both DDS and OpengGL order matches */
25
26
typedef enum MOJODDS_cubeFace
{
27
28
29
30
31
32
33
34
35
MOJODDS_CUBEFACE_POSITIVE_X,
MOJODDS_CUBEFACE_NEGATIVE_X,
MOJODDS_CUBEFACE_POSITIVE_Y,
MOJODDS_CUBEFACE_NEGATIVE_Y,
MOJODDS_CUBEFACE_POSITIVE_Z,
MOJODDS_CUBEFACE_NEGATIVE_Z
} MOJODDS_cubeFace;
36
int MOJODDS_isDDS(const void *_ptr, const unsigned long _len);
37
int MOJODDS_getTexture(const void *_ptr, const unsigned long _len,
38
39
const void **_tex, unsigned long *_texlen,
unsigned int *_glfmt, unsigned int *_w,
40
41
42
unsigned int *_h, unsigned int *_miplevels,
unsigned int *_cubemapfacelen,
MOJODDS_textureType *_textureType);
43
int MOJODDS_getMipMapTexture(unsigned int miplevel, unsigned int glfmt,
44
const void *_basetex,
45
46
47
unsigned int w, unsigned h,
const void **_tex, unsigned long *_texlen,
unsigned int *_texw, unsigned int *_texh);
48
49
50
int MOJODDS_getCubeFace(MOJODDS_cubeFace cubeFace, unsigned int miplevel,
unsigned int glfmt, const void*_basetex,
51
unsigned long _cubemapfacelen, unsigned int w, unsigned h,
52
53
54
const void **_tex, unsigned long *_texlen,
unsigned int *_texw, unsigned int *_texh);
55
56
#ifdef __cplusplus
}
57
58
#endif
59
#endif
60
61
/* end of mojodds.h ... */