Fixed includes & added a few hooks for the DRI.
[mesa.git] / src / mesa / main / depth.h
1
2 /* $Id: depth.h,v 1.2 1999/10/08 09:27:10 keithw Exp $ */
3
4 /*
5 * Mesa 3-D graphics library
6 * Version: 3.1
7 *
8 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 *
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
16 *
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
24 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 */
27
28
29
30
31
32 #ifndef DEPTH_H
33 #define DEPTH_H
34
35
36 #include "types.h"
37
38
39 /*
40 * Return the address of the Z-buffer value for window coordinate (x,y):
41 */
42 #define Z_ADDRESS( CTX, X, Y ) \
43 ((CTX)->Buffer->Depth + (CTX)->Buffer->Width * (Y) + (X))
44
45
46
47
48 extern GLuint
49 gl_depth_test_span_generic( GLcontext* ctx, GLuint n, GLint x, GLint y,
50 const GLdepth z[], GLubyte mask[] );
51
52 extern GLuint
53 gl_depth_test_span_less( GLcontext* ctx, GLuint n, GLint x, GLint y,
54 const GLdepth z[], GLubyte mask[] );
55
56 extern GLuint
57 gl_depth_test_span_greater( GLcontext* ctx, GLuint n, GLint x, GLint y,
58 const GLdepth z[], GLubyte mask[] );
59
60
61
62 extern void
63 gl_depth_test_pixels_generic( GLcontext* ctx,
64 GLuint n, const GLint x[], const GLint y[],
65 const GLdepth z[], GLubyte mask[] );
66
67 extern void
68 gl_depth_test_pixels_less( GLcontext* ctx,
69 GLuint n, const GLint x[], const GLint y[],
70 const GLdepth z[], GLubyte mask[] );
71
72 extern void
73 gl_depth_test_pixels_greater( GLcontext* ctx,
74 GLuint n, const GLint x[], const GLint y[],
75 const GLdepth z[], GLubyte mask[] );
76
77
78 extern void gl_read_depth_span_float( GLcontext* ctx,
79 GLuint n, GLint x, GLint y,
80 GLfloat depth[] );
81
82
83 extern void gl_read_depth_span_int( GLcontext* ctx, GLuint n, GLint x, GLint y,
84 GLdepth depth[] );
85
86
87 extern void gl_alloc_depth_buffer( GLcontext* ctx );
88
89
90 extern void gl_clear_depth_buffer( GLcontext* ctx );
91
92
93 extern void gl_ClearDepth( GLcontext* ctx, GLclampd depth );
94
95 extern void gl_DepthFunc( GLcontext* ctx, GLenum func );
96
97 extern void gl_DepthMask( GLcontext* ctx, GLboolean flag );
98
99 #endif