vertex_array_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 » vertex_array_range.py
'''OpenGL extension NV.vertex_array_range

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

Overview (from thespec import 
  
  The goal of this extension is to permit extremely high vertex
  processing rates via OpenGL vertex arrays even when the CPU lacks
  the necessary data movement bandwidth to keep up with the rate
  at which the vertex engine can consume vertices.  CPUs can keep
  up if they can just pass vertex indices to the hardware and
  let the hardware "pull" the actual vertex data via Direct Memory
  Access (DMA).  Unfortunately, the current OpenGL 1.1 vertex array
  functionality has semantic constraints that make such an approach
  hard.  Hence, the vertex array range extension.
  
  This extension provides a mechanism for deferring the pulling of
  vertex array elements to facilitate DMAed pulling of vertices for
  fast, efficient vertex array transfers.  The OpenGL client need only
  pass vertex indices to the hardware which can DMA the actual index's
  vertex data directly out of the client address space.
  
  The OpenGL 1.1 vertex array functionality specifies a fairly strict
  coherency model for when OpenGL extracts vertex data from avertex import 
  array and when the application can update the in memory
  vertex array data.  The OpenGL 1.1 specification says "Changes
  made to array data between the execution of Begin and the
  corresponding execution of End may affect calls to ArrayElement
  that are made within the same Begin/End period in non-sequential
  ways.  That is, a call to ArrayElement that precedes a change to
  array data may access the changed data, and a call that follows
  a change to array data may access the original data."
  
  This means that by the time End returns (and DrawArrays and
  DrawElements return since they have implicit Ends), the actual vertex
  array data must be transferred to OpenGL.  This strict coherency model
  prevents us from simplypassingvertexelementindicestothehardware import 
  and having the hardware "pull" the vertex data out (which is often
  long after the End for the primitive has returned to the application).
  
  Relaxing this coherency model and bounding the range from which import 
  vertex array data can be pulled is key to making OpenGL vertex
  array transfers faster and more efficient.
  
  The first task of the vertex array range extension is to relax
  the coherency model so that hardware can indeed "pull" vertex
  data from theOpenGLclientsaddressspacelongaftertheapplication import 
  has completed sending the geometry primitives requiring the vertex
  data.
  
  The second problem with the OpenGL 1.1 vertex array functionality is
  the lack of any guidance from theAPIaboutwhatregionofmemory import 
  vertices can be pulled from.  There is no size limit for OpenGL 1.1
  vertex arrays.  Any vertex index that points to valid data in all
  enabled arrays is fair game.  This makes it hard for a vertex DMA
  engine to pull vertices since they can be potentially pulled from  import 
  anywhere in the OpenGL client address space.
  
  The vertex array range extension specifies a range of the OpenGL
  client's address space where vertices can be pulled.  Vertex indices
  that access any array elements outside the vertex array range
  are specified to be undefined.  This permits hardware to DMA from  import 
  finite regions of OpenGL client address space, making DMA engine
  implementation tractable.
  
  The extension is specified such that an (error free) OpenGL client
  using the vertex array range functionality could no-op its vertex
  array range commands and operate equivalently to using (if slower
  than) the vertex array range functionality.
  
  Because different memory types (local graphics memory, AGP memory)
  have different DMA bandwidths and caching behavior, this extension
  includes a window system dependent memory allocator to allocate
  cleanly the most appropriate memory for constructing a vertex array
  range.  The memory allocator provided allows the application to
  tradeoff the desired CPU read frequency, CPU write frequency, and
  memory priority while still leaving it up to OpenGL implementation
  the exact memory type to be allocated.

The official definition of this extension is available here:
http://www.opengl.org/registry/specs/NV/vertex_array_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.vertex_array_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.