本文整理汇总了Python中specs.stdapi.API类的典型用法代码示例。如果您正苦于以下问题:Python API类的具体用法?Python API怎么用?Python API使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了API类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
def main():
print r'#define INITGUID'
print
print r'#include <string.h>'
print
print r'#include <iostream>'
print
print r'#include "d3dretrace.hpp"'
print r'#include "os_version.hpp"'
print
print r'#include "d3dretrace_dxgi.hpp"'
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
print r'#include "d3d10state.hpp"'
print r'#include "d3d11imports.hpp"'
print r'#include "d3d11size.hpp"'
print r'#include "dcompimports.hpp"'
print r'#include "d3dstate.hpp"'
print r'#include "d3d9imports.hpp" // D3DERR_WASSTILLDRAWING'
print
print '''static d3dretrace::D3DDumper<IDXGISwapChain> dxgiDumper;'''
print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
print '''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
print
api = API()
api.addModule(dxgi)
api.addModule(d3d10)
api.addModule(d3d10_1)
api.addModule(d3d11)
api.addModule(dcomp)
retracer = D3DRetracer()
retracer.retraceApi(api)
示例2: main
def main():
print r"#define INITGUID"
print
print r"#include <string.h>"
print
print r"#include <iostream>"
print
print r'#include "d3dretrace.hpp"'
print r'#include "os_version.hpp"'
print
print r'#include "d3dretrace_dxgi.hpp"'
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
print r'#include "d3d10state.hpp"'
print r'#include "d3d11imports.hpp"'
print r'#include "d3d11size.hpp"'
print r'#include "d3dstate.hpp"'
print
print """static d3dretrace::D3DDumper<IDXGISwapChain> dxgiDumper;"""
print """static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;"""
print """static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;"""
print
api = API()
api.addModule(dxgi)
api.addModule(d3d10)
api.addModule(d3d10_1)
api.addModule(d3d11)
retracer = D3DRetracer()
retracer.retraceApi(api)
示例3: main
def main():
print r'#define INITGUID'
print
print r'#include <string.h>'
print
print r'#include <iostream>'
print
print r'#include "d3dretrace.hpp"'
print r'#include "os_version.hpp"'
print
moduleNames = sys.argv[1:]
api = API()
if moduleNames:
print r'#include "d3dretrace_dxgi.hpp"'
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
print r'#include "d3d10state.hpp"'
print r'#include "d3d11imports.hpp"'
print r'#include "d3d11size.hpp"'
print r'#include "d3dstate.hpp"'
print
print '''static d3dretrace::D3DDumper<IDXGISwapChain> dxgiDumper;'''
print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
print '''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
print
print r'''
static void
createWindow(DXGI_SWAP_CHAIN_DESC *pSwapChainDesc) {
UINT Width = pSwapChainDesc->BufferDesc.Width;
UINT Height = pSwapChainDesc->BufferDesc.Height;
if (!Width) Width = 1024;
if (!Height) Height = 768;
if (retrace::forceWindowed) {
pSwapChainDesc->Windowed = TRUE;
}
pSwapChainDesc->OutputWindow = d3dretrace::createWindow(Width, Height);
}
'''
api.addModule(dxgi)
api.addModule(d3d10)
api.addModule(d3d10_1)
api.addModule(d3d11)
retracer = D3DRetracer()
retracer.retraceApi(api)
示例4: main
def main():
print r'#include <string.h>'
print
print r'#include <iostream>'
print
print r'#include "d3dretrace.hpp"'
print
api = API()
print r'#include "d3dimports.hpp"'
api.addModule(ddraw)
print
print '''static d3dretrace::D3DDumper<IDirect3DDevice7> d3d7Dumper;'''
print
retracer = D3DRetracer()
retracer.table_name = 'd3dretrace::ddraw_callbacks'
retracer.retraceApi(api)
示例5: main
def main():
print r'#define INITGUID'
print
print r'#include <string.h>'
print
print r'#include <iostream>'
print
print r'#include "d3dretrace.hpp"'
print
moduleNames = sys.argv[1:]
api = API()
if moduleNames:
print r'#include "d3dretrace_dxgi.hpp"'
api.addModule(dxgi)
if 'd3d10' in moduleNames:
if 'd3d10_1' in moduleNames:
print r'#include "d3d10_1imports.hpp"'
api.addModule(d3d10_1)
else:
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
api.addModule(d3d10)
print
print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
print
if 'd3d11' in moduleNames:
print r'#include "d3d11imports.hpp"'
if 'd3d11_1' in moduleNames:
print '#include <d3d11_1.h>'
import specs.d3d11_1
print r'#include "d3d11size.hpp"'
print r'#include "d3dstate.hpp"'
api.addModule(d3d11)
print
print '''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
print
retracer = D3DRetracer()
retracer.retraceApi(api)
示例6: main
def main():
print r'#include <string.h>'
print
print r'#include <iostream>'
print
print r'#include "d3dretrace.hpp"'
print
moduleName = sys.argv[1]
support = int(sys.argv[2])
api = API()
if support:
if moduleName == 'd3d9':
from specs.d3d9 import d3d9, d3dperf
print r'#include "d3d9imports.hpp"'
print r'#include "d3d9size.hpp"'
d3d9.mergeModule(d3dperf)
api.addModule(d3d9)
print
print '''static d3dretrace::D3DDumper<IDirect3DDevice9> d3d9Dumper;'''
print
elif moduleName == 'd3d8':
from specs.d3d8 import d3d8
print r'#include "d3d8imports.hpp"'
print r'#include "d3d8size.hpp"'
api.addModule(d3d8)
print
print '''static d3dretrace::D3DDumper<IDirect3DDevice8> d3d8Dumper;'''
print
else:
assert False
retracer = D3DRetracer()
retracer.table_name = 'd3dretrace::%s_callbacks' % moduleName
retracer.retraceApi(api)
示例7: main
def main():
print r'#define INITGUID'
print
print r'#include <string.h>'
print
print r'#include <iostream>'
print
print r'#include "d3dretrace.hpp"'
print r'#include "os_version.hpp"'
print
moduleNames = sys.argv[1:]
api = API()
if moduleNames:
print r'#include "d3dretrace_dxgi.hpp"'
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
print r'#include "d3d10state.hpp"'
print r'#include "d3d11imports.hpp"'
print r'#include "d3d11size.hpp"'
print r'#include "d3dstate.hpp"'
print
print '''static d3dretrace::D3DDumper<IDXGISwapChain> dxgiDumper;'''
print '''static d3dretrace::D3DDumper<ID3D10Device> d3d10Dumper;'''
print '''static d3dretrace::D3DDumper<ID3D11DeviceContext> d3d11Dumper;'''
print
api.addModule(dxgi)
api.addModule(d3d10)
api.addModule(d3d10_1)
api.addModule(d3d11)
retracer = D3DRetracer()
retracer.retraceApi(api)
示例8: main
def main():
print r"#include <string.h>"
print
print r"#include <iostream>"
print
print r'#include "d3dretrace.hpp"'
print
moduleName = sys.argv[1]
support = int(sys.argv[2])
api = API()
if support:
if moduleName == "d3d9":
from specs.d3d9 import d3d9, d3dperf
from specs.dxva2 import dxva2
print r'#include "d3d9imports.hpp"'
print r'#include "d3d9size.hpp"'
print r'#include "dxva2imports.hpp"'
d3d9.mergeModule(d3dperf)
api.addModule(d3d9)
api.addModule(dxva2)
print
print """static d3dretrace::D3DDumper<IDirect3DDevice9> d3d9Dumper;"""
print """static d3dretrace::D3DDumper<IDirect3DSwapChain9> d3d9scDumper;"""
print
elif moduleName == "d3d8":
from specs.d3d8 import d3d8
print r'#include "d3d8imports.hpp"'
print r'#include "d3d8size.hpp"'
api.addModule(d3d8)
print
print """static d3dretrace::D3DDumper<IDirect3DDevice8> d3d8Dumper;"""
print
else:
assert False
retracer = D3DRetracer()
retracer.table_name = "d3dretrace::%s_callbacks" % moduleName
retracer.retraceApi(api)
示例9: API
print ' } else {'
print ' _MapDesc.pData = NULL;'
print ' _MapDesc.Size = 0;'
print ' }'
#print r' os::log("%%p <- %%p+%%lu\n", %s,_MapDesc.pData, (unsigned long)_MapDesc.Size);' % pResource
print ' %s->_MapDesc = _MapDesc;' % pResource
if __name__ == '__main__':
print r'#define INITGUID'
print
print r'#include "trace_writer_local.hpp"'
print r'#include "os.hpp"'
print
print r'#include "d3dcommonshader.hpp"'
print
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
print r'#include "d3d11imports.hpp"'
print r'#include "d3d11size.hpp"'
print
api = API()
api.addModule(dxgi.dxgi)
api.addModule(d3d10.d3d10)
api.addModule(d3d10_1.d3d10_1)
api.addModule(d3d11.d3d11)
tracer = D3DCommonTracer()
tracer.traceApi(api)
示例10: __unwrap_proc_addr
print '#endif'
print '#include <dlfcn.h>'
print
print '#include "trace_writer_local.hpp"'
print
print '// To validate our prototypes'
print '#define GL_GLEXT_PROTOTYPES'
print '#define GLX_GLXEXT_PROTOTYPES'
print
print '#include "glproc.hpp"'
print '#include "glsize.hpp"'
print
print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr);'
print
api = API()
api.addApi(glxapi)
api.addApi(glapi)
tracer = GlxTracer()
tracer.trace_api(api)
print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr) {'
print ' if (!procPtr) {'
print ' return procPtr;'
print ' }'
for f in api.functions:
ptype = function_pointer_type(f)
pvalue = function_pointer_value(f)
print ' if (strcmp("%s", (const char *)procName) == 0) {' % f.name
print ' %s = (%s)procPtr;' % (pvalue, ptype)
print ' return (__GLXextFuncPtr)&%s;' % (f.name,)
示例11: Module
print '#include <dlfcn.h>'
print
print '#include "trace_writer_local.hpp"'
print
print '// To validate our prototypes'
print '#define GL_GLEXT_PROTOTYPES'
print '#define GLX_GLXEXT_PROTOTYPES'
print
print '#include "glproc.hpp"'
print '#include "glsize.hpp"'
print
module = Module()
module.mergeModule(glxapi)
module.mergeModule(glapi)
api = API()
api.addModule(module)
tracer = GlxTracer()
tracer.traceApi(api)
print r'''
/*
* Invoke the true dlopen() function.
*/
static void *_dlopen(const char *filename, int flag)
{
typedef void * (*PFN_DLOPEN)(const char *, int);
static PFN_DLOPEN dlopen_ptr = NULL;
示例12: API
# all OpenGL symbols are visible on MacOSX
return True
if __name__ == '__main__':
print
print '#include <stdlib.h>'
print '#include <string.h>'
print
print '#include "trace_writer_local.hpp"'
print
print '// To validate our prototypes'
print '#define GL_GLEXT_PROTOTYPES'
print
print '#include "glproc.hpp"'
print '#include "glsize.hpp"'
print
api = API()
api.addApi(cglapi)
api.addApi(glapi)
tracer = CglTracer()
tracer.traceApi(api)
print r'''
PUBLIC
void * gll_noop = 0;
'''
示例13: API
print ' _MappedSize = 0;'
print ' }'
if __name__ == '__main__':
print '#define INITGUID'
print
print '#include "trace_writer_local.hpp"'
print '#include "os.hpp"'
print
print '#include "d3dcommonshader.hpp"'
print
moduleNames = sys.argv[1:]
api = API()
if moduleNames:
api.addModule(dxgi)
if 'd3d10' in moduleNames:
if 'd3d10_1' in moduleNames:
print r'#include "d3d10_1imports.hpp"'
api.addModule(d3d10_1)
else:
print r'#include "d3d10imports.hpp"'
print r'#include "d3d10size.hpp"'
api.addModule(d3d10)
if 'd3d11' in moduleNames:
print r'#include "d3d11imports.hpp"'
示例14: handle_default
def handle_default():
print ' os::log("apitrace: warning: unknown function \\"%s\\"\\n", lpszProc);'
string_switch('lpszProc', func_dict.keys(), handle_case, handle_default)
print ' }'
if __name__ == '__main__':
print
print '#define _GDI32_'
print
print '#include <string.h>'
print '#include <windows.h>'
print
print '#include "trace_writer_local.hpp"'
print '#include "os.hpp"'
print
print '// To validate our prototypes'
print '#define GL_GLEXT_PROTOTYPES'
print '#define WGL_GLXEXT_PROTOTYPES'
print
print '#include "glproc.hpp"'
print '#include "glsize.hpp"'
print
api = API()
api.add_api(glapi)
api.add_api(wglapi)
tracer = WglTracer()
tracer.trace_api(api)
示例15: __unwrap_proc_addr
print '#endif'
print '#include <dlfcn.h>'
print
print '#include "trace_writer_local.hpp"'
print
print '// To validate our prototypes'
print '#define GL_GLEXT_PROTOTYPES'
print '#define GLX_GLXEXT_PROTOTYPES'
print
print '#include "glproc.hpp"'
print '#include "glsize.hpp"'
print
print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr);'
print
api = API()
api.add_api(glxapi)
api.add_api(glapi)
tracer = GlxTracer()
tracer.trace_api(api)
print 'static __GLXextFuncPtr __unwrap_proc_addr(const GLubyte * procName, __GLXextFuncPtr procPtr) {'
print ' if (!procPtr) {'
print ' return procPtr;'
print ' }'
for f in api.functions:
ptype = function_pointer_type(f)
pvalue = function_pointer_value(f)
print ' if (strcmp("%s", (const char *)procName) == 0) {' % f.name
print ' %s = (%s)procPtr;' % (pvalue, ptype)
print ' return (__GLXextFuncPtr)&%s;' % (f.name,)