| 1 |
'''OpenGL extension SGIS.multisample |
| 2 |
|
| 3 |
This module customises the behaviour of the |
| 4 |
OpenGL.raw.GLX.SGIS.multisample to provide a more |
| 5 |
Python-friendly API |
| 6 |
|
| 7 |
Overview (from the spec) |
| 8 |
|
| 9 |
This extension provides a mechanism to antialias all GL primitives: |
| 10 |
points, lines, polygons, bitmaps, and images. The technique is to |
| 11 |
sample all primitives multiple times at each pixel. The color sample |
| 12 |
values are resolved to a single, displayable color each time a pixel |
| 13 |
is updated, so the antialiasing appears to be automatic at the |
| 14 |
application level. Because each sample includes depth and stencil |
| 15 |
information, the depth and stencil functions perform equivalently |
| 16 |
to the single-sample mode. |
| 17 |
|
| 18 |
An additional buffer, called the multisample buffer, is added to |
| 19 |
the framebuffer. Pixel sample values, including color, depth, and |
| 20 |
stencil values, are stored in this buffer. When the framebuffer |
| 21 |
includes a multisample buffer, it does not also include separate |
| 22 |
depth or stencil buffers, even if the multisample buffer does not |
| 23 |
store depth or stencil values. Color buffers (left/right, front/ |
| 24 |
back, and aux) do coexist with the multisample buffer, however. |
| 25 |
|
| 26 |
Multisample antialiasing is most valuable for rendering polygons, |
| 27 |
because it requires no sorting for hidden surface elimination, and |
| 28 |
it correctly handles adjacent polygons, object silhouettes, and |
| 29 |
even intersecting polygons. If only points or lines are being |
| 30 |
rendered, the "smooth" antialiasing mechanism provided by the base |
| 31 |
GL may result in a higher quality image. This extension is designed |
| 32 |
to allow multisample and smooth antialiasing techniques to be |
| 33 |
alternated during the rendering of a single scene. |
| 34 |
|
| 35 |
The official definition of this extension is available here: |
| 36 |
http://www.opengl.org/registry/specs/SGIS/multisample.txt |
| 37 |
''' |
| 38 |
from OpenGL import platform, constant, arrays |
| 39 |
from OpenGL import extensions, wrapper |
| 40 |
import ctypes |
| 41 |
from OpenGL.raw.GLX import _types, _glgets |
| 42 |
from OpenGL.raw.GLX.SGIS.multisample import * |
| 43 |
from OpenGL.raw.GLX.SGIS.multisample import _EXTENSION_NAME |
| 44 |
|
| 45 |
def glInitMultisampleSGIS(): |
| 46 |
'''Return boolean indicating whether this extension is available''' |
| 47 |
from OpenGL import extensions |
| 48 |
return extensions.hasGLExtension( _EXTENSION_NAME ) |
| 49 |
|
| 50 |
|
| 51 |
### END AUTOGENERATED SECTION |