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


Python retrace.Retracer类代码示例

本文整理汇总了Python中retrace.Retracer的典型用法代码示例。如果您正苦于以下问题:Python Retracer类的具体用法?Python Retracer怎么用?Python Retracer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: extractArg

    def extractArg(self, function, arg, arg_type, lvalue, rvalue):
        if function.name in self.array_pointer_function_names and arg.name == 'pointer':
            print '    %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
            return

        if function.name in self.draw_elements_function_names and arg.name == 'indices' or\
           function.name in self.draw_indirect_function_names and arg.name == 'indirect':
            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
            return

        # Handle pointer with offsets into the current pack pixel buffer
        # object.
        if function.name in self.pack_function_names and arg.output:
            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
            return

        if arg.type is glapi.GLlocation \
           and 'program' not in function.argNames():
            print '    GLint program = -1;'
            print '    glGetIntegerv(GL_CURRENT_PROGRAM, &program);'
        
        if arg.type is glapi.GLlocationARB \
           and 'programObj' not in function.argNames():
            print '    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'

        Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)

        # Don't try to use more samples than the implementation supports
        if arg.name == 'samples':
            assert arg.type is glapi.GLsizei
            print '    GLint max_samples = 0;'
            print '    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);'
            print '    if (samples > max_samples) {'
            print '        samples = max_samples;'
            print '    }'
开发者ID:berkus,项目名称:apitrace,代码行数:35,代码来源:glretrace.py

示例2: retraceApi

    def retraceApi(self, api):
        print '''
static HINSTANCE g_hDll = NULL;

static PROC
__getPublicProcAddress(LPCSTR lpProcName)
{
    if (!g_hDll) {
        char szDll[MAX_PATH] = {0};
        
        if (!GetSystemDirectoryA(szDll, MAX_PATH)) {
            return NULL;
        }
        
        strcat(szDll, "\\\\%s");
        
        g_hDll = LoadLibraryA(szDll);
        if (!g_hDll) {
            return NULL;
        }
    }
        
    return GetProcAddress(g_hDll, lpProcName);
}

''' % api.name

        dispatcher = Dispatcher()
        dispatcher.dispatch_api(api)

        Retracer.retraceApi(self, api)
开发者ID:netconstructor,项目名称:apitrace,代码行数:31,代码来源:dllretrace.py

示例3: call_function

    def call_function(self, function):
        if function.name == "glViewport":
            print '    bool reshape_window = false;'
            print '    if (x + width > glretrace::window_width) {'
            print '        glretrace::window_width = x + width;'
            print '        reshape_window = true;'
            print '    }'
            print '    if (y + height > glretrace::window_height) {'
            print '        glretrace::window_height = y + height;'
            print '        reshape_window = true;'
            print '    }'
            print '    if (reshape_window) {'
            print '        // XXX: does not always work'
            print '        glretrace::drawable->resize(glretrace::window_width, glretrace::window_height);'
            print '        reshape_window = false;'
            print '    }'

        if function.name == "glEnd":
            print '    glretrace::insideGlBeginEnd = false;'
        
        Retracer.call_function(self, function)

        if function.name == "glBegin":
            print '    glretrace::insideGlBeginEnd = true;'
        else:
            # glGetError is not allowed inside glBegin/glEnd
            print '    glretrace::checkGlError();'
开发者ID:bgirard,项目名称:apitrace,代码行数:27,代码来源:glretrace.py

示例4: extract_arg

    def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
        if function.name in self.array_pointer_function_names and arg.name == "pointer":
            print "    %s = static_cast<%s>(%s.toPointer());" % (lvalue, arg_type, rvalue)
            return

        if function.name in self.draw_elements_function_names and arg.name == "indices":
            self.extract_opaque_arg(function, arg, arg_type, lvalue, rvalue)
            return

        if arg.type is glapi.GLlocation and "program" not in [arg.name for arg in function.args]:
            print "    GLint program = -1;"
            print "    glGetIntegerv(GL_CURRENT_PROGRAM, &program);"

        if arg.type is glapi.GLlocationARB and "programObj" not in [arg.name for arg in function.args]:
            print "    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);"

        Retracer.extract_arg(self, function, arg, arg_type, lvalue, rvalue)

        # Don't try to use more samples than the implementation supports
        if arg.name == "samples":
            assert arg.type is glapi.GLsizei
            print "    GLint max_samples = 0;"
            print "    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);"
            print "    if (samples > max_samples) {"
            print "        samples = max_samples;"
            print "    }"
