pixel_buffer_object.py :  » Game-2D-3D » PyOpenGL » PyOpenGL-3.0.1 » OpenGL » GL » EXT » 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 » EXT » pixel_buffer_object.py
'''OpenGL extension EXT.pixel_buffer_object

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

Overview (from thespec import 
  
  This extension expands on the interface provided by buffer objects.
  It is intended to permit buffer objects to be used not only with 
  vertex array data, but also with pixel data.
  Buffer objects were promoted from theARB_vertex_buffer_object import 
  extension in OpenGL 1.5.
  
  Recall that buffer objects conceptually are nothing more than arrays
  of bytes, just like any chunk of memory. Buffer objects allow GL
  commands to source data from abufferobjectbybindingthebuffer import 
  object to a given target and then overloading a certain set of GL
  commands' pointer arguments to refer to offsets inside the buffer,
  rather than pointers to user memory.  An offset is encoded in a
  pointer by adding the offset to a null pointer.
  
  This extension does not add any new functionality to buffer
  objects themselves.  It simply adds two new targets to which buffer
  objects can be bound: PIXEL_PACK_BUFFER and PIXEL_UNPACK_BUFFER.
  When a buffer object is bound to the PIXEL_PACK_BUFFER target,
  commands such as ReadPixels write their data into a buffer object.
  When a buffer object is bound to the PIXEL_UNPACK_BUFFER target,
  commands such as DrawPixels read their data from abufferobject. import 
  
  There are a wide variety of applications for such functionality.
  Some of the most interesting ones are:
  
  - "Render to vertex array."  The application can use a fragment
    program to render some image into one of its buffers, then read
    this image out into a buffer object via ReadPixels.  Then, it can
    use this buffer object as a source of vertex data.
  
  - Streaming textures.  If the application uses MapBuffer/UnmapBuffer
    to write its data for TexSubImage into a buffer object, at least
    one of the data copies usually required to download a texture can
    be eliminated, significantly increasing texture download
    performance.
  
  - Asynchronous ReadPixels.  If an application needs to read back a
    number of images and process them with the CPU, the existing GL
    interface makes it nearly impossible to pipeline this operation.
    The driver will typically send the hardware a readback command
    when ReadPixels is called, and then wait for all of the data to
    be available before returning control to the application.  Then,
    the application can either process the data immediately or call
    ReadPixels again; in neither case will the readback overlap with
    the processing.  If the application issues several readbacks into
    several buffer objects, however, and then maps each one to process
    its data, then the readbacks can proceed in parallel with the data
    processing.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/EXT/pixel_buffer_object.txt
'''
from OpenGL import platform,constants,constant,arrays
from OpenGL import extensions,wrapper
from OpenGL.GL import glget
import ctypes
from OpenGL.raw.GL.EXT.pixel_buffer_object 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.