本文整理汇总了Python中myrmidon.Game.load_engine_plugins方法的典型用法代码示例。如果您正苦于以下问题:Python Game.load_engine_plugins方法的具体用法?Python Game.load_engine_plugins怎么用?Python Game.load_engine_plugins使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myrmidon.Game
的用法示例。
在下文中一共展示了Game.load_engine_plugins方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from myrmidon import Game [as 别名]
# 或者: from myrmidon.Game import load_engine_plugins [as 别名]
def __init__(self):
Game.load_engine_plugins(self, "gfx")
self.max_textures = glGetInteger(GL_MAX_TEXTURE_IMAGE_UNITS)
#
self.init_shaders()
# Set up screen and reset viewport
glClearColor(*self.clear_colour)
glClear(GL_COLOR_BUFFER_BIT)
glViewport(0, 0, Game.screen_resolution[0], Game.screen_resolution[1])
glMatrixMode(GL_MODELVIEW)
# Blending setup
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_CULL_FACE)
# Get uniform pointer list
self.uniforms = {}
for uni in ["screen_resolution"] + ["textures[%d]" % x for x in range(self.max_textures)]:
self.uniforms[uni] = glGetUniformLocation(self.shader_program, uni)
# Initialise all vertex attributes
self.attributes = {}
for att in ("position","color","texcoord"):
self.attributes[att] = glGetAttribLocation(self.shader_program, att)
# Create global VBO
self.vertex_buffer = VBO(array([]), target=GL_ARRAY_BUFFER, usage=GL_STREAM_DRAW)