コード例 #1
0
ファイル: image.py プロジェクト: jdoda/sdl2hl
def init(*flags):
    """Loads dynamic libraries and prepares them for use.

    Args:
        *flags (Set[ImageInitFlag]): The desired image file formats.
    """
    check_int_err(lib.IMG_Init(enumtools.get_mask(flags)))
コード例 #2
0
 def draw_color(self):
     """Tuple[int, int, int, int]: The color used for drawing operations in (red, green, blue, alpha) format."""
     rgba = ffi.new('Uint8[]', 4)
     check_int_err(
         lib.SDL_GetRenderDrawColor(self._ptr, rgba + 0, rgba + 1, rgba + 2,
                                    rgba + 3))
     return (rgba[0], rgba[1], rgba[2], rgba[3])
コード例 #3
0
def init(*flags):
    """Loads dynamic libraries and prepares them for use.

    Args:
        *flags (Set[ImageInitFlag]): The desired image file formats.
    """
    check_int_err(lib.IMG_Init(enumtools.get_mask(flags)))
コード例 #4
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def copy(self, texture, source_rect=None, dest_rect=None, rotation=0, center=None, flip=lib.SDL_FLIP_NONE):
        """Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center.

        Args:
            texture (Texture): The source texture.
            source_rect (Rect): The source rectangle, or None for the entire texture.
            dest_rect (Rect): The destination rectangle, or None for the entire rendering target.
            rotation (float): An angle in degrees that indicates the rotation that will be applied to dest_rect.
            center (Point): The point around which dest_rect will be rotated (if None, rotation will be done around
                            dest_rect.w/2, dest_rect.h/2).
            flip (int): A value stating which flipping actions should be performed on the texture.

        Raises:
            SDLError: If an error is encountered.
        """
        if source_rect == None:
            source_rect_ptr = ffi.NULL
        else:
            source_rect_ptr = source_rect._ptr
            
        if dest_rect == None:
            dest_rect_ptr = ffi.NULL
        else:
            dest_rect_ptr = dest_rect._ptr

        if center == None:
            center_ptr = ffi.NULL
        else:
            center_ptr = center._ptr
            
        check_int_err(lib.SDL_RenderCopyEx(self._ptr, texture._ptr, source_rect_ptr, dest_rect_ptr, rotation, center_ptr, flip))
コード例 #5
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def format(self):
     """PixelFormat: The raw format of the texture. The actual format may differ, but pixel transfers will use this
                     format.
     """
     fmt = ffi.new('Uint32 *')
     check_int_err(lib.SDL_QueryTexture(self._ptr, fmt, ffi.NULL, ffi.NULL, ffi.NULL))
     return PixelFormat(fmt[0])
コード例 #6
0
 def access(self):
     """TextureAccess: The actual access to the texture."""
     access = ffi.new('int *')
     check_int_err(
         lib.SDL_QueryTexture(self._ptr, ffi.NULL, access, ffi.NULL,
                              ffi.NULL))
     return TextureAccess(access[0])
コード例 #7
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def color_mod(self):
     """Tuple[int, int, int]: The additional color value used in render copy operations in (red, green, blue)
                              format.
     """
     rgb = ffi.new('Uint8[]', 3)
     check_int_err(lib.SDL_GetTextureColorMod(self._ptr, rgb + 0, rgb + 1, rgb + 2))
     return (rgb[0], rgb[1], rgb[2])
コード例 #8
0
def save(surface, file):
    """Save a png image of the surface.
    Args:
        surface: The surface to save.
        file: The file path to save to.

    """
    check_int_err(lib.IMG_SavePNG(surface._ptr, file))
コード例 #9
0
 def format(self):
     """PixelFormat: The raw format of the texture. The actual format may differ, but pixel transfers will use this
                     format.
     """
     fmt = ffi.new('Uint32 *')
     check_int_err(
         lib.SDL_QueryTexture(self._ptr, fmt, ffi.NULL, ffi.NULL, ffi.NULL))
     return PixelFormat(fmt[0])
