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


Python ArrayDatatype.asArray方法代码示例

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


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

示例1: glBufferSubData

# 需要导入模块: from OpenGL.arrays import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.ArrayDatatype import asArray [as 别名]
def glBufferSubData( baseOperation, target, offset, size=None, data=None ):
    """Copy subset of data into the currently bound vertex-buffer-data object

    target -- the symbolic constant indicating which buffer type is intended
    offset -- offset from beginning of buffer at which to copy bytes
    size -- the count-in-bytes of the array (if an int/long), if None,
        calculate size from data, if an array and data is None, use as
        data (i.e. the parameter can be omitted and calculated)
    data -- data-pointer to be used, may be None to initialize without
        copying over a data-set

    Note that if size is not an int/long it is considered to be data
    *iff* data is None
    """
    if size is None:
        if data is None:
            raise TypeError( "Need data or size" )
    elif (not isinstance( size, integer_types)) and (data is None):
        data = size 
        size = None
    try:
        if size is not None:
            size = int( size )
    except TypeError:
        if data is not None:
            raise TypeError(
                """Expect an integer size *or* a data-array, not both"""
            )
        data = size
        size = None
    data = ArrayDatatype.asArray( data )
    if size is None:
        size = ArrayDatatype.arrayByteCount( data )
    return baseOperation( target, offset, size, data )
开发者ID:CaptainAL,项目名称:Spyder,代码行数:36,代码来源:GL_1_5.py

示例2: glBufferDataARB

# 需要导入模块: from OpenGL.arrays import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.ArrayDatatype import asArray [as 别名]
def glBufferDataARB( baseOperation, target, size, data=None, usage=None ):
    """Copy given data into the currently bound vertex-buffer-data object
    
    target -- the symbolic constant indicating which buffer type is intended
    size -- if provided, the count-in-bytes of the array
    data -- data-pointer to be used, may be None to initialize without 
        copying over a data-set 
    usage -- hint to the driver as to how to set up access to the buffer 
    
    Note: parameter "size" can be omitted, which makes the signature
        glBufferData( target, data, usage )
    instead of:
        glBufferData( target, size, data, usage )
    """
    if usage is None:
        usage = data 
        data = size 
        size = None 
    data = ArrayDatatype.asArray( data )
    if size is None:
        size = ArrayDatatype.arrayByteCount( data )
    return baseOperation( target, size, data, usage )
开发者ID:AJMartel,项目名称:3DPrinter,代码行数:24,代码来源:vertex_buffer_object.py

示例3: baseOperation

# 需要导入模块: from OpenGL.arrays import ArrayDatatype [as 别名]
# 或者: from OpenGL.arrays.ArrayDatatype import asArray [as 别名]
    return baseOperation( target, size, data, usage )

@lazy( glBufferSubDataARB )
def glBufferSubDataARB( baseOperation, target, offset, size, data=None ):
    """Copy subset of data into the currently bound vertex-buffer-data object
    
    target -- the symbolic constant indicating which buffer type is intended
    offset -- offset from beginning of buffer at which to copy bytes
    size -- the count-in-bytes of the array (if an int/long), if None,
        calculate size from data, if an array and data is None, use as 
        data (i.e. the parameter can be omitted and calculated)
    data -- data-pointer to be used, may be None to initialize without 
        copying over a data-set 
    
    Note that if size is not an int/long it is considered to be data
    """
    try:
        if size is not None:
            size = int( size )
    except TypeError, err:
        if data is not None:
            raise TypeError(
                """Expect an integer size *or* a data-array, not both"""
            )
        data = size 
        size = None 
    data = ArrayDatatype.asArray( data )
    if size is None:
        size = ArrayDatatype.arrayByteCount( data )
    return baseOperation( target, offset, size, data )
开发者ID:AJMartel,项目名称:3DPrinter,代码行数:32,代码来源:vertex_buffer_object.py


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