1 /* $Id: teximage.h,v 1.15 2000/11/22 07:32:17 joukj Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
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:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
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.
35 /*** Internal functions ***/
39 _mesa_base_tex_format( GLcontext
*ctx
, GLint format
);
42 extern struct gl_texture_image
*
43 _mesa_alloc_texture_image( void );
47 _mesa_free_texture_image( struct gl_texture_image
*teximage
);
51 _mesa_compressed_image_size(GLcontext
*ctx
,
52 GLenum internalFormat
,
54 GLint width
, GLint height
, GLint depth
);
57 extern struct gl_texture_object
*
58 _mesa_select_tex_object(GLcontext
*ctx
, const struct gl_texture_unit
*texUnit
,
62 extern struct gl_texture_image
*
63 _mesa_select_tex_image(GLcontext
*ctx
, const struct gl_texture_unit
*texUnit
,
64 GLenum target
, GLint level
);
68 _mesa_get_teximage_from_driver(GLcontext
*ctx
, GLenum target
, GLint level
,
69 const struct gl_texture_object
*texObj
);
73 _mesa_get_teximages_from_driver(GLcontext
*ctx
,
74 struct gl_texture_object
*texObj
);
78 /*** API entry point functions ***/
82 _mesa_TexImage1D( GLenum target
, GLint level
, GLint internalformat
,
83 GLsizei width
, GLint border
,
84 GLenum format
, GLenum type
, const GLvoid
*pixels
);
88 _mesa_TexImage2D( GLenum target
, GLint level
, GLint internalformat
,
89 GLsizei width
, GLsizei height
, GLint border
,
90 GLenum format
, GLenum type
, const GLvoid
*pixels
);
94 _mesa_TexImage3D( GLenum target
, GLint level
, GLint internalformat
,
95 GLsizei width
, GLsizei height
, GLsizei depth
, GLint border
,
96 GLenum format
, GLenum type
, const GLvoid
*pixels
);
100 _mesa_TexImage3DEXT( GLenum target
, GLint level
, GLenum internalformat
,
101 GLsizei width
, GLsizei height
, GLsizei depth
,
102 GLint border
, GLenum format
, GLenum type
,
103 const GLvoid
*pixels
);
107 _mesa_GetTexImage( GLenum target
, GLint level
,
108 GLenum format
, GLenum type
, GLvoid
*pixels
);
112 _mesa_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
114 GLenum format
, GLenum type
,
115 const GLvoid
*pixels
);
119 _mesa_TexSubImage2D( GLenum target
, GLint level
,
120 GLint xoffset
, GLint yoffset
,
121 GLsizei width
, GLsizei height
,
122 GLenum format
, GLenum type
,
123 const GLvoid
*pixels
);
127 _mesa_TexSubImage3D( GLenum target
, GLint level
,
128 GLint xoffset
, GLint yoffset
, GLint zoffset
,
129 GLsizei width
, GLsizei height
, GLsizei depth
,
130 GLenum format
, GLenum type
,
131 const GLvoid
*pixels
);
135 _mesa_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
136 GLint x
, GLint y
, GLsizei width
, GLint border
);
140 _mesa_CopyTexImage2D( GLenum target
, GLint level
,
141 GLenum internalformat
, GLint x
, GLint y
,
142 GLsizei width
, GLsizei height
, GLint border
);
146 _mesa_CopyTexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
147 GLint x
, GLint y
, GLsizei width
);
151 _mesa_CopyTexSubImage2D( GLenum target
, GLint level
,
152 GLint xoffset
, GLint yoffset
,
153 GLint x
, GLint y
, GLsizei width
, GLsizei height
);
157 _mesa_CopyTexSubImage3D( GLenum target
, GLint level
,
158 GLint xoffset
, GLint yoffset
, GLint zoffset
,
159 GLint x
, GLint y
, GLsizei width
, GLsizei height
);
164 _mesa_CompressedTexImage1DARB(GLenum target
, GLint level
,
165 GLenum internalformat
, GLsizei width
,
166 GLint border
, GLsizei imageSize
,
170 _mesa_CompressedTexImage2DARB(GLenum target
, GLint level
,
171 GLenum internalformat
, GLsizei width
,
172 GLsizei height
, GLint border
, GLsizei imageSize
,
176 _mesa_CompressedTexImage3DARB(GLenum target
, GLint level
,
177 GLenum internalformat
, GLsizei width
,
178 GLsizei height
, GLsizei depth
, GLint border
,
179 GLsizei imageSize
, const GLvoid
*data
);
182 #define _mesa_CompressedTexSubImage1DARB _mesa_CompressedTexSubImage1DAR
183 #define _mesa_CompressedTexSubImage2DARB _mesa_CompressedTexSubImage2DAR
184 #define _mesa_CompressedTexSubImage3DARB _mesa_CompressedTexSubImage3DAR
187 _mesa_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
188 GLsizei width
, GLenum format
,
189 GLsizei imageSize
, const GLvoid
*data
);
192 _mesa_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
193 GLint yoffset
, GLsizei width
, GLsizei height
,
194 GLenum format
, GLsizei imageSize
,
198 _mesa_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
199 GLint yoffset
, GLint zoffset
, GLsizei width
,
200 GLsizei height
, GLsizei depth
, GLenum format
,
201 GLsizei imageSize
, const GLvoid
*data
);
204 _mesa_GetCompressedTexImageARB(GLenum target
, GLint lod
, GLvoid
*img
);