mga driver, brought over by Jon Smirl
[mesa.git] / src / mesa / drivers / dri / mga / mgatex.h
1 /* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.h,v 1.7 2002/10/30 12:51:36 alanh Exp $ */
2 /*
3 * Copyright 2000-2001 VA Linux Systems, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * on the rights to use, copy, modify, merge, publish, distribute, sub
10 * license, and/or sell copies of the Software, and to permit persons to whom
11 * the Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
15 * Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
20 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 *
25 * Authors:
26 * Keith Whitwell <keith@tungstengraphics.com>
27 */
28
29 #ifndef MGATEX_INC
30 #define MGATEX_INC
31
32 #include "mgacontext.h"
33
34 typedef struct mga_texture_object_s *mgaTextureObjectPtr;
35
36
37 /* Called before a primitive is rendered to make sure the texture
38 * state is properly setup. Texture residence is checked later
39 * when we grab the lock.
40 */
41 void mgaUpdateTextureState( GLcontext *ctx );
42
43 void mgaConvertTexture( GLuint *dest, int texelBytes,
44 struct gl_texture_image *image,
45 int x, int y, int width, int height );
46
47
48 void mgaUploadSubImageLocked( mgaContextPtr mmesa,
49 mgaTextureObjectPtr t,
50 int level,
51 int x, int y, int width, int height );
52
53 int mgaUploadTexImages( mgaContextPtr mmesa, mgaTextureObjectPtr t );
54
55 void mgaDestroyTexObj( mgaContextPtr mmesa, mgaTextureObjectPtr t );
56
57 void mgaAgeTextures( mgaContextPtr mmesa, int heap );
58
59 void mgaDDInitTextureFuncs( GLcontext *ctx );
60
61
62 #endif