コード例 #1
5
 def bottom(self) -> float:
     return rectangle.bottom(self._m)
コード例 #2
0
ファイル: viewport.py プロジェクト: adamlwgriffiths/PyGLy
def set_scissor( rect ):
    """Calls glScissor with the size of the rectangle.

    .. note:: It is up to the user to call glEnable(GL_SCISSOR_TEST).

    .. note:: To undo this, call this function again with the window's size as a rectangle.

    .. seealso::
        Module :py:mod:`pygly.window`
          Documentation of the :py:mod:`pygly.window` module.

    This call can be undone by first calling
    glPushAttrib( GL_SCISSOR_BIT )
    and later calling glPopAttrib().

    Or using the attribute context:
    with attributes( GL_SCISSOR_BIT ):
        set_scissor( rect )
    """
    GL.glScissor(
        int(rectangle.left(rect)),
        int(rectangle.bottom(rect)),
        int(rectangle.abs_width(rect)),
        int(rectangle.abs_height(rect))
        )
コード例 #3
0
ファイル: viewport.py プロジェクト: trb116/pythonanalyzer
def set_viewport(rect):
    """Calls glViewport with the dimensions of
    the rectangle

    In the OpenGL Legacy profile (<=2.1),
    this call can be undone by first calling
    glPushAttrib( GL_VIEWPORT_BIT )
    and later calling glPopAttrib().
    Or: using the attribute context:
    with attributes( GL_VIEWPORT_BIT ):
        set_viewport( rect )

    The glPushAttrib / glPopAttrib functions are not available on the
    OpenGL Core profile (>=3.0)
    """
    GL.glViewport(int(rectangle.left(rect)), int(rectangle.bottom(rect)),
                  int(rectangle.abs_width(rect)),
                  int(rectangle.abs_height(rect)))
コード例 #4
0
ファイル: viewport.py プロジェクト: adamlwgriffiths/PyGLy
def set_viewport( rect ):
    """Calls glViewport with the dimensions of
    the rectangle

    In the OpenGL Legacy profile (<=2.1),
    this call can be undone by first calling
    glPushAttrib( GL_VIEWPORT_BIT )
    and later calling glPopAttrib().
    Or: using the attribute context:
    with attributes( GL_VIEWPORT_BIT ):
        set_viewport( rect )

    The glPushAttrib / glPopAttrib functions are not available on the
    OpenGL Core profile (>=3.0)
    """
    GL.glViewport(
        int(rectangle.left(rect)),
        int(rectangle.bottom(rect)),
        int(rectangle.abs_width(rect)),
        int(rectangle.abs_height(rect))
        )
コード例 #5
0
ファイル: viewport.py プロジェクト: trb116/pythonanalyzer
def set_scissor(rect):
    """Calls glScissor with the size of the rectangle.

    .. note:: It is up to the user to call glEnable(GL_SCISSOR_TEST).

    .. note:: To undo this, call this function again with the window's size as a rectangle.

    .. seealso::
        Module :py:mod:`pygly.window`
          Documentation of the :py:mod:`pygly.window` module.

    This call can be undone by first calling
    glPushAttrib( GL_SCISSOR_BIT )
    and later calling glPopAttrib().

    Or using the attribute context:
    with attributes( GL_SCISSOR_BIT ):
        set_scissor( rect )
    """
    GL.glScissor(int(rectangle.left(rect)), int(rectangle.bottom(rect)),
                 int(rectangle.abs_width(rect)),
                 int(rectangle.abs_height(rect)))
コード例 #6
0
ファイル: viewport.py プロジェクト: trb116/pythonanalyzer
 def bottom(self):
     """The bottom most point of the viewport in pixels.
     """
     return rectangle.bottom(self.rect)
コード例 #7
0
ファイル: viewport.py プロジェクト: adamlwgriffiths/PyGLy
 def bottom( self ):
     """The bottom most point of the viewport in pixels.
     """
     return rectangle.bottom( self.rect )
コード例 #8
0
ファイル: test_rectangle.py プロジェクト: rjsadaye/cse574
 def test_bottom_negative(self):
     result = rectangle.bottom([[1.,2.],[-3.,-4.]])
     np.testing.assert_almost_equal(result, -2., decimal=5)
コード例 #9
0
ファイル: test_rectangle.py プロジェクト: rjsadaye/cse574
 def test_bottom(self):
     result = rectangle.bottom([[1.,2.],[3.,4.]])
     np.testing.assert_almost_equal(result, 2., decimal=5)
コード例 #10
0
ファイル: test_rectangle.py プロジェクト: RazerM/Pyrr
 def test_bottom_negative(self):
     result = rectangle.bottom([[1.,2.],[-3.,-4.]])
     np.testing.assert_almost_equal(result, -2., decimal=5)
コード例 #11
0
ファイル: test_rectangle.py プロジェクト: RazerM/Pyrr
 def test_bottom(self):
     result = rectangle.bottom([[1.,2.],[3.,4.]])
     np.testing.assert_almost_equal(result, 2., decimal=5)