Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.libsdl
Class SDL  view SDL download SDL.java

java.lang.Object
  extended byorg.libsdl.SDL

public class SDL
extends java.lang.Object

The SDL class is a singleton that controls some of the more global SDL functions, such as library initialization and access to the Video object and window manager.

When this class is loaded, the SDL_java JNI library is loaded. This should always be the first object created when using the SDL_java package.

------ EXAMPLE ------

     SDL sdl = SDL.getInstance();
     sdl.init(SDL.SDL_INIT_VIDEO);
 

Version:
$revision$

Field Summary
private  org.libsdl.event.SDLEventManager em
           
static SDL instance
          The only reference to an object of this class (the Singleton reference)
static int SDL_INIT_AUDIO
           
static int SDL_INIT_CDROM
           
static int SDL_INIT_EVENTTHREAD
           
static int SDL_INIT_EVERYTHING
           
static int SDL_INIT_JOYSTICK
           
static int SDL_INIT_TIMER
           
static int SDL_INIT_VIDEO
           
private  org.libsdl.video.SDLVideo video
           
private  SDLWindowManager wm
           
 
Constructor Summary
private SDL()
           
 
Method Summary
 java.lang.String getError()
          Return the last SDL error string.
 org.libsdl.event.SDLEventManager getEventManager()
          Returns the SDLEventManager object.
static SDL getInstance()
          Returns the SDL singleton reference.
 org.libsdl.video.SDLVideo getVideo()
          Returns the SDLVideo object.
 SDLWindowManager getWindowManager()
          Returns the SDLWindowManager object.
 boolean init(int flags)
          Initialize the SDL library.
 boolean initSubSystem(int flags)
          Initialize specific subsystems.
 boolean initThreading()
          Initialize threading.
 void quit()
          Exit from SDL and clean up.
 void quitSubSystem(int flags)
          Exit from specific subsystems.
 boolean supportsSDLimage()
          Test whether SDL_image library is supported.
 boolean supportsSDLttf()
          Test whether SDL_image library is supported.
 int wasInit(int flags)
          Test whether specific subsystems were initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

public static SDL instance
The only reference to an object of this class (the Singleton reference)


SDL_INIT_TIMER

public static final int SDL_INIT_TIMER
See Also:
Constant Field Values

SDL_INIT_AUDIO

public static final int SDL_INIT_AUDIO
See Also:
Constant Field Values

SDL_INIT_VIDEO

public static final int SDL_INIT_VIDEO
See Also:
Constant Field Values

SDL_INIT_CDROM

public static final int SDL_INIT_CDROM
See Also:
Constant Field Values

SDL_INIT_JOYSTICK

public static final int SDL_INIT_JOYSTICK
See Also:
Constant Field Values

SDL_INIT_EVENTTHREAD

public static final int SDL_INIT_EVENTTHREAD
See Also:
Constant Field Values

SDL_INIT_EVERYTHING

public static final int SDL_INIT_EVERYTHING
See Also:
Constant Field Values

video

private org.libsdl.video.SDLVideo video

em

private org.libsdl.event.SDLEventManager em

wm

private SDLWindowManager wm
Constructor Detail

SDL

private SDL()
Method Detail

getInstance

public static SDL getInstance()
Returns the SDL singleton reference.


init

public boolean init(int flags)
Initialize the SDL library.

Corresponds:

SDL_Init()


initSubSystem

public boolean initSubSystem(int flags)
Initialize specific subsystems.

Corresponds:

SDL_InitSubSystem()


initThreading

public boolean initThreading()
Initialize threading. This is necessary if the program is using multiple threads to access the various SDL_java objects and methods AND the program is running under X Windows. Some X versions require XInitThreads to be called when using threads.


quit

public void quit()
Exit from SDL and clean up.

Corresponds:

SDL_Quit()


quitSubSystem

public void quitSubSystem(int flags)
Exit from specific subsystems.

Corresponds:

SDL_QuitSubSystem()


getError

public java.lang.String getError()
Return the last SDL error string.

Corresponds:

SDL_GetError()


wasInit

public int wasInit(int flags)
Test whether specific subsystems were initialized.

Corresponds:

SDL_WasInit()


supportsSDLimage

public boolean supportsSDLimage()
Test whether SDL_image library is supported. If the SDL_image library was installed when SDL_java was compiled, this will return true


supportsSDLttf

public boolean supportsSDLttf()
Test whether SDL_image library is supported. If the SDL_ttf library was installed when SDL_java was compiled, this will return true


getVideo

public org.libsdl.video.SDLVideo getVideo()
Returns the SDLVideo object. This object provides access to many of the Video related functions of SDL.


getEventManager

public org.libsdl.event.SDLEventManager getEventManager()
Returns the SDLEventManager object. This object provides access to all of the Event related functions of SDL.


getWindowManager

public SDLWindowManager getWindowManager()
Returns the SDLWindowManager object. This object provides access to all of the window management related functions of SDL.