本文整理汇总了Python中pyglet.gl.glClear方法的典型用法代码示例。如果您正苦于以下问题:Python gl.glClear方法的具体用法?Python gl.glClear怎么用?Python gl.glClear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyglet.gl
的用法示例。
在下文中一共展示了gl.glClear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clear_color
# 需要导入模块: from pyglet import gl [as 别名]
# 或者: from pyglet.gl import glClear [as 别名]
def clear_color(r, g, b):
pyglet_gl.glClearColor(r, g, b, 1.)
pyglet_gl.glClear(pyglet_gl.GL_COLOR_BUFFER_BIT | pyglet_gl.GL_DEPTH_BUFFER_BIT)
示例2: draw
# 需要导入模块: from pyglet import gl [as 别名]
# 或者: from pyglet.gl import glClear [as 别名]
def draw(self, *args, **kwargs):
imgui.new_frame()
if imgui.begin_main_menu_bar():
if imgui.begin_menu("File", True):
clicked_quit, selected_quit = imgui.menu_item(
"Quit", 'Cmd+Q', False, True
)
if clicked_quit:
exit(1)
imgui.end_menu()
imgui.end_main_menu_bar()
imgui.show_test_window()
imgui.begin("Custom window", True)
imgui.text("Bar")
imgui.text_colored("Eggs", 0.2, 1., 0.)
imgui.end()
gl.glClearColor(1., 1., 1., 1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
imgui.render()
self.renderer.render(imgui.get_draw_data())
示例3: clear
# 需要导入模块: from pyglet import gl [as 别名]
# 或者: from pyglet.gl import glClear [as 别名]
def clear(self):
'''Clear the window.
This is a convenience method for clearing the color and depth
buffer. The window must be the active context (see `switch_to`).
'''
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
示例4: _draw
# 需要导入模块: from pyglet import gl [as 别名]
# 或者: from pyglet.gl import glClear [as 别名]
def _draw(self):
gl.glClearColor(0.5, 0, 0, 1)
gl.glClear(gl.GL_COLOR_BUFFER_BIT)
gl.glLoadIdentity()
self.label.draw()
self.window.flip()
示例5: clear
# 需要导入模块: from pyglet import gl [as 别名]
# 或者: from pyglet.gl import glClear [as 别名]
def clear():
"""Clear the window.
This is a convenience method for clearing the color and depth
buffer. The window must be the active context (see `switch_to`).
"""
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)