3 * Texture images manipulation functions.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 _mesa_alloc_texmemory(GLsizei bytes
);
42 _mesa_free_texmemory(void *m
);
45 /** \name Internal functions */
49 _mesa_base_tex_format( GLcontext
*ctx
, GLint internalFormat
);
53 _mesa_is_proxy_texture(GLenum target
);
56 extern struct gl_texture_image
*
57 _mesa_new_texture_image( GLcontext
*ctx
);
61 _mesa_delete_texture_image( GLcontext
*ctx
, struct gl_texture_image
*teximage
);
64 _mesa_free_texture_image_data( GLcontext
*ctx
,
65 struct gl_texture_image
*texImage
);
69 _mesa_init_teximage_fields(GLcontext
*ctx
, GLenum target
,
70 struct gl_texture_image
*img
,
71 GLsizei width
, GLsizei height
, GLsizei depth
,
72 GLint border
, GLenum internalFormat
);
76 _mesa_set_tex_image(struct gl_texture_object
*tObj
,
77 GLenum target
, GLint level
,
78 struct gl_texture_image
*texImage
);
81 extern struct gl_texture_object
*
82 _mesa_select_tex_object(GLcontext
*ctx
, const struct gl_texture_unit
*texUnit
,
86 extern struct gl_texture_image
*
87 _mesa_select_tex_image(GLcontext
*ctx
, const struct gl_texture_unit
*texUnit
,
88 GLenum target
, GLint level
);
91 extern struct gl_texture_image
*
92 _mesa_get_tex_image(GLcontext
*ctx
, const struct gl_texture_unit
*texUnit
,
93 GLenum target
, GLint level
);
96 extern struct gl_texture_image
*
97 _mesa_get_proxy_tex_image(GLcontext
*ctx
, GLenum target
, GLint level
);
101 _mesa_max_texture_levels(GLcontext
*ctx
, GLenum target
);
105 _mesa_test_proxy_teximage(GLcontext
*ctx
, GLenum target
, GLint level
,
106 GLint internalFormat
, GLenum format
, GLenum type
,
107 GLint width
, GLint height
, GLint depth
, GLint border
);
112 /** \name API entry point functions */
115 extern void GLAPIENTRY
116 _mesa_TexImage1D( GLenum target
, GLint level
, GLint internalformat
,
117 GLsizei width
, GLint border
,
118 GLenum format
, GLenum type
, const GLvoid
*pixels
);
121 extern void GLAPIENTRY
122 _mesa_TexImage2D( GLenum target
, GLint level
, GLint internalformat
,
123 GLsizei width
, GLsizei height
, GLint border
,
124 GLenum format
, GLenum type
, const GLvoid
*pixels
);
127 extern void GLAPIENTRY
128 _mesa_TexImage3D( GLenum target
, GLint level
, GLint internalformat
,
129 GLsizei width
, GLsizei height
, GLsizei depth
, GLint border
,
130 GLenum format
, GLenum type
, const GLvoid
*pixels
);
133 extern void GLAPIENTRY
134 _mesa_TexImage3DEXT( GLenum target
, GLint level
, GLenum internalformat
,
135 GLsizei width
, GLsizei height
, GLsizei depth
,
136 GLint border
, GLenum format
, GLenum type
,
137 const GLvoid
*pixels
);
140 extern void GLAPIENTRY
141 _mesa_GetTexImage( GLenum target
, GLint level
,
142 GLenum format
, GLenum type
, GLvoid
*pixels
);
145 extern void GLAPIENTRY
146 _mesa_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
148 GLenum format
, GLenum type
,
149 const GLvoid
*pixels
);
152 extern void GLAPIENTRY
153 _mesa_TexSubImage2D( GLenum target
, GLint level
,
154 GLint xoffset
, GLint yoffset
,
155 GLsizei width
, GLsizei height
,
156 GLenum format
, GLenum type
,
157 const GLvoid
*pixels
);
160 extern void GLAPIENTRY
161 _mesa_TexSubImage3D( GLenum target
, GLint level
,
162 GLint xoffset
, GLint yoffset
, GLint zoffset
,
163 GLsizei width
, GLsizei height
, GLsizei depth
,
164 GLenum format
, GLenum type
,
165 const GLvoid
*pixels
);
168 extern void GLAPIENTRY
169 _mesa_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
170 GLint x
, GLint y
, GLsizei width
, GLint border
);
173 extern void GLAPIENTRY
174 _mesa_CopyTexImage2D( GLenum target
, GLint level
,
175 GLenum internalformat
, GLint x
, GLint y
,
176 GLsizei width
, GLsizei height
, GLint border
);
179 extern void GLAPIENTRY
180 _mesa_CopyTexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
181 GLint x
, GLint y
, GLsizei width
);
184 extern void GLAPIENTRY
185 _mesa_CopyTexSubImage2D( GLenum target
, GLint level
,
186 GLint xoffset
, GLint yoffset
,
187 GLint x
, GLint y
, GLsizei width
, GLsizei height
);
190 extern void GLAPIENTRY
191 _mesa_CopyTexSubImage3D( GLenum target
, GLint level
,
192 GLint xoffset
, GLint yoffset
, GLint zoffset
,
193 GLint x
, GLint y
, GLsizei width
, GLsizei height
);
197 extern void GLAPIENTRY
198 _mesa_CompressedTexImage1DARB(GLenum target
, GLint level
,
199 GLenum internalformat
, GLsizei width
,
200 GLint border
, GLsizei imageSize
,
203 extern void GLAPIENTRY
204 _mesa_CompressedTexImage2DARB(GLenum target
, GLint level
,
205 GLenum internalformat
, GLsizei width
,
206 GLsizei height
, GLint border
, GLsizei imageSize
,
209 extern void GLAPIENTRY
210 _mesa_CompressedTexImage3DARB(GLenum target
, GLint level
,
211 GLenum internalformat
, GLsizei width
,
212 GLsizei height
, GLsizei depth
, GLint border
,
213 GLsizei imageSize
, const GLvoid
*data
);
216 #define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR
217 #define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR
218 #define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR
220 extern void GLAPIENTRY
221 _mesa_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
222 GLsizei width
, GLenum format
,
223 GLsizei imageSize
, const GLvoid
*data
);
225 extern void GLAPIENTRY
226 _mesa_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
227 GLint yoffset
, GLsizei width
, GLsizei height
,
228 GLenum format
, GLsizei imageSize
,
231 extern void GLAPIENTRY
232 _mesa_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
233 GLint yoffset
, GLint zoffset
, GLsizei width
,
234 GLsizei height
, GLsizei depth
, GLenum format
,
235 GLsizei imageSize
, const GLvoid
*data
);
237 extern void GLAPIENTRY
238 _mesa_GetCompressedTexImageARB(GLenum target
, GLint lod
, GLvoid
*img
);