本文整理汇总了Python中program.Program.build方法的典型用法代码示例。如果您正苦于以下问题:Python Program.build方法的具体用法?Python Program.build怎么用?Python Program.build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类program.Program
的用法示例。
在下文中一共展示了Program.build方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_failed_build
# 需要导入模块: from program import Program [as 别名]
# 或者: from program.Program import build [as 别名]
def test_failed_build(self):
vert = VertexShader("A")
frag = FragmentShader("B")
program = Program(verts = vert)
with self.assertRaises(ProgramException):
program.build()
program = Program(frags = frag)
with self.assertRaises(ProgramException):
program.build()
示例2: print
# 需要导入模块: from program import Program [as 别名]
# 或者: from program.Program import build [as 别名]
# print("Setting unknown variable")
# program['position'] = 1,1,1,1
# GL context required
# -------------------
print
print("Active uniforms: %s" % program.active_uniforms)
print("Active attributes: %s" % program.active_attributes)
print("Inactive uniforms: %s" % program.inactive_uniforms)
print("Inactive attributes: %s" % program.inactive_attributes)
print
print("Program name: %d" % program.handle)
print("Program status: %s" % ("dirty (needs new build) " if program.dirty else "clean"))
print
print("Attaching shader")
program.attach(frag)
print("Detaching shader")
program.detach(frag)
print("Program status: %s" % ("dirty (needs new build) " if program.dirty else "clean"))
program.build()
print("Building program")
print("Program status: %s" % ("dirty (needs new build) " if program.dirty else "clean"))
print
# Error reporting
# ---------------
program = Program("void main() { gl_Position = color; }", "void main() { }")
program.build()