开发者ID:pzick,项目名称:apitrace,代码行数:26,代码来源:glretrace.py

示例5: call_function

    def call_function(self, function):
        if function.name == "glViewport":
            print '    bool reshape_window = false;'
            print '    if (x + width > glretrace::window_width) {'
            print '        glretrace::window_width = x + width;'
            print '        reshape_window = true;'
            print '    }'
            print '    if (y + height > glretrace::window_height) {'
            print '        glretrace::window_height = y + height;'
            print '        reshape_window = true;'
            print '    }'
            print '    if (reshape_window) {'
            print '        // XXX: does not always work'
            print '        glretrace::drawable->resize(glretrace::window_width, glretrace::window_height);'
            print '        reshape_window = false;'
            print '    }'

        if function.name == "glEnd":
            print '    glretrace::insideGlBeginEnd = false;'
        
        Retracer.call_function(self, function)

        if function.name == "glBegin":
            print '    glretrace::insideGlBeginEnd = true;'
        elif function.name.startswith('gl'):
            # glGetError is not allowed inside glBegin/glEnd
            print '    glretrace::checkGlError(call.no);'

        if function.name == 'glFlush':
            print '    if (!glretrace::double_buffer) {'
            print '        glretrace::frame_complete(call.no);'
            print '    }'
开发者ID:mariuz,项目名称:apitrace,代码行数:32,代码来源:glretrace.py

示例6: extract_arg

    def extract_arg(self, function, arg, arg_type, lvalue, rvalue):
        if function.name in self.array_pointer_function_names and arg.name == 'pointer':
            print '    %s = static_cast<%s>(%s.toPointer());' % (lvalue, arg_type, rvalue)
            return

        if function.name in self.draw_elements_function_names and arg.name == 'indices':
            print '    %s = %s.toPointer();' % (lvalue, rvalue)
            return

        if arg.type is glapi.GLlocation \
           and 'program' not in [arg.name for arg in function.args]:
            print '    GLint program = -1;'
            print '    glGetIntegerv(GL_CURRENT_PROGRAM, &program);'
        
        if arg.type is glapi.GLlocationARB \
           and 'programObj' not in [arg.name for arg in function.args]:
            print '    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'

        Retracer.extract_arg(self, function, arg, arg_type, lvalue, rvalue)

        # Don't try to use more samples than the implementation supports
        if arg.name == 'samples':
            assert arg.type is glapi.GLsizei
            print '    GLint max_samples = 0;'
            print '    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);'
            print '    if (samples > max_samples) {'
            print '        samples = max_samples;'
            print '    }'
开发者ID:mysticbob,项目名称:apitrace,代码行数:28,代码来源:glretrace.py

示例7: retrace_function_body

    def retrace_function_body(self, function):
        is_array_pointer = function.name in self.array_pointer_function_names
        is_draw_array = function.name in self.draw_array_function_names
        is_draw_elements = function.name in self.draw_elements_function_names

        if is_array_pointer or is_draw_array or is_draw_elements:
            print '    if (glretrace::parser.version < 1) {'

            if is_array_pointer or is_draw_array:
                print '        GLint __array_buffer = 0;'
                print '        glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &__array_buffer);'
                print '        if (!__array_buffer) {'
                self.fail_function(function)
                print '        }'

            if is_draw_elements:
                print '        GLint __element_array_buffer = 0;'
                print '        glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);'
                print '        if (!__element_array_buffer) {'
                self.fail_function(function)
                print '        }'
            
            print '    }'

        Retracer.retrace_function_body(self, function)

        if function.name in ('glFlush', 'glFinish'):
            print '    if (!glretrace::double_buffer) {'
            print '        glretrace::frame_complete(call.no);'
            print '    }'

        if function.name == 'glReadPixels':
            print '    glFinish();'
            print '    glretrace::snapshot(call.no);'
