Ejemplo n.º 1
0
def glGetShaderPrecisionFormat(baseOperation, shadertype, precisiontype, range=None,precision=None ):
    """Provides range and precision if not provided, returns (range,precision)"""
    if range is None:
        range = GLintArray.zeros( (2,))
    if precision is None:
        precision = GLintArray.zeros((2,))
    baseOperation( shadertype, precisiontype, range, precision )
    return range, precision
def glGetShaderPrecisionFormat(baseOperation, shadertype, precisiontype, range=None,precision=None ):
    """Provides range and precision if not provided, returns (range,precision)"""
    if range is None:
        range = GLintArray.zeros( (2,))
    if precision is None:
        precision = GLintArray.zeros((2,))
    baseOperation( shadertype, precisiontype, range, precision )
    return range, precision
Ejemplo n.º 3
0
def glGetSync( sync, pname, bufSize=1,length=None,values=None ):
    """Wrapper around glGetSynciv that auto-allocates buffers
    
    sync -- the GLsync struct pointer (see glGetSynciv)
    pname -- constant to retrieve (see glGetSynciv)
    bufSize -- defaults to 1, maximum number of items to retrieve,
        currently all constants are defined to return a single 
        value 
    length -- None or a GLint() instance (ONLY!), must be a byref()
        capable object with a .value attribute which retrieves the 
        set value
    values -- None or an array object, if None, will be a default 
        return-array-type of length bufSize
    
    returns values[:length.value], i.e. an array with the values set 
    by the call, currently always a single-value array.
    """
    if values is None:
        values = GLintArray.zeros( (bufSize,) )
    if length is None:
        length = GLint()
    glGetSynciv( sync, pname, bufSize, length, values )
    written = length.value 
    return values[:written]
Ejemplo n.º 4
0
def glGetSync( sync, pname, bufSize=1,length=None,values=None ):
    """Wrapper around glGetSynciv that auto-allocates buffers
    
    sync -- the GLsync struct pointer (see glGetSynciv)
    pname -- constant to retrieve (see glGetSynciv)
    bufSize -- defaults to 1, maximum number of items to retrieve,
        currently all constants are defined to return a single 
        value 
    length -- None or a GLint() instance (ONLY!), must be a byref()
        capable object with a .value attribute which retrieves the 
        set value
    values -- None or an array object, if None, will be a default 
        return-array-type of length bufSize
    
    returns values[:length.value], i.e. an array with the values set 
    by the call, currently always a single-value array.
    """
    if values is None:
        values = GLintArray.zeros( (bufSize,) )
    if length is None:
        length = GLint()
    glGetSynciv( sync, pname, bufSize, length, values )
    written = length.value 
    return values[:written]