FreeWRL / FreeX3D
4.3.0
Textures.h
1
/*
2
3
4
Screen snapshot.
5
6
*/
7
8
/****************************************************************************
9
This file is part of the FreeWRL/FreeX3D Distribution.
10
11
Copyright 2009 CRC Canada. (http://www.crc.gc.ca)
12
13
FreeWRL/FreeX3D is free software: you can redistribute it and/or modify
14
it under the terms of the GNU Lesser Public License as published by
15
the Free Software Foundation, either version 3 of the License, or
16
(at your option) any later version.
17
18
FreeWRL/FreeX3D is distributed in the hope that it will be useful,
19
but WITHOUT ANY WARRANTY; without even the implied warranty of
20
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
GNU General Public License for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with FreeWRL/FreeX3D. If not, see <http://www.gnu.org/licenses/>.
25
****************************************************************************/
26
27
28
#ifndef __FREEWRL_TEXTURES_H__
29
#define __FREEWRL_TEXTURES_H__
30
31
#define TEXTURE_INVALID 0
32
33
/* Texture loading table :
34
newer Texture handling procedures
35
each texture has this kind of structure
36
*/
37
struct
textureTableIndexStruct
{
38
struct
X3D_Node
* scenegraphNode;
39
int
nodeType;
40
int
status;
41
int
hasAlpha;
42
GLuint OpenGLTexture;
43
GLuint ifbobuffer;
//in case this texture is used as an fbo render target
44
GLuint idepthbuffer;
//in case this texture is used as an fbo render target
45
int
frames;
46
char
*filename;
47
int
x;
48
int
y;
49
int
z;
50
int
tiles[3];
//when using TILED emulator for texture3D, nx, ny tiles, and resampled z
51
unsigned
char
*texdata;
52
GLint repeatSTR[3];
//repeatR - used for non-builtin-Texture3D ie shader will manually apply this rule
53
GLint magFilter;
//needed in TEX3D frag shader for Z
54
int
textureNumber;
55
int
channels;
//number of original image file image channels/components 0=no texture default, 1=Intensity 2=IntensityAlpha 3=RGB 4=RGBA
56
};
57
typedef
struct
textureTableIndexStruct
textureTableIndexStruct_s
;
58
59
//extern textureTableIndexStruct_s* loadThisTexture;
60
//extern GLuint defaultBlankTexture;
61
62
/* Vertex Array to Vertex Buffer Object migration - used to have a passedInGenTex()
63
when we had (for instance) Cone textures - put this as part of the VBO. */
64
65
textureTableIndexStruct_s
*getTableIndex(
int
indx);
66
67
struct
textureVertexInfo
{
68
GLfloat *pre_canned_textureCoords;
69
GLint TC_size;
/* glTexCoordPointer - size param */
70
GLenum TC_type;
/* glTexCoordPointer - type param */
71
GLsizei TC_stride;
/* glTexCoordPointer - stride param */
72
GLvoid *TC_pointer;
/* glTexCoordPointer - pointer to first element */
73
void
*next;
//next textureVertexInfo for MultitextureCoordinate
74
GLint VBO;
75
};
76
77
/* for texIsloaded structure */
78
#define TEX_NOTLOADED 0
79
#define TEX_LOADING 1
80
#define TEX_READ 2
81
#define TEX_NEEDSBINDING 3
82
#define TEX_LOADED 4
83
#define TEX_UNSQUASHED 5
84
#define TEX_NOTFOUND 6
85
86
const
char
*texst(
int
num);
87
88
89
/* do we have to do textures?? */
90
#define HAVETODOTEXTURES (gglobal()->RenderFuncs.textureStackTop != 0)
91
92
void
textureCoord_send(
struct
textureVertexInfo
*tex);
93
void
textureTransform_start();
94
void
textureTransform_end();
95
96
struct
X3D_Node
*getThis_textureTransform();
97
98
extern
int
fwl_isTextureLoaded(
int
texno);
99
extern
int
isTextureAlpha(
int
n);
100
extern
int
display_status;
101
102
103
/* appearance does material depending on last texture depth */
104
#define NOTEXTURE 0
105
#define TEXTURE_NO_ALPHA 1
106
#define TEXTURE_ALPHA 2
107
108
// OLDCODE void loadTextureNode (struct X3D_Node *node, struct multiTexParams *param);
109
void
loadTextureNode (
struct
X3D_Node
*node,
void
*params);
110
void
bind_image(
int
type,
struct
Uni_String
*parenturl,
struct
Multi_String
url,
111
GLuint *texture_num,
112
int
repeatS,
113
int
repeatT,
114
void
*param);
115
116
/* other function protos */
117
void
init_multitexture_handling(
void
);
118
119
120
#endif
/* __FREEWRL_TEXTURES_H__ */
Multi_String
Definition
Structs.h:2555
Uni_String
Definition
Structs.h:51
X3D_Node
Definition
Structs.h:2589
textureTableIndexStruct
Definition
Textures.h:37
textureVertexInfo
Definition
Textures.h:67
src
lib
opengl
Textures.h
Generated by
1.11.0