开发者ID:mysticbob,项目名称:apitrace,代码行数:34,代码来源:glretrace.py

示例8: retrace_function_body

    def retrace_function_body(self, function):
        is_array_pointer = function.name in self.array_pointer_function_names
        is_draw_array = function.name in self.draw_array_function_names
        is_draw_elements = function.name in self.draw_elements_function_names

        if is_array_pointer or is_draw_array or is_draw_elements:
            print '    if (Trace::Parser::version < 1) {'

            if is_array_pointer or is_draw_array:
                print '        GLint __array_buffer = 0;'
                print '        glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &__array_buffer);'
                print '        if (!__array_buffer) {'
                self.fail_function(function)
                print '        }'

            if is_draw_elements:
                print '        GLint __element_array_buffer = 0;'
                print '        glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);'
                print '        if (!__element_array_buffer) {'
                self.fail_function(function)
                print '        }'
            
            print '    }'

        Retracer.retrace_function_body(self, function)
开发者ID:bgirard,项目名称:apitrace,代码行数:25,代码来源:glretrace.py

示例9: retrace_function_body

    def retrace_function_body(self, function):
        is_array_pointer = function.name in self.array_pointer_function_names
        is_draw_array = function.name in self.draw_array_function_names
        is_draw_elements = function.name in self.draw_elements_function_names
        is_misc_draw = function.name in self.misc_draw_function_names

        if is_array_pointer or is_draw_array or is_draw_elements:
            print "    if (glretrace::parser.version < 1) {"

            if is_array_pointer or is_draw_array:
                print "        GLint __array_buffer = 0;"
                print "        glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &__array_buffer);"
                print "        if (!__array_buffer) {"
                self.fail_function(function)
                print "        }"

            if is_draw_elements:
                print "        GLint __element_array_buffer = 0;"
                print "        glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &__element_array_buffer);"
                print "        if (!__element_array_buffer) {"
                self.fail_function(function)
                print "        }"

            print "    }"

        # When no pack buffer object is bound, the pack functions are no-ops.
        if function.name in self.pack_function_names:
            print "    GLint __pack_buffer = 0;"
            print "    glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &__pack_buffer);"
            print "    if (!__pack_buffer) {"
            if function.name == "glReadPixels":
                print "    glFinish();"
                print "    if (glretrace::snapshot_frequency == glretrace::FREQUENCY_FRAME ||"
                print "        glretrace::snapshot_frequency == glretrace::FREQUENCY_FRAMEBUFFER) {"
                print "        glretrace::snapshot(call.no);"
                print "    }"
            print "        return;"
            print "    }"

        # Pre-snapshots
        if function.name in self.bind_framebuffer_function_names:
            print "    if (glretrace::snapshot_frequency == glretrace::FREQUENCY_FRAMEBUFFER) {"
            print "        glretrace::snapshot(call.no - 1);"
            print "    }"
        if function.name == "glFrameTerminatorGREMEDY":
            print "    glretrace::frame_complete(call);"
            return

        Retracer.retrace_function_body(self, function)

        # Post-snapshots
        if function.name in ("glFlush", "glFinish"):
            print "    if (!glretrace::double_buffer) {"
            print "        glretrace::frame_complete(call);"
            print "    }"
        if is_draw_array or is_draw_elements or is_misc_draw:
            print "    if (glretrace::snapshot_frequency == glretrace::FREQUENCY_DRAW) {"
            print "        glretrace::snapshot(call.no);"
            print "    }"
开发者ID:rawoul,项目名称:apitrace,代码行数:59,代码来源:glretrace.py

