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

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

Overview (from thespec import 
  
  This extension provides a simple mechanism to optimize texture data handling
  by clients.  GL implementations normally maintain a copy of texture image
  data supplied clients when any of the various texturing commands, such as
  TexImage2D, are invoked.  This extension eliminates GL's internal copy of
  the texture image data and allows a client to maintain this data locally for
  textures when the UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter is
  TRUE at the time of texture specification.  Local texture data storage is
  especially useful in cases where clients maintain internal copies of
  textures used in any case.  This results in what could be considered an
  extra copy of the texture image data.  Assuming all operations are error
  free, the use of client storage has no affect on the result of texturing
  operations and will not affect rendering results. APPLE_client_storage
  allows clients to optimize memory requirements and copy operations it also
  requires adherence to specific rules in maintaining texture image data.
  
  Clients using this extension are agreeing to preserve a texture's image data
  for the life of the texture.  The life of the texture is defined, in this
  case, as the time from firstissuingtheTexImage3DTexImage2D import 
  TexImage1D command, for the specific texture object with the
  UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter set to TRUE, until the
  DeleteTextures command or another TexImage command for that same object. 
  Only after DeleteTextures has completed, or new texture is specified, can
  the local texture memory be released, as it will no longer be utilized by
  OpenGL.  Changing the UNPACK_CLIENT_STORAGE_APPLE pixel storage parameter
  will have no additional effect once the texturing command has been issued
  and specifically will not alleviate the client from maintainingthetexture import 
  data.
  
  Client storage is implemented as a pixel storage parameter which affects
  texture image storage at the time the texturing command is issued.  As with
  other pixel storage parameters this state may differ from thetimethe import 
  texturing command in executed if the command is placed in a display list. 
  The PixelStore command is used to set the parameter
  UNPACK_CLIENT_STORAGE_APPLE.  Values can either be TRUE or FALSE, with TRUE
  representing the use of client local storage and FALSE indicating the OpenGL
  engine and not the client will be responsible for maintaining texture
  storage for future texturing commands issued per the OpenGL specification.
  The default state for the UNPACK_CLIENT_STORAGE_APPLE parameter is FALSE
  
  Client storage is only available for texture objects and not the default
  texture (of any target type).  This means that a texture object has to
  generated and bound to be used with client storage.  Setting
  UNPACK_CLIENT_STORAGE_APPLE to TRUE and texturing with the default texture
  will result in normally texturing with GL maintaining a copy of the texture
  image data.
  
  Normally, client storage will be used in conjunction with normal texturing
  techniques.  An application would use GenTextures to generate texture
  objects as needed.  BindTexture to the texture object name of interest. 
  Enable client storage via the PixelStore command setting the
  UNPACK_CLIENT_STORAGE_APPLE parameter to TRUE. Then use TexImage3D,
  TexImage2D or TexImage1D to specify the texture image.  If no further use of
  client storage is desired, it is recommended to again use the PixelStore
  command, in this case setting the UNPACK_CLIENT_STORAGE_APPLE parameter to
  FALSE to disable client storage, since this pixel state is maintained unless
  explicitly set by the PixelStore command.
  
  If an application needs to modify the texture, using TexSubImage for
  example, it should be noted that the pointer passed to TexSubImage1D,
  TexSubImage2D or TexSubImage3D does not have to the same, or within the
  original texture memory.  It if is not, there is the likelihood of GL
  copying the new data to the original texture memory owned by the client,
  thus actually modifying this texture image data.  This does not affect
  requirement to maintain the original texture memory but also does not add
  the requirement to maintain the sub image data, due to the copy.
  
  Once a client has completed use of the texture stored in client memory, it
  should issue a DeleteTextures command to delete the texture object or issue
  a texture command, with the same target type, for the object, with either a
  different data pointer, or UNPACK_CLIENT_STORAGE_APPLE set to false, in any
  case, breaking the tie between GL and the texture buffer.  An implicit Flush
  command is issued in these cases, ensuring all access to the texture by
  OpenGL is complete.  Only at this point can the texture buffer be safely
  released.  Releasing the texture buffer prior has undefined results and will
  very possibly display texel anomalies at run time.  System level memory
  management and paging schemes should not affect the use of client storage. 
  Consider in any case, that GL has an alias of the base pointer for this
  block of texture memory which is maintained until GL is finished rendering
  with the texture and it has been deleted or reassigned to another set of
  texture data.  As long as this alias exists, applications must not
  de-allocate, move or purge this memory.

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