Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(34)  |  Call(31)  |  Derive(0)  |  Import(3)

src/p/y/PySDL2-0.9.2/sdl2/ext/image.py   PySDL2(Download)
"""Image loaders."""
from .common import SDLError
from .compat import UnsupportedError, byteify
from .. import endian, surface, pixels
 
            # An error occured - if we do not try PIL, break out now
            if not _HASPIL or enforce == "SDL":
                raise SDLError(sdlimage.IMG_GetError())
        else:
            imgsurface = imgsurface.contents
                                                      gmask, bmask, amask)
        if not imgsurface:
            raise SDLError()
        imgsurface = imgsurface.contents
 
            sdlpalette = pixels.SDL_AllocPalette(len(rgbcolors) // 3)
            if not sdlpalette:
                raise SDLError()
            sdlpalette = sdlpalette.contents
            SDL_Color = pixels.SDL_Color
            pixels.SDL_FreePalette(sdlpalette)
            if ret != 0:
                raise SDLError()
 
    return imgsurface

src/p/y/PySDL2-0.9.2/sdl2/ext/sprite.py   PySDL2(Download)
"""Sprite, texture and pixel surface routines."""
import abc
from ctypes import byref, cast, POINTER, c_int
from .common import SDLError
from .compat import *
                                            byref(b), byref(a))
        if ret == -1:
            raise SDLError()
        return convert_to_color((r.value, g.value, b.value, a.value))
 
        ret = render.SDL_SetRenderDrawColor(self.renderer, c.r, c.g, c.b, c.a)
        if ret == -1:
            raise SDLError()
 
    @property
        ret = render.SDL_GetRenderDrawBlendMode(self.renderer, byref(mode))
        if ret == -1:
            raise SDLError()
        return mode
 
    def blendmode(self, value):
        """The blend mode used for drawing operations (fill and line)."""
        ret = render.SDL_SetRenderDrawBlendMode(self.renderer, value)
        if ret == -1:
            raise SDLError()

src/p/y/PySDL2-0.9.2/sdl2/ext/window.py   PySDL2(Download)
"""Window routines to manage on-screen windows."""
from ctypes import c_int, byref
from .compat import byteify, stringify
from .common import SDLError
from .. import video
                                        size[0], size[1], flags)
        if not window:
            raise SDLError()
        self.window = window.contents
        self._renderer = None  # used by get_renderer()
        sf = video.SDL_GetWindowSurface(self.window)
        if not sf:
            raise SDLError()
        return sf.contents