def main(): """Main function.""" args = _parser() if args.mode == "dispatch_c": printer = PrintGlxDispatchFunctions(args.swap) elif args.mode == "dispatch_h": printer = PrintGlxDispatch_h() api = gl_XML.parse_GL_API( args.filename, glX_proto_common.glx_proto_item_factory()) printer.Print(api)
if __name__ == '__main__': file_name = "gl_API.xml" try: (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") except Exception,e: show_usage() mode = "dispatch_c" do_swap = 0 for (arg,val) in args: if arg == "-f": file_name = val elif arg == "-m": mode = val elif arg == "-s": do_swap = 1 if mode == "dispatch_c": printer = PrintGlxDispatchFunctions(do_swap) elif mode == "dispatch_h": printer = PrintGlxDispatch_h() else: show_usage() api = gl_XML.parse_GL_API( file_name, glX_proto_common.glx_proto_item_factory() ) printer.Print( api )
if __name__ == '__main__': file_name = "gl_API.xml" try: (args, trail) = getopt.getopt(sys.argv[1:], "f:m:s") except Exception, e: show_usage() mode = "dispatch_c" do_swap = 0 for (arg, val) in args: if arg == "-f": file_name = val elif arg == "-m": mode = val elif arg == "-s": do_swap = 1 if mode == "dispatch_c": printer = PrintGlxDispatchFunctions(do_swap) elif mode == "dispatch_h": printer = PrintGlxDispatch_h() else: show_usage() api = gl_XML.parse_GL_API(file_name, glX_proto_common.glx_proto_item_factory()) printer.Print(api)