本文整理匯總了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)