예제 #1
0
def _tessellate_error(code):
    # Called when an error occurs.
    e, s, i = gluErrorString(code), "", 0
    while e[i]:
        s += chr(e[i])
        i += 1
    raise Exception(s)
예제 #2
0
def _tessellate_error(code):
    # Called when an error occurs.
    e, s, i = gluErrorString(code), "", 0
    while e[i]: 
        s += chr(e[i])
        i += 1
    raise Exception(s)
예제 #3
0
파일: lib.py 프로젝트: tkrym02/anaconda
def errcheck(result=None, func=None, arguments=None):
    if _debug_gl_trace:
        try:
            name = func.__name__
        except AttributeError:
            name = repr(func)
        if _debug_gl_trace_args:
            trace_args = ', '.join([repr(arg)[:20] for arg in arguments])
            print '%s(%s)' % (name, trace_args)
        else:
            print name

    from pyglet import gl
    context = gl.current_context
    if not context:
        raise GLException('No GL context; create a Window first')
    if not context._gl_begin:
        error = gl.glGetError()
        # special cases
        if error:
            msg = (ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
                   or ('Error %s' % error))
            try:
                msg += ' (%s %s)' % (func.name, arguments)
            except AttributeError:
                msg += ' (%s)' % (func)
            raise GLException(msg)
        return result
예제 #4
0
파일: lib.py 프로젝트: Matt-Esch/anaconda
def errcheck(result = None, func = None, arguments = None):
    if _debug_gl_trace:
        try:
            name = func.__name__
        except AttributeError:
            name = repr(func)
        if _debug_gl_trace_args:
            trace_args = ', '.join([repr(arg)[:20] for arg in arguments])
            print '%s(%s)' % (name, trace_args)
        else:
            print name

    from pyglet import gl
    context = gl.current_context
    if not context:
        raise GLException('No GL context; create a Window first')
    if not context._gl_begin:
        error = gl.glGetError()
        # special cases
        if error:
            msg = (ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
                   or ('Error %s' % error))
            try:
                msg += ' (%s %s)' % (func.name, arguments)
            except AttributeError:
                msg += ' (%s)' % (func)
            raise GLException(msg)
        return result
예제 #5
0
 def errorCallback(code):
     ptr = gluErrorString(code)
     err = ''
     idx = 0
     while ptr[idx]:
         err += chr(ptr[idx])
         idx += 1
     self.warn("GLU Tesselation Error: " + err)
예제 #6
0
 def errorCallback(code):
     ptr = gluErrorString(code)
     err = ''
     idx = 0
     while ptr[idx]:
         err += chr(ptr[idx])
         idx += 1
     self.warn("GLU Tesselation Error: " + err)
예제 #7
0
 def my_errcheck(result, func, arguments):
     from pyglet import gl
     error = gl.glGetError()
     if error and error != 1286:
         # HACK: The 1286(INVALID_FRAMEBUFFER_OPERATION) error again!
         # This time I DIDN'T EVEN USE FBO! ATI!!
         msg = ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
         raise gl.GLException((error, msg))
     return result
예제 #8
0
 def my_errcheck(result, func, arguments):
     from pyglet import gl
     error = gl.glGetError()
     if error and error != 1286:
         # HACK: The 1286(INVALID_FRAMEBUFFER_OPERATION) error again!
         # This time I DIDN'T EVEN USE FBO! ATI!!
         msg = ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
         raise gl.GLException((error, msg))
     return result
예제 #9
0
def errcheck(result, func, arguments):
    from pyglet.gl import get_current_context
    context = get_current_context()
    if not context:
        raise GLException('No GL context; create a Window first')
    if not context._gl_begin:
        from pyglet.gl import glGetError, gluErrorString
        error = glGetError()
        if error:
            message = ctypes.cast(gluErrorString(error), ctypes.c_char_p).value
            raise GLException(message)
        return result
예제 #10
0
파일: lib.py 프로젝트: certik/sympy-oldcore
def errcheck(result, func, arguments):
    from pyglet.gl import get_current_context
    context = get_current_context()
    if not context:
        raise GLException('No GL context; create a Window first')
    if not context._gl_begin:
        from pyglet.gl import glGetError, gluErrorString
        error = glGetError()
        if error:
            message = ctypes.cast(gluErrorString(error), ctypes.c_char_p).value
            raise GLException(message)
        return result
예제 #11
0
def errcheck(result, func, arguments):
    if _debug_gl_trace:
        try:
            name = func.__name__
        except AttributeError:
            name = repr(func)
        if _debug_gl_trace_args:
            trace_args = ', '.join([repr(arg)[:20] for arg in arguments])
            print('%s(%s)' % (name, trace_args))
        else:
            print(name)

    from pyglet import gl
    context = gl.current_context
    if not context:
        raise GLException('No GL context; create a Window first')
    error = gl.glGetError()
    if error:
        msg = ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
        raise GLException(msg)
    return result
예제 #12
0
파일: lib.py 프로젝트: cajlarsson/village
def errcheck(result, func, arguments):
    if _debug_gl_trace:
        try:
            name = func.__name__
        except AttributeError:
            name = repr(func)
        if _debug_gl_trace_args:
            trace_args = ', '.join([repr(arg)[:20] for arg in arguments])
            print('%s(%s)' % (name, trace_args))
        else:
            print(name)

    from pyglet import gl
    context = gl.current_context
    if not context:
        raise GLException('No GL context; create a Window first')
    if not context._gl_begin:
        error = gl.glGetError()
        if error:
            msg = ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
            raise GLException(msg)
        return result