コード例 #10
0
 def color_mod(self):
     """Tuple[int, int, int]: The additional color value used in render copy operations in (red, green, blue)
                              format.
     """
     rgb = ffi.new('Uint8[]', 3)
     check_int_err(
         lib.SDL_GetTextureColorMod(self._ptr, rgb + 0, rgb + 1, rgb + 2))
     return (rgb[0], rgb[1], rgb[2])
コード例 #11
0
ファイル: image.py プロジェクト: jdoda/sdl2hl
def save(surface, file):
    """Save a png image of the surface.
    Args:
        surface: The surface to save.
        file: The file path to save to.

    """
    check_int_err(lib.IMG_SavePNG(surface._ptr, file))
コード例 #12
0
    def clear(self):
        """Clear the current rendering target with the drawing color.

         This function clears the entire rendering target, ignoring the viewport.

         Raises:
            SDLError: If an error is encountered.
         """
        check_int_err(lib.SDL_RenderClear(self._ptr))
コード例 #13
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def clear(self):
        """Clear the current rendering target with the drawing color.

         This function clears the entire rendering target, ignoring the viewport.

         Raises:
            SDLError: If an error is encountered.
         """
        check_int_err(lib.SDL_RenderClear(self._ptr))
コード例 #14
0
ファイル: sdl.py プロジェクト: daniel--/sdl2hl
def init(*flags):
    """This function initializes the subsystems specified by flags.

    Args:
        *flags (InitFlag): Flags specifying which subsystems to initialize.

    Raises:
        SDLError: If there's an error initializing SDL.
    """
    check_int_err(lib.SDL_Init(enumtools.get_mask(flags)))
コード例 #15
0
ファイル: sdl.py プロジェクト: daniel--/sdl2hl
def init(*flags):
    """This function initializes the subsystems specified by flags.

    Args:
        *flags (InitFlag): Flags specifying which subsystems to initialize.

    Raises:
        SDLError: If there's an error initializing SDL.
    """
    check_int_err(lib.SDL_Init(enumtools.get_mask(flags)))
コード例 #16
0
    def draw_rect(self, rect):
        """Draw a rectangle on the current rendering target.

        Args:
            rect (Rect): The destination rectangle, or None to outline the entire rendering target.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderDrawRect(self._ptr, rect._ptr))
コード例 #17
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def fill_rect(self, rect):
        """Fill a rectangle on the current rendering target with the drawing color.

        Args:
            rect (Rect): The destination rectangle, or None to fill the entire rendering target.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderFillRect(self._ptr, rect._ptr))
コード例 #18
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def draw_rect(self, rect):
        """Draw a rectangle on the current rendering target.

        Args:
            rect (Rect): The destination rectangle, or None to outline the entire rendering target.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderDrawRect(self._ptr, rect._ptr))
コード例 #19
0
    def fill_rect(self, rect):
        """Fill a rectangle on the current rendering target with the drawing color.

        Args:
            rect (Rect): The destination rectangle, or None to fill the entire rendering target.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderFillRect(self._ptr, rect._ptr))
コード例 #20
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def draw_point(self, x, y):
        """Draw a point on the current rendering target.

        Args:
            x (int): The x coordinate of the point.
            y (int): The y coordinate of the point.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderDrawPoint(self._ptr, x, y))
コード例 #21
0
    def draw_point(self, x, y):
        """Draw a point on the current rendering target.

        Args:
            x (int): The x coordinate of the point.
            y (int): The y coordinate of the point.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderDrawPoint(self._ptr, x, y))
コード例 #22
0
ファイル: mixer.py プロジェクト: daniel--/sdl2hl
def open_audio(frequency=44100, format=AudioFormat.default, channels=2, chunksize=1024):
    """Open the mixer with a certain audio format.
    
    Args:
        frequency (int): Output sampling frequency in samples per second (Hz).
        format (AudioFormat): Output sample format.
        channels (int): Number of sound channels in output. Set to 2 for stereo, 1 for mono.
        chunksize (int): Bytes used per output sample.
        
    Raises:
        SDLError: If the audio device cannot be opened.
    """
    check_int_err(lib.Mix_OpenAudio(frequency, format, channels, chunksize))
