def draw_raw_aabb_solid(self, aabb, color):
     Y = self.height
     R, G, B, A = color
     if gfx.boxRGBA(self._renderer, trunc(aabb.xmin), trunc(Y - aabb.ymax),
                    trunc(aabb.xmax), trunc(Y - aabb.ymin), R, G, B,
                    A) != 0:
         self._sdl_error()
示例#2
0
 def draw_raw_aabb_solid(self, aabb, color):
     Y = self.height
     R, G, B, A = color
     if gfx.boxRGBA(
             self._renderer,
             trunc(aabb.xmin),
             trunc(Y - aabb.ymax),
             trunc(aabb.xmax),
             trunc(Y - aabb.ymin),
             R, G, B, A) != 0:
         self._sdl_error()
示例#3
0
    def clear_background(self, color=None):
        renderer = self._renderer
        sdl.SDL_RenderClear(renderer)

        ret = 0
        if color is None and self._bg_color is not None:
            ret = gfx.boxColor(
                renderer, 0, self.height, self.width, 0, self._bg_color)
        else:
            R, G, B, A = Color(color)
            ret = gfx.boxRGBA(
                renderer, 0, self.height, self.width, 0, R, G, B, A)

        if ret != 0:
            msg = sdl.SDL_GetError()
            raise RuntimeError('SDL error: %s' % msg)
    def clear_background(self, color=None):
        renderer = self._renderer
        sdl.SDL_RenderClear(renderer)

        ret = 0
        if color is None and self._bg_color is not None:
            ret = gfx.boxColor(renderer, 0, self.height, self.width, 0,
                               self._bg_color)
        else:
            R, G, B, A = Color(color)
            ret = gfx.boxRGBA(renderer, 0, self.height, self.width, 0, R, G, B,
                              A)

        if ret != 0:
            msg = sdl.SDL_GetError()
            raise RuntimeError('SDL error: %s' % msg)