Python pyglet.gl.glClear() Examples

The following are 7 code examples of pyglet.gl.glClear(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pyglet.gl , or try the search function .
Example #1
Source File: gl.py    From ratcave with MIT License 5 votes vote down vote up
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) 
Example #2
Source File: integrations_cocos2d.py    From pyimgui with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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()) 
Example #3
Source File: __init__.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #4
Source File: __init__.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #5
Source File: __init__.py    From flappy-bird-py with GNU General Public License v2.0 5 votes vote down vote up
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) 
Example #6
Source File: test_window_events.py    From pyglet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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() 
Example #7
Source File: __init__.py    From pyglet with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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)