コード例 #23
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def draw_line(self, x1, y1, x2, y2):
        """Draw a line on the current rendering target.

        Args:
            x1 (int): The x coordinate of the start point.
            y1 (int): The y coordinate of the start point.
            x2 (int): The x coordinate of the end point.
            y2 (int): The y coordinate of the end point.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderDrawLine(self._ptr, x1, y1, x2, y2))
コード例 #24
0
ファイル: gfx.py プロジェクト: jdoda/sdl2hl
 def draw_circle(self, x, y, r, color):
     """Draw a circle.
     
     Args:
         x (int): The x coordinate of the center of the circle.
         y (int): The y coordinate of the center of the circle.
         r (int): The radius of the circle.
         color (Tuple[int, int, int, int]): The color of the circle.
         
     Raises:
         SDLError: If an error is encountered.
     """
     check_int_err(lib.circleRGBA(self._ptr, x, y, r, color[0], color[1], color[2], color[3]))
コード例 #25
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def fill_rects(self, *rects):
        """Fill some number of rectangles on the current rendering target with the drawing color.

        Args:
            *rects (Rect): The destination rectangles.

        Raises:
            SDLError: If an error is encountered.
        """
        rect_array = ffi.new('SDL_Rect[]', len(rects))
        for i, r in enumerate(rects):
            rect_array[i] = r._ptr[0]
        check_int_err(lib.SDL_RenderFillRects(self._ptr, rect_array, len(rects)))
コード例 #26
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def draw_lines(self, *points):
        """Draw a series of connected lines on the current rendering target.

        Args:
            *points (Point): The points along the lines.

        Raises:
            SDLError: If an error is encountered.
        """
        point_array = ffi.new('SDL_Point[]', len(points))
        for i, p in enumerate(points):
            point_array[i] = p._ptr[0]
        check_int_err(lib.SDL_RenderDrawLines(self._ptr, point_array, len(points)))
コード例 #27
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
    def draw_points(self, *points):
        """Draw multiple points on the current rendering target.

        Args:
            *points (Point): The points to draw.

        Raises:
            SDLError: If an error is encountered.
        """
        point_array = ffi.new('SDL_Point[]', len(points))
        for i, p in enumerate(points):
            point_array[i] = p._ptr[0]
        check_int_err(lib.SDL_RenderDrawPoints(self._ptr, point_array, len(points)))
コード例 #28
0
    def draw_line(self, x1, y1, x2, y2):
        """Draw a line on the current rendering target.

        Args:
            x1 (int): The x coordinate of the start point.
            y1 (int): The y coordinate of the start point.
            x2 (int): The x coordinate of the end point.
            y2 (int): The y coordinate of the end point.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(lib.SDL_RenderDrawLine(self._ptr, x1, y1, x2, y2))
コード例 #29
0
    def draw_lines(self, *points):
        """Draw a series of connected lines on the current rendering target.

        Args:
            *points (Point): The points along the lines.

        Raises:
            SDLError: If an error is encountered.
        """
        point_array = ffi.new('SDL_Point[]', len(points))
        for i, p in enumerate(points):
            point_array[i] = p._ptr[0]
        check_int_err(
            lib.SDL_RenderDrawLines(self._ptr, point_array, len(points)))
コード例 #30
0
    def fill_rects(self, *rects):
        """Fill some number of rectangles on the current rendering target with the drawing color.

        Args:
            *rects (Rect): The destination rectangles.

        Raises:
            SDLError: If an error is encountered.
        """
        rect_array = ffi.new('SDL_Rect[]', len(rects))
        for i, r in enumerate(rects):
            rect_array[i] = r._ptr[0]
        check_int_err(
            lib.SDL_RenderFillRects(self._ptr, rect_array, len(rects)))
