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


Python App.drawDelegate方法代码示例

本文整理汇总了Python中app.App.drawDelegate方法的典型用法代码示例。如果您正苦于以下问题:Python App.drawDelegate方法的具体用法?Python App.drawDelegate怎么用?Python App.drawDelegate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app.App的用法示例。


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

示例1: getSceneFileName

# 需要导入模块: from app import App [as 别名]
# 或者: from app.App import drawDelegate [as 别名]

def getSceneFileName():
  if '-i' in sys.argv:
    ind = sys.argv.index('-i')
    return sys.argv[ind+1]
  else:
    print >> sys.stderr, "Scene File Not Found!"
    printHelp()
    sys.exit(1)

window_size = (480, 640)
window_name = 'Xiangqi'
app = App()
board = widget.Board(window_size)
app.drawDelegate = board
app.mouseDelegate = board

def initialization():
  glutInit([])
  glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE)
  glutInitWindowSize(*window_size)
  glutInitWindowPosition(0, 0)
  window = glutCreateWindow(window_name)
  glutDisplayFunc(app.onDraw)
  glutIdleFunc(app.onIdle)
  glutReshapeFunc(app.onResize)
  glutKeyboardFunc(app.onKey)
  glutMouseFunc(app.onMouse)

  glShadeModel(GL_SMOOTH)        # Enables Smooth Color Shading
开发者ID:micmarsh,项目名称:Xiangqi-1,代码行数:32,代码来源:main.py

示例2: getSceneFileName

# 需要导入模块: from app import App [as 别名]
# 或者: from app.App import drawDelegate [as 别名]
def getSceneFileName():
    if '-i' in sys.argv:
        ind = sys.argv.index('-i')
        return sys.argv[ind+1]
    else:
        print >> sys.stderr, "Scene File Not Found!"
        printHelp()
        sys.exit(1)

window_size = (640, 480)
window_name = 'Animation'
app = App()
components = scene.loadSceneComponents(getSceneFileName())
app.scene = scene.Scene(components)
app.drawDelegate = TwoDRenderer(window_size, components)


def initialization():
    glutInit([])
    glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH)
    glutInitWindowSize(*window_size)
    glutInitWindowPosition(0, 0)
    window = glutCreateWindow(window_name)
    glutDisplayFunc(app.onDraw)
    glutIdleFunc(app.onIdle)
    glutReshapeFunc(app.onResize)
    glutKeyboardFunc(app.onKey)

def main():
    initialization()
开发者ID:shaochuan,项目名称:animation,代码行数:32,代码来源:main.py


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