File: sdl2ext_common.rst

package info (click to toggle)
pysdl2 0.9.7%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,824 kB
  • sloc: python: 17,244; makefile: 195; sh: 32
file content (43 lines) | stat: -rw-r--r-- 1,285 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
.. currentmodule:: sdl2.ext

Initialization routines
=======================

:func:`init()` simply calls :func:`SDL_Init()` to initialize only the video
subsystem. If the call fails, :exc:`SDLError` is raised. See
:ref:`pygamers_pygame` for a comparison between this function and
:func:`pygame.init()`.


API
---

.. exception:: SDLError(msg=None)

   An SDL2 specific :class:`Exception` class. if no *msg* is provided,
   the message will be set to the value of :func:`sdl2.error.SDL_GetError()`

.. function:: init() -> None

   Initialises the underlying SDL2 video subsystem. Raises a
   :exc:`SDLError`, if the SDL2 video subsystem could not be
   initialised.

.. function:: quit() -> None

   Quits the underlying SDL2 video subysystem. If no other SDL2
   subsystems are active, this will also call :func:`quit()`,
   :func:`sdl2.sdlttf.TTF_Quit()` and :func:`sdl2.sdlimage.IMG_Quit()`.

.. function:: get_events() -> [SDL_Event, SDL_Event, ...]

   Gets all SDL events that are currently on the event queue.

.. class:: TestEventProcessor()

   A simple event processor for testing purposes.

   .. method:: run(window : Window) -> None

      Starts an event loop without actually processing any event. The method
      will run endlessly until a ``SDL_QUIT`` event occurs.