コード例 #31
0
    def draw_points(self, *points):
        """Draw multiple points on the current rendering target.

        Args:
            *points (Point): The points to draw.

        Raises:
            SDLError: If an error is encountered.
        """
        point_array = ffi.new('SDL_Point[]', len(points))
        for i, p in enumerate(points):
            point_array[i] = p._ptr[0]
        check_int_err(
            lib.SDL_RenderDrawPoints(self._ptr, point_array, len(points)))
コード例 #32
0
ファイル: gfx.py プロジェクト: jdoda/sdl2hl
 def draw_arc(self, x, y, r, start, end, color):
     """Draw an arc.
     
     Args:
         x (int): The x coordinate of the center of the arc.
         y (int): The y coordinate of the center of the arc.
         r (int): The radius of the arc.
         start (int): The start of the arc.
         end (int): The end of the arc.
         color (Tuple[int, int, int, int]): The color of the circle.
         
     Raises:
         SDLError: If an error is encountered.
     """
     check_int_err(lib.arcRGBA(self._ptr, x, y, r, start, end, color[0], color[1], color[2], color[3]))
コード例 #33
0
ファイル: gfx.py プロジェクト: jdoda/sdl2hl
    def draw_line(self, x1, y1, x2, y2, color):
        """Draw a line.

        Args:
            x1 (int): The x coordinate of the start of the line.
            y1 (int): The y coordinate of the start of the line.
            x2 (int): The x coordinate of the end of the line.
            y2 (int): The y coordinate of the end of the line.
            color (Tuple[int, int, int, int]): The color of the circle.

        Raises:
            SDLError: If an error is encountered.

        """
        check_int_err(lib.lineRGBA(self._ptr, x1, y1, x2, y2, color[0], color[1], color[2], color[3]))
コード例 #34
0
    def draw_filled_circle(self, x, y, r, color):
        """Draw a filled circle.

        Args:
            x (int): The x coordinate of the center of the circle.
            y (int): The y coordinate of the center of the circle.
            r (int): The radius of the circle.
            color (Tuple[int, int, int, int]): The color of the circle.

        Raises:
            SDLError: If an error is encountered.
        """
        check_int_err(
            lib.filledCircleRGBA(self._ptr, x, y, r, color[0], color[1],
                                 color[2], color[3]))
コード例 #35
0
    def blit(self, src_rect, dst_surf, dst_rect):
        """Performs a fast blit from the source surface to the destination surface.
        This assumes that the source and destination rectangles are
        the same size.  If either src_rect or dst_rect are None, the entire
        surface is copied.  The final blit rectangles are saved
        in src_rect and dst_rect after all clipping is performed.

        Args:
            src_rect (Rect): Source rect.
            dst_surf (Surface): Destination surface.
            dst_rect (Rect): Destination rect.

        Raises:
            SDLError: If the blit fails.
        """
        check_int_err(lib.SDL_UpperBlit(self._ptr, src_rect._ptr, dst_surf._ptr, dst_rect._ptr))
コード例 #36
0
def open_audio(frequency=44100,
               format=AudioFormat.default,
               channels=2,
               chunksize=1024):
    """Open the mixer with a certain audio format.
    
    Args:
        frequency (int): Output sampling frequency in samples per second (Hz).
        format (AudioFormat): Output sample format.
        channels (int): Number of sound channels in output. Set to 2 for stereo, 1 for mono.
        chunksize (int): Bytes used per output sample.
        
    Raises:
        SDLError: If the audio device cannot be opened.
    """
    check_int_err(lib.Mix_OpenAudio(frequency, format, channels, chunksize))
コード例 #37
0
 def draw_arc(self, x, y, r, start, end, color):
     """Draw an arc.
     
     Args:
         x (int): The x coordinate of the center of the arc.
         y (int): The y coordinate of the center of the arc.
         r (int): The radius of the arc.
         start (int): The start of the arc.
         end (int): The end of the arc.
         color (Tuple[int, int, int, int]): The color of the circle.
         
     Raises:
         SDLError: If an error is encountered.
     """
     check_int_err(
         lib.arcRGBA(self._ptr, x, y, r, start, end, color[0], color[1],
                     color[2], color[3]))