示例10: extractArg

    def extractArg(self, function, arg, arg_type, lvalue, rvalue):
        if function.name in self.array_pointer_function_names and arg.name == 'pointer':
            print '    %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
            return

        if function.name in self.draw_elements_function_names and arg.name == 'indices' or\
           function.name in self.draw_indirect_function_names and arg.name == 'indirect':
            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
            return

        # Handle pointer with offsets into the current pack pixel buffer
        # object.
        if function.name in self.pack_function_names and arg.output:
            assert isinstance(arg_type, (stdapi.Pointer, stdapi.Array, stdapi.Blob, stdapi.Opaque))
            print '    %s = static_cast<%s>((%s).toPointer());' % (lvalue, arg_type, rvalue)
            return

        if arg.type is glapi.GLlocation \
           and 'program' not in function.argNames():
            # Determine the active program for uniforms swizzling
            print '    GLint program = -1;'
            print '    if (glretrace::insideList) {'
            print '        // glUseProgram & glUseProgramObjectARB are display-list-able'
            print r'    glretrace::Context *currentContext = glretrace::getCurrentContext();'
            print '        program = _program_map[currentContext->activeProgram];'
            print '    } else {'
            print '        GLint pipeline = 0;'
            print '        if (_pipelineHasBeenBound) {'
            print '            glGetIntegerv(GL_PROGRAM_PIPELINE_BINDING, &pipeline);'
            print '        }'
            print '        if (pipeline) {'
            print '            glGetProgramPipelineiv(pipeline, GL_ACTIVE_PROGRAM, &program);'
            print '        } else {'
            print '            glGetIntegerv(GL_CURRENT_PROGRAM, &program);'
            print '        }'
            print '    }'
            print

        if arg.type is glapi.GLlocationARB \
           and 'programObj' not in function.argNames():
            print '    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'

        Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)

        # Don't try to use more samples than the implementation supports
        if arg.name == 'samples':
            assert arg.type is glapi.GLsizei
            print '    GLint max_samples = 0;'
            print '    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);'
            print '    if (samples > max_samples) {'
            print '        samples = max_samples;'
            print '    }'

        # These parameters are referred beyond the call life-time
        # TODO: Replace ad-hoc solution for bindable parameters with general one
        if function.name in ('glFeedbackBuffer', 'glSelectBuffer') and arg.output:
            print '    _allocator.bind(%s);' % arg.name
开发者ID:Hsaniva,项目名称:apitrace,代码行数:57,代码来源:glretrace.py

示例11: retraceApi

    def retraceApi(self, api):
        # Ensure pack function have side effects
        abort = False
        for function in api.getAllFunctions():
            if not function.sideeffects and self.pack_function_regex.match(function.name):
                sys.stderr.write('error: function %s must have sideeffects\n' % function.name)
                abort = True
        if abort:
            sys.exit(1)

        Retracer.retraceApi(self, api)
开发者ID:devedse,项目名称:apitrace,代码行数:11,代码来源:glretrace.py

示例12: retraceFunctionBody

    def retraceFunctionBody(self, function):
        is_array_pointer = function.name in self.array_pointer_function_names
        is_draw_arrays = self.draw_arrays_function_regex.match(function.name) is not None
        is_draw_elements = self.draw_elements_function_regex.match(function.name) is not None
        is_draw_indirect = self.draw_indirect_function_regex.match(function.name) is not None
        is_misc_draw = self.misc_draw_function_regex.match(function.name)

        # For backwards compatibility with old traces where non VBO drawing was supported
        if (is_array_pointer or is_draw_arrays or is_draw_elements) and not is_draw_indirect:
            print '    if (retrace::parser->getVersion() < 1) {'

            if is_array_pointer or is_draw_arrays:
                print '        GLint _array_buffer = 0;'
                print '        glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &_array_buffer);'
                print '        if (!_array_buffer) {'
                self.failFunction(function)
                print '        }'

            if is_draw_elements:
                print '        GLint _element_array_buffer = 0;'
                print '        glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &_element_array_buffer);'
                print '        if (!_element_array_buffer) {'
                self.failFunction(function)
                print '        }'
            
            print '    }'

        # When no pack buffer object is bound, the pack functions are no-ops.
        if self.pack_function_regex.match(function.name):
            print '    GLint _pack_buffer = 0;'
            print '    glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &_pack_buffer);'
            print '    if (!_pack_buffer) {'
            print '        return;'
            print '    }'

        # Pre-snapshots
        if self.bind_framebuffer_function_regex.match(function.name):
            print '    assert(call.flags & trace::CALL_FLAG_SWAP_RENDERTARGET);'
        if function.name == 'glStringMarkerGREMEDY':
            return
        if function.name == 'glFrameTerminatorGREMEDY':
            print '    glretrace::frame_complete(call);'
            return

        Retracer.retraceFunctionBody(self, function)

        # Post-snapshots
        if function.name in ('glFlush', 'glFinish'):
            print '    if (!retrace::doubleBuffer) {'
            print '        glretrace::frame_complete(call);'
            print '    }'
        if is_draw_arrays or is_draw_elements or is_misc_draw:
            print '    assert(call.flags & trace::CALL_FLAG_RENDER);'
