summaryrefslogtreecommitdiff
path: root/src/gallium/docs/build/html/context.html
blob: bd8166ac8919214db161f93e319e6615d2c13a24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Context &mdash; Gallium v0.3 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.3',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="top" title="Gallium v0.3 documentation" href="index.html" />
    <link rel="next" title="CSO" href="cso.html" />
    <link rel="prev" title="Screen" href="screen.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="cso.html" title="CSO"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="screen.html" title="Screen"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Gallium v0.3 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="context">
<h1>Context<a class="headerlink" href="#context" title="Permalink to this headline">¶</a></h1>
<p>The context object represents the purest, most directly accessible, abilities
of the device&#8217;s 3D rendering pipeline.</p>
<div class="section" id="methods">
<h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline">¶</a></h2>
<div class="section" id="cso-state">
<h3>CSO State<a class="headerlink" href="#cso-state" title="Permalink to this headline">¶</a></h3>
<p>All CSO state is created, bound, and destroyed, with triplets of methods that
all follow a specific naming scheme. For example, <tt class="docutils literal"><span class="pre">create_blend_state</span></tt>,
<tt class="docutils literal"><span class="pre">bind_blend_state</span></tt>, and <tt class="docutils literal"><span class="pre">destroy_blend_state</span></tt>.</p>
<p>CSO objects handled by the context object:</p>
<ul class="simple">
<li><a class="reference external" href="cso/blend.html#blend"><em>Blend</em></a>: <tt class="docutils literal"><span class="pre">*_blend_state</span></tt></li>
<li><a class="reference external" href="cso/sampler.html#sampler"><em>Sampler</em></a>: These are special; they can be bound to either vertex or
fragment samplers, and they are bound in groups.
<tt class="docutils literal"><span class="pre">bind_fragment_sampler_states</span></tt>, <tt class="docutils literal"><span class="pre">bind_vertex_sampler_states</span></tt></li>
<li><a class="reference external" href="cso/rasterizer.html#rasterizer"><em>Rasterizer</em></a>: <tt class="docutils literal"><span class="pre">*_rasterizer_state</span></tt></li>
<li><a class="reference external" href="cso/dsa.html#depth-stencil-alpha"><em>Depth, Stencil, &amp; Alpha</em></a>: <tt class="docutils literal"><span class="pre">*_depth_stencil_alpha_state</span></tt></li>
<li><a class="reference external" href="cso/shader.html#shader"><em>Shader</em></a>: These have two sets of methods. <tt class="docutils literal"><span class="pre">*_fs_state</span></tt> is for
fragment shaders, and <tt class="docutils literal"><span class="pre">*_vs_state</span></tt> is for vertex shaders.</li>
</ul>
</div>
<div class="section" id="non-cso-state">
<h3>Non-CSO State<a class="headerlink" href="#non-cso-state" title="Permalink to this headline">¶</a></h3>
<p>These pieces of state are too small, variable, and/or trivial to have CSO
objects. They all follow simple, one-method binding calls, e.g.
<tt class="docutils literal"><span class="pre">set_edgeflags</span></tt>.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">set_edgeflags</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_blend_color</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_clip_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_constant_buffer</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_framebuffer_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_polygon_stipple</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_scissor_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_viewport_state</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_fragment_sampler_textures</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_vertex_sampler_textures</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_vertex_buffers</span></tt></li>
<li><tt class="docutils literal"><span class="pre">set_vertex_elements</span></tt></li>
</ul>
</div>
<div class="section" id="queries">
<h3>Queries<a class="headerlink" href="#queries" title="Permalink to this headline">¶</a></h3>
<p>Queries can be created with <tt class="docutils literal"><span class="pre">create_query</span></tt> and deleted with
<tt class="docutils literal"><span class="pre">destroy_query</span></tt>. To enable a query, use <tt class="docutils literal"><span class="pre">begin_query</span></tt>, and when finished,
use <tt class="docutils literal"><span class="pre">end_query</span></tt> to stop the query. Finally, <tt class="docutils literal"><span class="pre">get_query_result</span></tt> is used
to retrieve the results.</p>
</div>
<div class="section" id="vbo-drawing">
<h3>VBO Drawing<a class="headerlink" href="#vbo-drawing" title="Permalink to this headline">¶</a></h3>
<p><tt class="docutils literal"><span class="pre">draw_arrays</span></tt></p>
<p><tt class="docutils literal"><span class="pre">draw_elements</span></tt></p>
<p><tt class="docutils literal"><span class="pre">draw_range_elements</span></tt></p>
<p><tt class="docutils literal"><span class="pre">flush</span></tt></p>
</div>
<div class="section" id="surface-drawing">
<h3>Surface Drawing<a class="headerlink" href="#surface-drawing" title="Permalink to this headline">¶</a></h3>
<p>These methods emulate classic blitter controls. They are not guaranteed to be
available; if they are set to NULL, then they are not present.</p>
<p><tt class="docutils literal"><span class="pre">surface_fill</span></tt> performs a fill operation on a section of a surface.</p>
<p><tt class="docutils literal"><span class="pre">surface_copy</span></tt> blits a region of a surface to a region of another surface,
provided that both surfaces are the same format. The source and destination
may be the same surface, and overlapping blits are permitted.</p>
<p><tt class="docutils literal"><span class="pre">clear</span></tt> initializes entire buffers to an RGBA, depth, or stencil value,
depending on the formats of the buffers. Use <tt class="docutils literal"><span class="pre">set_framebuffer_state</span></tt> to
specify the buffers to clear.</p>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="">Context</a><ul>
<li><a class="reference external" href="#methods">Methods</a><ul>
<li><a class="reference external" href="#cso-state">CSO State</a></li>
<li><a class="reference external" href="#non-cso-state">Non-CSO State</a></li>
<li><a class="reference external" href="#queries">Queries</a></li>
<li><a class="reference external" href="#vbo-drawing">VBO Drawing</a></li>
<li><a class="reference external" href="#surface-drawing">Surface Drawing</a></li>
</ul>
</li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="screen.html"
                                  title="previous chapter">Screen</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="cso.html"
                                  title="next chapter">CSO</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/context.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="cso.html" title="CSO"
             >next</a> |</li>
        <li class="right" >
          <a href="screen.html" title="Screen"
             >previous</a> |</li>
        <li><a href="index.html">Gallium v0.3 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2009, VMWare, X.org, Nouveau.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
    </div>
  </body>
</html>