コード例 #38
0
    def draw_line(self, x1, y1, x2, y2, color):
        """Draw a line.

        Args:
            x1 (int): The x coordinate of the start of the line.
            y1 (int): The y coordinate of the start of the line.
            x2 (int): The x coordinate of the end of the line.
            y2 (int): The y coordinate of the end of the line.
            color (Tuple[int, int, int, int]): The color of the circle.

        Raises:
            SDLError: If an error is encountered.

        """
        check_int_err(
            lib.lineRGBA(self._ptr, x1, y1, x2, y2, color[0], color[1],
                         color[2], color[3]))
コード例 #39
0
    def draw_filled_trigon(self, x1, y1, x2, y2, x3, y3, color):
        """Draw a filled trigon

        Args:
            x1 (int): The x cooridinate of the first corner of the trigon
            y1 (int): The y cooridinate of the first corner of the trigon
            x2 (int): The x cooridinate of the second corner of the trigon
            y2 (int): The y cooridinate of the second corner of the trigon
            x3 (int): The x cooridinate of the third corner of the trigon
            y3 (int): The y cooridinate of the third corner of the trigon
            color (Tuple[int, int, int, int]): The color of the trigon.

        Raises:
            SDLError: If an error is encountered.
            """
        check_int_err(
            lib.filledTrigonRGBA(self._ptr, x1, y1, x2, y2, x3, y3, color[0],
                                 color[1], color[2], color[3]))
コード例 #40
0
ファイル: events.py プロジェクト: daniel--/sdl2hl
def _peep(quantity, action, min_type, max_type):
    events = ffi.new('SDL_Event[]', quantity)
    quantity_retrieved = check_int_err(lib.SDL_PeepEvents(events, quantity, action, min_type, max_type))

    result = []
    for i in range(quantity_retrieved):
        event_ptr = events + i
        _event_reference_map[event_ptr] = events
        result.append(Event._from_ptr(event_ptr))
    return result
コード例 #41
0
def _peep(quantity, action, min_type, max_type):
    events = ffi.new('SDL_Event[]', quantity)
    quantity_retrieved = check_int_err(
        lib.SDL_PeepEvents(events, quantity, action, min_type, max_type))

    result = []
    for i in range(quantity_retrieved):
        event_ptr = events + i
        _event_reference_map[event_ptr] = events
        result.append(Event._from_ptr(event_ptr))
    return result
コード例 #42
0
    def copy(self,
             texture,
             source_rect=None,
             dest_rect=None,
             rotation=0,
             center=None,
             flip=lib.SDL_FLIP_NONE):
        """Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center.

        Args:
            texture (Texture): The source texture.
            source_rect (Rect): The source rectangle, or None for the entire texture.
            dest_rect (Rect): The destination rectangle, or None for the entire rendering target.
            rotation (float): An angle in degrees that indicates the rotation that will be applied to dest_rect.
            center (Point): The point around which dest_rect will be rotated (if None, rotation will be done around
                            dest_rect.w/2, dest_rect.h/2).
            flip (int): A value stating which flipping actions should be performed on the texture.

        Raises:
            SDLError: If an error is encountered.
        """
        if source_rect == None:
            source_rect_ptr = ffi.NULL
        else:
            source_rect_ptr = source_rect._ptr

        if dest_rect == None:
            dest_rect_ptr = ffi.NULL
        else:
            dest_rect_ptr = dest_rect._ptr

        if center == None:
            center_ptr = ffi.NULL
        else:
            center_ptr = center._ptr

        check_int_err(
            lib.SDL_RenderCopyEx(self._ptr, texture._ptr, source_rect_ptr,
                                 dest_rect_ptr, rotation, center_ptr, flip))
