fix GL_BACK color material bug
[mesa.git] / src / mesa / main / teximage.h
1 /* $Id: teximage.h,v 1.11 2000/06/05 07:28:49 joukj Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 #ifndef TEXIMAGE_H
29 #define TEXIMAGE_H
30
31
32 #include "types.h"
33
34
35 /*** Internal functions ***/
36
37
38 extern GLint
39 _mesa_base_tex_format( GLcontext *ctx, GLint format );
40
41
42 extern struct gl_texture_image *
43 _mesa_alloc_texture_image( void );
44
45
46 extern void
47 _mesa_free_texture_image( struct gl_texture_image *teximage );
48
49
50 extern GLuint
51 _mesa_compressed_image_size(GLenum internalFormat,
52 GLint width, GLint height, GLint depth);
53
54
55 extern struct gl_texture_object *
56 _mesa_select_tex_object(GLcontext *ctx, struct gl_texture_unit *texUnit,
57 GLenum target);
58
59
60 extern struct gl_texture_image *
61 _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_unit *texUnit,
62 GLenum target, GLint level);
63
64
65 extern void
66 _mesa_get_teximage_from_driver( GLcontext *ctx, GLenum target, GLint level,
67 const struct gl_texture_object *texObj );
68
69
70 /*** API entry point functions ***/
71
72
73 extern void
74 _mesa_TexImage1D( GLenum target, GLint level, GLint internalformat,
75 GLsizei width, GLint border,
76 GLenum format, GLenum type, const GLvoid *pixels );
77
78
79 extern void
80 _mesa_TexImage2D( GLenum target, GLint level, GLint internalformat,
81 GLsizei width, GLsizei height, GLint border,
82 GLenum format, GLenum type, const GLvoid *pixels );
83
84
85 extern void
86 _mesa_TexImage3D( GLenum target, GLint level, GLint internalformat,
87 GLsizei width, GLsizei height, GLsizei depth, GLint border,
88 GLenum format, GLenum type, const GLvoid *pixels );
89
90
91 extern void
92 _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalformat,
93 GLsizei width, GLsizei height, GLsizei depth,
94 GLint border, GLenum format, GLenum type,
95 const GLvoid *pixels );
96
97
98 extern void
99 _mesa_GetTexImage( GLenum target, GLint level,
100 GLenum format, GLenum type, GLvoid *pixels );
101
102
103 extern void
104 _mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset,
105 GLsizei width,
106 GLenum format, GLenum type,
107 const GLvoid *pixels );
108
109
110 extern void
111 _mesa_TexSubImage2D( GLenum target, GLint level,
112 GLint xoffset, GLint yoffset,
113 GLsizei width, GLsizei height,
114 GLenum format, GLenum type,
115 const GLvoid *pixels );
116
117
118 extern void
119 _mesa_TexSubImage3D( GLenum target, GLint level,
120 GLint xoffset, GLint yoffset, GLint zoffset,
121 GLsizei width, GLsizei height, GLsizei depth,
122 GLenum format, GLenum type,
123 const GLvoid *pixels );
124
125
126 extern void
127 _mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat,
128 GLint x, GLint y, GLsizei width, GLint border );
129
130
131 extern void
132 _mesa_CopyTexImage2D( GLenum target, GLint level,
133 GLenum internalformat, GLint x, GLint y,
134 GLsizei width, GLsizei height, GLint border );
135
136
137 extern void
138 _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset,
139 GLint x, GLint y, GLsizei width );
140
141
142 extern void
143 _mesa_CopyTexSubImage2D( GLenum target, GLint level,
144 GLint xoffset, GLint yoffset,
145 GLint x, GLint y, GLsizei width, GLsizei height );
146
147
148 extern void
149 _mesa_CopyTexSubImage3D( GLenum target, GLint level,
150 GLint xoffset, GLint yoffset, GLint zoffset,
151 GLint x, GLint y, GLsizei width, GLsizei height );
152
153
154
155 extern void
156 _mesa_CompressedTexImage1DARB(GLenum target, GLint level,
157 GLenum internalformat, GLsizei width,
158 GLint border, GLsizei imageSize,
159 const GLvoid *data);
160
161 extern void
162 _mesa_CompressedTexImage2DARB(GLenum target, GLint level,
163 GLenum internalformat, GLsizei width,
164 GLsizei height, GLint border, GLsizei imageSize,
165 const GLvoid *data);
166
167 extern void
168 _mesa_CompressedTexImage3DARB(GLenum target, GLint level,
169 GLenum internalformat, GLsizei width,
170 GLsizei height, GLsizei depth, GLint border,
171 GLsizei imageSize, const GLvoid *data);
172
173 #ifdef VMS
174 #define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR
175 #define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR
176 #define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR
177 #endif
178 extern void
179 _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
180 GLsizei width, GLenum format,
181 GLsizei imageSize, const GLvoid *data);
182
183 extern void
184 _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
185 GLint yoffset, GLsizei width, GLsizei height,
186 GLenum format, GLsizei imageSize,
187 const GLvoid *data);
188
189 extern void
190 _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
191 GLint yoffset, GLint zoffset, GLsizei width,
192 GLsizei height, GLsizei depth, GLenum format,
193 GLsizei imageSize, const GLvoid *data);
194
195 extern void
196 _mesa_GetCompressedTexImageARB(GLenum target, GLint lod, GLvoid *img);
197
198
199 #endif
200