本文整理汇总了Python中trace.Tracer.wrapRet方法的典型用法代码示例。如果您正苦于以下问题:Python Tracer.wrapRet方法的具体用法?Python Tracer.wrapRet怎么用?Python Tracer.wrapRet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类trace.Tracer
的用法示例。
在下文中一共展示了Tracer.wrapRet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: wrapRet
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import wrapRet [as 别名]
def wrapRet(self, function, instance):
Tracer.wrapRet(self, function, instance)
# Replace function addresses with ours
if function.name in self.getProcAddressFunctionNames:
print ' %s = _wrapProcAddress(%s, %s);' % (instance, function.args[0].name, instance)
# Keep track of buffer mappings
if function.name in ('glMapBuffer', 'glMapBufferARB'):
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
print ' mapping->map = %s;' % (instance)
print ' mapping->length = 0;'
print ' __glGetBufferParameteriv(target, GL_BUFFER_SIZE, &mapping->length);'
print ' mapping->write = (access != GL_READ_ONLY);'
print ' mapping->explicit_flush = false;'
print ' }'
if function.name == 'glMapBufferRange':
print ' if (access & GL_MAP_WRITE_BIT) {'
print ' __checkBufferMapRange = true;'
print ' }'
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
print ' mapping->map = %s;' % (instance)
print ' mapping->length = length;'
print ' mapping->write = access & GL_MAP_WRITE_BIT;'
print ' mapping->explicit_flush = access & GL_MAP_FLUSH_EXPLICIT_BIT;'
print ' }'
示例2: wrapRet
# 需要导入模块: from trace import Tracer [as 别名]
# 或者: from trace.Tracer import wrapRet [as 别名]
def wrapRet(self, function, instance):
Tracer.wrapRet(self, function, instance)
if function.name in ('glMapBuffer', 'glMapBufferARB', 'glMapBufferOES'):
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
print ' mapping->map = %s;' % (instance)
print ' mapping->length = 0;'
print ' __glGetBufferParameteriv(target, GL_BUFFER_SIZE, &mapping->length);'
print ' mapping->write = (access != GL_READ_ONLY);'
print ' mapping->explicit_flush = false;'
print ' }'
if function.name == 'glMapBufferRange':
print ' struct buffer_mapping *mapping = get_buffer_mapping(target);'
print ' if (mapping) {'
print ' mapping->map = %s;' % (instance)
print ' mapping->length = length;'
print ' mapping->write = access & GL_MAP_WRITE_BIT;'
print ' mapping->explicit_flush = access & GL_MAP_FLUSH_EXPLICIT_BIT;'
print ' }'