Class Sdl


  • public final class Sdl
    extends Object

    Implementation note: Native functions in this class are defined in a private static nested class and public methods from the enclosing class delegate to them.

    This is for a number of reasons:

    • Function signatures are not very Java idiomatic and public methods can do a basic translation (enums, pointers to Strings, etc.)
    • A class with native static functions need to register itself to the JNA in its static initialization block. Execution of the block is triggered the first time any symbol is requested from the class. Including referencing a constant. That wouldn't matter too much if the very first registration also didn't trigger loading of the DLL library to memory - which can fail for various reasons. Therefore, separating the native functions to an internal class allows SDL_Init() to trigger the DLL loading explicitly and report any errors.
    • Method Detail

      • SDL_Init

        public static int SDL_Init​(int flags)
      • SDL_InitSubSystem

        public static int SDL_InitSubSystem​(int flags)
      • SDL_WasInit

        public static int SDL_WasInit​(int flags)
      • SDL_Quit

        public static void SDL_Quit()
      • SDL_QuitSubSystem

        public static void SDL_QuitSubSystem​(int flags)