开发者ID:devedse,项目名称:apitrace,代码行数:53,代码来源:glretrace.py

示例13: extractArg

    def extractArg(self, function, arg, arg_type, lvalue, rvalue):
        if function.name in self.array_pointer_function_names and arg.name == 'pointer':
            print '    %s = static_cast<%s>(retrace::toPointer(%s, true));' % (lvalue, arg_type, rvalue)
            return

        if self.draw_elements_function_regex.match(function.name) and arg.name == 'indices' or\
           self.draw_indirect_function_regex.match(function.name) and arg.name == 'indirect':
            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
            return

        # Handle pointer with offsets into the current pack pixel buffer
        # object.
        if self.pack_function_regex.match(function.name) and arg.output:
            assert isinstance(arg_type, (stdapi.Pointer, stdapi.Array, stdapi.Blob, stdapi.Opaque))
            print '    %s = static_cast<%s>((%s).toPointer());' % (lvalue, arg_type, rvalue)
            return
        if function.name.startswith('glGetQueryObject') and arg.output:
            print '    %s = static_cast<%s>((%s).toPointer());' % (lvalue, arg_type, rvalue)
            return

        if (arg.type.depends(glapi.GLlocation) or \
            arg.type.depends(glapi.GLsubroutine)) \
           and 'program' not in function.argNames():
            # Determine the active program for uniforms swizzling
            print '    GLint program = _getActiveProgram();'

        if arg.type is glapi.GLlocationARB \
           and 'programObj' not in function.argNames():
            print '    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);'

        Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)

        # Don't try to use more samples than the implementation supports
        if arg.name == 'samples':
            if function.name == 'glRasterSamplesEXT':
                assert arg.type is glapi.GLuint
                print '    GLint max_samples = 0;'
                print '    glGetIntegerv(GL_MAX_RASTER_SAMPLES_EXT, &max_samples);'
                print '    if (samples > static_cast<GLuint>(max_samples)) {'
                print '        samples = static_cast<GLuint>(max_samples);'
                print '    }'
            else:
                assert arg.type is glapi.GLsizei
                print '    GLint max_samples = 0;'
                print '    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);'
                print '    if (samples > max_samples) {'
                print '        samples = max_samples;'
                print '    }'

        # These parameters are referred beyond the call life-time
        # TODO: Replace ad-hoc solution for bindable parameters with general one
        if function.name in ('glFeedbackBuffer', 'glSelectBuffer') and arg.output:
            print '    _allocator.bind(%s);' % arg.name
开发者ID:janesma,项目名称:apitrace,代码行数:53,代码来源:glretrace.py

