File: multisampled_render_to_texture.py

package info (click to toggle)
pyopengl 3.1.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,668 kB
  • sloc: python: 108,024; makefile: 4
file content (51 lines) | stat: -rw-r--r-- 2,176 bytes parent folder | download | duplicates (3)
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
'''OpenGL extension IMG.multisampled_render_to_texture

This module customises the behaviour of the 
OpenGL.raw.GLES2.IMG.multisampled_render_to_texture to provide a more 
Python-friendly API

Overview (from the spec)
	
	    This extension introduces functionality to perform multisampled 
		rendering to a color renderable texture, without requiring an 
		explicit resolve of multisample data. 
	
		Some GPU architectures - such as tile-based renderers - are
		capable of performing multisampled rendering by storing 
		multisample data in internal high-speed memory and downsampling the
		data when writing out to external memory after rendering has 
		finished. Since per-sample data is never written out to external 
		memory, this approach saves bandwidth and storage space. In this 
		case multisample data gets discarded, however this is acceptable
		in most cases.
	
		The extension provides a new command, FramebufferTexture2DMultisampleIMG, 
		which attaches a texture level to a framebuffer and enables 
		multisampled rendering to that texture level. 
	
		When the texture level is used as a source or destination for any 
		operation other than drawing to it, an implicit resolve of 
		multisampled color data is performed. After such a resolve, the 
		multisampled color data is discarded.
	
		In order to allow the use of multisampled depth and stencil buffers 
		when performing	multisampled rendering to a texture, the extension 
		also adds the command RenderbufferStorageMultisampleIMG.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/IMG/multisampled_render_to_texture.txt
'''
from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GLES2 import _types, _glgets
from OpenGL.raw.GLES2.IMG.multisampled_render_to_texture import *
from OpenGL.raw.GLES2.IMG.multisampled_render_to_texture import _EXTENSION_NAME

def glInitMultisampledRenderToTextureIMG():
    '''Return boolean indicating whether this extension is available'''
    from OpenGL import extensions
    return extensions.hasGLExtension( _EXTENSION_NAME )


### END AUTOGENERATED SECTION