Source

pygame / doc / src / sdlbase.xml

Full commit
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE module SYSTEM "api.dtd">

<module name="pygame2.sdl.base">
  <show>0</show>
  <alias>pygame2.sdl.base</alias>
  <short>basic SDL wrapper module</short>
  <desc>
    Basic Pygame2 SDL wrapper functions.
  </desc>

  <func name="get_compiled_version">
    <call>get_compiled_version () -> tuple</call>
    <desc>
      Gets the SDL version pygame2 was compiled against as three-value tuple.

      This version is built at compile time. It can be used to detect
      which features may not be available through Pygame, if it is used
      as precompiled package using a different version of the SDL
      library.
    </desc>
  </func>
  <func name="get_error">
    <call>get_error () -> pygame2.Error</call>
    <desc>
      Gets the last :exc:`pygame2.Error` occured.

      SDL maintains an internal error message. This message will usually
      be given to you when a :exc:`pygame2.Error` is raised.

      You will rarely need to call this function.
    </desc>
  </func>
  <func name="get_version">
    <call>get_version () -> tuple</call>
    <desc>
      Gets the SDL version pygame2 currently uses as three-value tuple.

      This version is detected at runtime. It can be used to detect
      which features may not be available through Pygame, if it is used
      as precompiled package using a different version of the SDL library.
    </desc>
  </func>
  <func name="init">
    <call>init (flags) -> bool</call>
    <desc>
      Initializes the underlying SDL library.

      Initializes the underlying SDL library using the passed SDL
      flags. The flags indicate, which subsystems of SDL should be
      initialized and can be a bitwise combination of the INIT_*
      constants.

      In case an error occured, False will be returned. The detailled
      error can be received using pygame2.sdl.get_error().
    </desc>
  </func>
  <func name="init_subsystem">
    <call>init_subsystem (flags) -> bool</call>
    <desc>
      Initializes one or more SDL subsystems.

      In case a specific part of SDL was not initialized using
      :func:`pygame2.sdl.init`, this funciton can be used to initialize it at
      a later time.

      In contrast to the original SDL library, you do not need to call
      :func:`pygame2.sdl.init` beforehand to initialize anything. In
      case it was not done before, :func:`pygame2.sdl.init` will be
      called implicitly with the passed *flags*.

      In case an error occured, False will be returned. The detailled
      error can be received using pygame2.sdl.get_error().
    </desc>
  </func>
  <func name="quit">
    <call>quit () -> None</call>
    <desc>
      Shuts down all subsystems of the underlying SDL library.

      After calling this function, you should not invoke any SDL related
      class, method or function as they are likely to fail or might give
      unpredictable results.
    </desc>
  </func>
  <func name="quit_subsystem">
    <call>quit_subsystem (flags) -> None</call>
    <desc>
      Shuts down one or more subsystems of the underlying SDL library.

      After calling this function, you should not invoke any class,
      method or function related to the specified subsystems as they are
      likely to fail or might give unpredictable results.
      
      .. note::
      
        *Never* call :meth:`quit_subsystem()`, if you did not initialise the
        specified subsystem with :meth:`init_subsystem()`. The specialised
        sdl modules (such as e.g. :mod:`pygame2.sdl.video`) register own
        quit hooks to be called on quittintg the module. Using
        :meth:`quit_subsystem()` however will prevent this and can lead to
        errors.
    </desc>
  </func>
  <func name="was_init">
    <call>was_init ([flags]) -> long</call>
    <desc>
      Gets a bitwise OR'ed combination of the initialized SDL subsystems.

      Returns a bitwise combination of the currently initialized SDL
      subsystems. If *flags* is passed, only the listed subsystems in
      *flags* will be passed and the initialized ones of those returned.
    </desc>
  </func>
</module>