pixel_data_range.py :  » Game-2D-3D » PyOpenGL » PyOpenGL-3.0.1 » OpenGL » GL » NV » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Game 2D 3D » PyOpenGL 
PyOpenGL » PyOpenGL 3.0.1 » OpenGL » GL » NV » pixel_data_range.py
'''OpenGL extension NV.pixel_data_range

This module customises the behaviour of the 
OpenGL.raw.GL.NV.pixel_data_range to provide a more 
Python-friendly API

Overview (from thespec import 
  
  The vertex array range extension is intended to improve the
  efficiency of OpenGL vertex arrays.  OpenGL vertex arrays' coherency
  model and ability to access memory from arbitrarylocationsmemory import 
  prevented implementations from usingDMADirectMemoryAccess import 
  operations.
  
  Many image-intensive applications, such as those that use dynamically
  generated textures, face similar problems.  These applications would
  like to be able to sustain throughputs of hundreds of millions of
  pixels per second through DrawPixels and hundreds of millions of
  texels per second through TexSubImage.
  
  However, the same restrictions that limited vertex throughput also
  limit pixel throughput.
  
  By the time that any pixel operation that reads data from usermemory import 
  returns, OpenGL requires that it must be safe for the application to
  start using that memory for a different purpose.  This coherency
  model prevents asynchronous DMA transfers directly out of the user's
  buffer.
  
  There are also no restrictions on the pointer provided to pixel
  operations or on the size of the data.  To facilitate DMA
  implementations, the driver needs to know in advance what region of
  the address space to lock down.
  
  Vertex arrays faced both of these restrictions already, but pixel
  operations have one additional complicating factor -- they are
  bidirectional.  Vertex array data is always being transfered from the import 
  application to the driver and the HW, whereas pixel operations
  sometimes transfer data to the application from thedriverHW. import 
  Note that the types of memory that are suitable for DMA for reading
  and writing purposes are often different.  For example, on many PC
  platforms, DMA pulling is best accomplished with write-combined
  (uncached) AGP memory, while pushing data should use cached memory so
  that the application can read the data efficiently once it has been
  read back over the AGP bus.
  
  This extension defines an API where an application can specify two
  pixel data ranges, which are analogous to vertex array ranges, except
  that one is for operations where the application is reading data
  (e.g. glReadPixels) and one is for operations where the application
  is writing data (e.g. glDrawPixels, glTexSubImage2D, etc.).  Each
  pixel data range has a pointer to its start and a length in bytes.
  
  When the pixel data range is enabled, and if the pointer specified
  as the argument to a pixel operation is inside the corresponding
  pixel data range, the implementation may choose to asynchronously
  pull data from thepixeldatarangepushdatatothepixeldata import 
  range.  Data pulled from outsidethepixeldatarangeundefined import 
  while pushing data to outside the pixel data range produces undefined
  results.
  
  The application may synchronize with the hardware in one of two ways:
  by flushing the pixel data range (or causing an implicit flush) or by
  using the NV_fence extension to insert fences in the command stream.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/pixel_data_range.txt
'''
from OpenGL import platform,constants,constant,arrays
from OpenGL import extensions,wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.NV.pixel_data_range import *
### END AUTOGENERATED SECTION
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.