示例14: extractArg

    def extractArg(self, function, arg, arg_type, lvalue, rvalue):
        if function.name in self.array_pointer_function_names and arg.name == "pointer":
            print "    %s = static_cast<%s>(retrace::toPointer(%s, true));" % (lvalue, arg_type, rvalue)
            return

        if (
            function.name in self.draw_elements_function_names
            and arg.name == "indices"
            or function.name in self.draw_indirect_function_names
            and arg.name == "indirect"
        ):
            self.extractOpaqueArg(function, arg, arg_type, lvalue, rvalue)
            return

        # Handle pointer with offsets into the current pack pixel buffer
        # object.
        if function.name in self.pack_function_names and arg.output:
            assert isinstance(arg_type, (stdapi.Pointer, stdapi.Array, stdapi.Blob, stdapi.Opaque))
            print "    %s = static_cast<%s>((%s).toPointer());" % (lvalue, arg_type, rvalue)
            return

        if arg.type is glapi.GLlocation and "program" not in function.argNames():
            # Determine the active program for uniforms swizzling
            print "    GLint program = -1;"
            print "    GLint pipeline = 0;"
            print "    if (_pipelineHasBeenBound) {"
            print "        glGetIntegerv(GL_PROGRAM_PIPELINE_BINDING, &pipeline);"
            print "    }"
            print "    if (pipeline) {"
            print "        glGetProgramPipelineiv(pipeline, GL_ACTIVE_PROGRAM, &program);"
            print "    } else {"
            print "        glGetIntegerv(GL_CURRENT_PROGRAM, &program);"
            print "    }"
            print

        if arg.type is glapi.GLlocationARB and "programObj" not in function.argNames():
            print "    GLhandleARB programObj = glGetHandleARB(GL_PROGRAM_OBJECT_ARB);"

        Retracer.extractArg(self, function, arg, arg_type, lvalue, rvalue)

        # Don't try to use more samples than the implementation supports
        if arg.name == "samples":
            assert arg.type is glapi.GLsizei
            print "    GLint max_samples = 0;"
            print "    glGetIntegerv(GL_MAX_SAMPLES, &max_samples);"
            print "    if (samples > max_samples) {"
            print "        samples = max_samples;"
            print "    }"

        # These parameters are referred beyond the call life-time
        # TODO: Replace ad-hoc solution for bindable parameters with general one
        if function.name in ("glFeedbackBuffer", "glSelectBuffer") and arg.output:
            print "    _allocator.bind(%s);" % arg.name
开发者ID:solochang,项目名称:apitrace,代码行数:53,代码来源:glretrace.py

示例15: retraceFunctionBody

    def retraceFunctionBody(self, function):
        is_array_pointer = function.name in self.array_pointer_function_names
        is_draw_array = function.name in self.draw_array_function_names
        is_draw_elements = function.name in self.draw_elements_function_names
        is_misc_draw = function.name in self.misc_draw_function_names

        if is_array_pointer or is_draw_array or is_draw_elements:
            print '    if (retrace::parser.version < 1) {'

            if is_array_pointer or is_draw_array:
                print '        GLint _array_buffer = 0;'
                print '        glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &_array_buffer);'
                print '        if (!_array_buffer) {'
                self.failFunction(function)
                print '        }'

            if is_draw_elements:
                print '        GLint _element_array_buffer = 0;'
                print '        glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &_element_array_buffer);'
                print '        if (!_element_array_buffer) {'
                self.failFunction(function)
                print '        }'
            
            print '    }'

        # When no pack buffer object is bound, the pack functions are no-ops.
        if function.name in self.pack_function_names:
            print '    GLint _pack_buffer = 0;'
            print '    glGetIntegerv(GL_PIXEL_PACK_BUFFER_BINDING, &_pack_buffer);'
            print '    if (!_pack_buffer) {'
            print '        return;'
            print '    }'

        # Pre-snapshots
        if function.name in self.bind_framebuffer_function_names:
            print '    assert(call.flags & trace::CALL_FLAG_SWAP_RENDERTARGET);'
        if function.name == 'glStringMarkerGREMEDY':
            return
        if function.name == 'glFrameTerminatorGREMEDY':
            print '    glretrace::frame_complete(call);'
            return

        Retracer.retraceFunctionBody(self, function)

        # Post-snapshots
        if function.name in ('glFlush', 'glFinish'):
            print '    if (!retrace::doubleBuffer) {'
            print '        glretrace::frame_complete(call);'
            print '    }'
        if is_draw_array or is_draw_elements or is_misc_draw:
            print '    assert(call.flags & trace::CALL_FLAG_RENDER);'
开发者ID:Acidburn0zzz,项目名称:apitrace,代码行数:51,代码来源:glretrace.py


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