当前位置: 首页>>代码示例>>Python>>正文


Python ArrayDatatype.voidDataPointer方法代码示例

本文整理汇总了Python中OpenGL.arrays.arraydatatype.ArrayDatatype.voidDataPointer方法的典型用法代码示例。如果您正苦于以下问题:Python ArrayDatatype.voidDataPointer方法的具体用法?Python ArrayDatatype.voidDataPointer怎么用?Python ArrayDatatype.voidDataPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenGL.arrays.arraydatatype.ArrayDatatype的用法示例。


在下文中一共展示了ArrayDatatype.voidDataPointer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: glVertexAttribPointer

# 需要导入模块: from OpenGL.arrays.arraydatatype import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.arraydatatype.ArrayDatatype import voidDataPointer [as 别名]
def glVertexAttribPointer(
    baseOperation, index, size, type,
    normalized, stride, pointer,
):
    """Set an attribute pointer for a given shader (index)

    index -- the index of the generic vertex to bind, see
        glGetAttribLocation for retrieval of the value,
        note that index is a global variable, not per-shader
    size -- number of basic elements per record, 1,2,3, or 4
    type -- enum constant for data-type
    normalized -- whether to perform int to float
        normalization on integer-type values
    stride -- stride in machine units (bytes) between
        consecutive records, normally used to create
        "interleaved" arrays
    pointer -- data-pointer which provides the data-values,
        normally a vertex-buffer-object or offset into the
        same.

    This implementation stores a copy of the data-pointer
    in the contextdata structure in order to prevent null-
    reference errors in the renderer.
    """
    array = ArrayDatatype.asArray( pointer, type )
    key = ('vertex-attrib',index)
    contextdata.setValue( key, array )
    return baseOperation(
        index, size, type,
        normalized, stride,
        ArrayDatatype.voidDataPointer( array )
    )
开发者ID:Kupoman,项目名称:conceptparticles,代码行数:34,代码来源:GL_2_0.py

示例2: copy_data

# 需要导入模块: from OpenGL.arrays.arraydatatype import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.arraydatatype.ArrayDatatype import voidDataPointer [as 别名]
 def copy_data( self ):
     """Copy our data into the buffer on the GL side (if required)
     
     Ensures that the GL's version of the data in the VBO matches our 
     internal view of the data, either by copying the entire data-set 
     over with glBufferData or by updating the already-transferred 
     data with glBufferSubData.
     """
     assert self.buffers, """Should do create_buffers before copy_data"""
     if self.copied:
         if self._copy_segments:
             while self._copy_segments:
                 start,size,data  = self._copy_segments.pop(0)
                 dataptr = ArrayDatatype.voidDataPointer( data )
                 self.implementation.glBufferSubData(self.target, start, size, dataptr)
     else:
         if self.data is not None and self.size is None:
             self.size = ArrayDatatype.arrayByteCount( self.data )
         self.implementation.glBufferData(
             self.target,
             self.size,
             self.data,
             self.usage,
         )
         self.copied = True
开发者ID:Tcll5850,项目名称:UMC3.0a,代码行数:27,代码来源:vbo.py

示例3: copy_data

# 需要导入模块: from OpenGL.arrays.arraydatatype import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.arraydatatype.ArrayDatatype import voidDataPointer [as 别名]
	def copy_data( self ):
		"""Copy our data into the buffer on the GL side"""
		assert self.buffers, """Should do create_buffers before copy_data"""
		if self.copied:
			if self._copy_segments:
				while self._copy_segments:
					start,size,data  = self._copy_segments.pop(0)
					dataptr = ArrayDatatype.voidDataPointer( data )
					self.implementation.glBufferSubData(self.target, start, size, dataptr)
		else:
			self.implementation.glBufferData(
				self.target, 
				self.data,
				self.usage,
			)
			self.copied = True
开发者ID:zoccolan,项目名称:eyetracker,代码行数:18,代码来源:vbo.py

示例4: setSlice

# 需要导入模块: from OpenGL.arrays.arraydatatype import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.arraydatatype.ArrayDatatype import voidDataPointer [as 别名]
 def setSlice(self, start, size, data):
     """
     sets a slice of data.
     """
     dataptr = ArrayDatatype.voidDataPointer( data )
     gl.glBufferSubData( self.target, start, size, dataptr )
开发者ID:daniel-,项目名称:python-gl-engine,代码行数:8,代码来源:vbo.py


注:本文中的OpenGL.arrays.arraydatatype.ArrayDatatype.voidDataPointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。