summaryrefslogtreecommitdiff
path: root/src/mesa/main/mtypes.h
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-04-22 00:27:31 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-04-22 00:27:31 +0000
commitf959f6e1dc27c71fc0ccc56e09b29101b3bf3b97 (patch)
tree15b4171c2b3396e3a05f2776cc24d90cb37c8f84 /src/mesa/main/mtypes.h
parent05a6f2fd484bab59c6e6a381f58808adc26619f1 (diff)
New glTexImage code.
The gl_texture_format struct now has a StoreTexImageFunc that's called by glTex[Sub]Image[123]D to convert the user's texture data into the specific texture format layout. Now it's much easier to add new texture formats (like the 16/32-bit floating point formats). The texutil.[ch] and texutil_tmp.h files are obsolete.
Diffstat (limited to 'src/mesa/main/mtypes.h')
-rw-r--r--src/mesa/main/mtypes.h46
1 files changed, 37 insertions, 9 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a86b2ce5ac..4d78264bde 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -143,6 +143,8 @@ struct gl_texture_object;
typedef struct __GLcontextRec GLcontext;
typedef struct __GLcontextModesRec GLvisual;
typedef struct gl_frame_buffer GLframebuffer;
+struct gl_pixelstore_attrib;
+struct gl_texture_format;
/*@}*/
@@ -1024,16 +1026,37 @@ typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage,
GLint col, GLint row, GLint img,
GLfloat *texelOut );
+
+/**
+ * TexImage store function. This is called by the glTex[Sub]Image
+ * functions and is responsible for converting the user-specified texture
+ * image into a specific (hardware) image format.
+ */
+typedef GLboolean (*StoreTexImageFunc)(GLcontext *ctx, GLuint dims,
+ GLenum baseInternalFormat,
+ const struct gl_texture_format *dstFormat,
+ GLvoid *dstAddr,
+ GLint dstXoffset, GLint dstYoffset, GLint dstZoffset,
+ GLint dstRowStride, GLint dstImageStride,
+ GLint srcWidth, GLint srcHeight, GLint srcDepth,
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *srcAddr,
+ const struct gl_pixelstore_attrib *srcPacking);
+
+
+
/**
* Texture format record
*/
struct gl_texture_format {
GLint MesaFormat; /**< One of the MESA_FORMAT_* values */
- GLenum BaseFormat; /**< Either GL_ALPHA, GL_INTENSITY, GL_LUMINANCE,
- * GL_LUMINANCE_ALPHA, GL_RGB, GL_RGBA,
- * GL_COLOR_INDEX or GL_DEPTH_COMPONENT.
- */
+ GLenum BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
+ * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
+ * GL_INTENSITY, GL_COLOR_INDEX or
+ * GL_DEPTH_COMPONENT.
+ */
+ GLenum DataType; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */
GLubyte RedBits; /**< Bits per texel component */
GLubyte GreenBits; /**< These are just rough approximations for */
GLubyte BlueBits; /**< compressed texture formats. */
@@ -1043,7 +1066,9 @@ struct gl_texture_format {
GLubyte IndexBits;
GLubyte DepthBits;
- GLint TexelBytes; /**< Bytes per texel (0 for compressed formats */
+ GLint TexelBytes; /**< Bytes per texel, 0 if compressed format */
+
+ StoreTexImageFunc StoreImage;
/**
* \name Texel fetch function pointers
@@ -1063,10 +1088,11 @@ struct gl_texture_format {
* Texture image record
*/
struct gl_texture_image {
- GLenum Format; /**< GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
- * GL_INTENSITY, GL_RGB, GL_RGBA,
- * GL_COLOR_INDEX or GL_DEPTH_COMPONENT only.
- * Used for choosing TexEnv arithmetic.
+ GLenum Format; /**< Either GL_RGB, GL_RGBA, GL_ALPHA,
+ * GL_LUMINANCE, GL_LUMINANCE_ALPHA,
+ * GL_INTENSITY, GL_COLOR_INDEX or
+ * GL_DEPTH_COMPONENT only.
+ * Used for choosing TexEnv arithmetic.
*/
GLint IntFormat; /**< Internal format as given by the user */
GLuint Border; /**< 0 or 1 */
@@ -1828,6 +1854,7 @@ struct gl_extensions
GLboolean dummy; /* don't remove this! */
GLboolean ARB_depth_texture;
GLboolean ARB_fragment_program;
+ GLboolean ARB_half_float_pixel;
GLboolean ARB_imaging;
GLboolean ARB_multisample;
GLboolean ARB_multitexture;
@@ -1840,6 +1867,7 @@ struct gl_extensions
GLboolean ARB_texture_env_combine;
GLboolean ARB_texture_env_crossbar;
GLboolean ARB_texture_env_dot3;
+ GLboolean ARB_texture_float;
GLboolean ARB_texture_mirrored_repeat;
GLboolean ARB_texture_non_power_of_two;
GLboolean ARB_transpose_matrix;