3e0c61eda201da77c18f0314e5b737e9a8134cde
[mesa.git] / src / mesa / pipe / p_context.h
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
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
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef PIPE_CONTEXT_H
29 #define PIPE_CONTEXT_H
30
31 #include "mtypes.h"
32
33 /* Kludge:
34 */
35 extern struct pipe_context *softpipe_create( void );
36
37 /* Drawing currently kludged up via the existing tnl/ module.
38 */
39 struct vertex_buffer;
40
41
42 /**
43 * Software pipeline rendering context. Basically a collection of
44 * state setting functions, plus VBO drawing entrypoint.
45 */
46 struct pipe_context {
47
48 void (*destroy)( struct pipe_context * );
49
50 /*
51 * Drawing
52 */
53 void (*draw_vb)( struct pipe_context *pipe,
54 struct vertex_buffer *VB );
55
56 /*
57 * State functions
58 */
59 void (*set_alpha_test_state)( struct pipe_context *,
60 const struct pipe_alpha_test_state * );
61
62 void (*set_blend_state)( struct pipe_context *,
63 const struct pipe_blend_state * );
64
65 void (*set_cbuf_state)( struct pipe_context *,
66 const struct pipe_surface * );
67
68 void (*set_clip_state)( struct pipe_context *,
69 const struct pipe_clip_state * );
70
71 void (*set_depth_state)( struct pipe_context *,
72 const struct pipe_depth_state * );
73
74 void (*set_point_state)( struct pipe_context *,
75 const struct pipe_point_state * );
76
77 void (*set_framebuffer_state)( struct pipe_context *,
78 const struct pipe_framebuffer_state * );
79
80 void (*set_fs_state)( struct pipe_context *,
81 const struct pipe_fs_state * );
82
83 void (*set_polygon_stipple)( struct pipe_context *,
84 const struct pipe_poly_stipple * );
85
86 void (*set_setup_state)( struct pipe_context *,
87 const struct pipe_setup_state * );
88
89 void (*set_scissor_rect)( struct pipe_context *,
90 const struct pipe_scissor_rect * );
91
92 void (*set_stencil_state)( struct pipe_context *,
93 const struct pipe_stencil_state * );
94
95 void (*set_viewport)( struct pipe_context *,
96 const struct pipe_viewport * );
97 };
98
99
100 #endif