コード例 #43
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def h(self):
     """int: The height of the texture in pixels."""
     h = ffi.new('int *')
     check_int_err(lib.SDL_QueryTexture(self._ptr, ffi.NULL, ffi.NULL, ffi.NULL, h))
     return h[0]
コード例 #44
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def color_mod(self, rgb):
     r, g, b = rgb
     check_int_err(lib.SDL_SetTextureColorMod(self._ptr, r, g, b))
コード例 #45
0
 def _get_renderer_info(self):
     info = ffi.new('SDL_RendererInfo *')
     check_int_err(lib.SDL_GetRendererInfo(self._ptr, info))
     return info
コード例 #46
0
 def blend_mode(self, blend_mode):
     check_int_err(lib.SDL_SetTextureBlendMode(self._ptr, blend_mode))
コード例 #47
0
 def alpha_mod(self, a):
     check_int_err(lib.SDL_SetTextureAlphaMod(self._ptr, a))
コード例 #48
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def draw_color(self):
     """Tuple[int, int, int, int]: The color used for drawing operations in (red, green, blue, alpha) format."""
     rgba = ffi.new('Uint8[]', 4)
     check_int_err(lib.SDL_GetRenderDrawColor(self._ptr, rgba + 0, rgba + 1, rgba + 2, rgba + 3))
     return (rgba[0], rgba[1], rgba[2], rgba[3])
コード例 #49
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def alpha_mod(self):
     """int: The additional alpha value used in render copy operations."""
     a = ffi.new('Uint8 *')
     check_int_err(lib.SDL_GetTextureAlphaMod(self._ptr, a))
     return a[0]
コード例 #50
0
 def h(self):
     """int: The height of the texture in pixels."""
     h = ffi.new('int *')
     check_int_err(
         lib.SDL_QueryTexture(self._ptr, ffi.NULL, ffi.NULL, ffi.NULL, h))
     return h[0]
コード例 #51
0
 def w(self):
     """int: The width of the texture in pixels."""
     w = ffi.new('int *')
     check_int_err(
         lib.SDL_QueryTexture(self._ptr, ffi.NULL, ffi.NULL, w, ffi.NULL))
     return w[0]
コード例 #52
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def alpha_mod(self, a):
     check_int_err(lib.SDL_SetTextureAlphaMod(self._ptr, a))
コード例 #53
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def blend_mode(self, blend_mode):
     check_int_err(lib.SDL_SetTextureBlendMode(self._ptr, blend_mode))
コード例 #54
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def _get_renderer_info(self):
     info = ffi.new('SDL_RendererInfo *')
     check_int_err(lib.SDL_GetRendererInfo(self._ptr, info))
     return info
コード例 #55
0
ファイル: renderer.py プロジェクト: daniel--/sdl2hl
 def w(self):
     """int: The width of the texture in pixels."""
     w = ffi.new('int *')
     check_int_err(lib.SDL_QueryTexture(self._ptr, ffi.NULL, ffi.NULL, w, ffi.NULL))
     return w[0]
コード例 #56
0
 def color_mod(self, rgb):
     r, g, b = rgb
     check_int_err(lib.SDL_SetTextureColorMod(self._ptr, r, g, b))
コード例 #57
0
 def alpha_mod(self):
     """int: The additional alpha value used in render copy operations."""
     a = ffi.new('Uint8 *')
     check_int_err(lib.SDL_GetTextureAlphaMod(self._ptr, a))
     return a[0]
コード例 #58
0
ファイル: video.py プロジェクト: daniel--/sdl2hl
 def set_fullscreen(self, flag):
     check_int_err(lib.SDL_SetWindowFullscreen(self._ptr, flag))
コード例 #59
0
ファイル: video.py プロジェクト: daniel--/sdl2hl
    def get_desktop_size(self):
        """Get the size of the desktop display"""

        _ptr = ffi.new('SDL_DisplayMode *')
        check_int_err(lib.SDL_GetDesktopDisplayMode(self._index, _ptr))
        return (_ptr.w, _ptr.h)