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

Quick Search    Search Deep

org.libsdl.event.* (19)org.libsdl.font.* (1)org.libsdl.font.ttf.* (1)org.libsdl.test.* (12)
org.libsdl.video.* (10)

org.libsdl: Javadoc index of package org.libsdl.


Package Samples:

org.libsdl.event
org.libsdl.font.ttf
org.libsdl.test
org.libsdl.video

Classes:

SDLPixelFormat: The SDLPixelFormat class represents an SDL_PixelFormat C struct. The class extends SDLStruct and thus represents a native C structure. The SDLPixelFormat class typically represents the properties of an SDLSurface , such as bit depth, palette, masks, and shifts (to name a few). A SDLPixelFormat cannot be instantiated directly. It must be created by the surface that it represents. ------ EXAMPLE ------ SDL sdl = SDL.getInstance(); SDLVideo video = sdl.getVideo(); SDLVideoInfo vidinfo = video.getVideoInfo(); SDLPixelFormat format = vidinfo.getPixelFormat(); short bpp = format.bitsPerPixel(); // etc... ...
SDLSurface: The SDLSurface class represents an SDL_Surface C struct. The class extends SDLStruct and thus represents a native C structure. A surface can be created in many ways in SDL. For example, rendering TrueType fonts will create a surface. Loading an image from a file with create a surface. Surfaces can be modified directly by manipulating the pixel data. In addition they can be modified by blitting other surfaces onto them. ------ EXAMPLE ------ TTFFont font = ... // create a font SDLColor color = ... // create a color SDLSurface fontSurface = font.renderTextBlended("Hello World", color); ------ EXAMPLE ...
SDLScreen: The SDLScreen class extends SDLSurface which extends SDLStruct and thus it represents a native C structure. In particular, the SDLScreen class represents the visible SDL surface. A SDLScreen cannot be instantiated directly. It is created and returned by the SDLVideo object. ------ EXAMPLE ------ SDL sdl = SDL.getInstance(); SDLVideo video = sdl.getVideo(); // Create a screen that is 640x480 at 32 bpp fullscreen SDLScreen screen = video.setVideoMode(640, 480, 32, SDLVideo.SDL_FULLSCREEN); ... // do some drawing and stuff screen.flip(); // would probably be in a loop normally
SDLEventManager: The SDLEventManager class encompasses the ability to receive events, either by polling or waiting. Most of the event related SDL functions can be found here, such as SDL_WaitEvent, SDL_PumpEvents, and SDL_PollEvent (to name a few). ------ EXAMPLE ------ SDL sdl = SDL.getInstance(); sdl.init(SDL.SDL_INIT_EVERYTHING); SDLEventManager eventManager = sdl.getEventManager(); SDLEvent event = null; while ( (event = eventManager.waitEvent()) != null ) { if (event instanceOf SDLMouseButtonEvent) { // do something } else if (event instanceOf SDLKeyboardEvent) { // do something else } // etc... }
SDLRGBA: The SDLColor class represents an RGB color. The class encompasses a color that has red, green, and blue short components to it. ------ EXAMPLE ------ // Creates SDLRGBA objects with 50% transparency SDLRGBA red = new SDLRGBA(255, 0, 0, 128); SDLRGBA green = new SDLRGBA(0, 255, 0, 128); SDLRGBA blue = new SDLRGBA(0, 0, 255, 128); ------ EXAMPLE ------ int pixel = ... // get a 32 bit integer pixel value SDLPixelFormat format = ... // get pixel format (from SDLSurface maybe) SDLRGBA rgba = format.getRGBA(pixel);
TTFFont: The TTFFont class represents a loaded TrueType font. This class requires the SDL_ttf library to be loaded. If the SDL_ttf library is not loaded, an exception of type SDLLibraryNotAvailableException is thrown when attempting to instantiate the object. ------ EXAMPLE ------ String fontPath = ... int fontPtSize = ... SDL sdl = SDL.getInstance(); sdl.init(SDL.SDL_INIT_VIDEO); try { TTFFont font = new TTFFont(fontPath, fontPtSize); font.getHeight(); // etc... } catch (SDLLibraryNotAvailableException libe) { ... }
SDLRGB: The SDLColor class represents an RGB color. The class encompasses a color that has red, green, and blue short components to it. ------ EXAMPLE ------ SDLRGB red = new SDLRGB(255, 0, 0); SDLRGB green = new SDLRGB(0, 255, 0); SDLRGB blue = new SDLRGB(0, 0, 255); ------ EXAMPLE ------ int pixel = ... // get a 32 bit integer pixel value SDLPixelFormat format = ... // get pixel format (from SDLSurface maybe) SDLRGB rgb = format.getRGB(pixel);
SDLVideo: The SDLVideo class is simply a convenient class that bundles together the various video related SDL functions. It contains those functions that aren't directly associated with a specific SDL object. The only way to obtain a SDLVideo object is to ask the SDL singleton for it. ------ EXAMPLE ------ SDL sdl = SDL.getInstance(); sdl.init(SDL.SDL_INIT_VIDEO); SDLVideo video = sdl.getVideo(); ... // do whatever you want with the video object
SDLWindowManager: The SDLWindowManager class encompasses the ability to access the various SDL window management functions. ------ EXAMPLE ------ SDL sdl = SDL.getInstance(); sdl.init(SDL.SDL_INIT_VIDEO); SDLVideo video = sdl.getVideo(); SDLVideoInfo vidinfo = video.getVideoInfo(); if (vidinfo.windowManagerAvailable()) { SDLWindowManager wm = sdl.getWindowManager(); wm.setCaption("SDL_java Test", null); }
SDL: 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);
SDLColor: The SDLColor class represents an RGB color. The class encompasses a color that has red, green, and blue short components to it. ------ EXAMPLE ------ SDLColor red = new SDLColor(255, 0, 0); SDLColor green = new SDLColor(0, 255, 0); SDLColor blue = new SDLColor(0, 0, 255);
SDLLibraryNotAvailableException: The SDLLibraryNotAvailableException is an exception type that is thrown when an object is trying to be created, but the functionality to create that object is not available. For example, if a TTFFont object is instantiated, this exception is thrown when the SDL_ttf library is not installed.
SDLEvent: The SDLEvent represents a single SDL event. All specific event classes extend this class. There are two ways to determine what kind of event this is. The first is to use introspection (instanceof) to determine the type of the object. The second is to use the getType() method below.
SDLStruct: The SDLStruct class is the base class for any SDL_java class that represents a native C "object" (aka struct). Most (but not all) SDL C structures have a corresponding SDL_java class. These classes all extend the SDLStruct class.
SDLVideoInfo: The SDLVideoInfo class represents an SDL_VideoInfo C struct. The class extends SDLStruct and thus represents a native C structure. The video info structure contains information about the capabilities of the video hardware.
SDLPalette: The SDLPalette class represents an SDL_Palette C struct. The class extends SDLStruct and thus represents a native C structure. The C structure is basically an array of colors that make up a palette.
SDLCursor: The SDLCursor represents an SDL cursor. This class is then passed to SDLEventManager.setCursor() method to set the current cursor for the screen. Note that this class supplies a standard error cursor.
SDLException: The SDLException is an exception type that is thrown whenever an SDL error occurs. In addition, it is used as the base class for other exception types such as SDLLibraryNotAvailableException .
SDLRect: The SDLRect class does not directly represent an SDL_rect C structure. Instead, it is a pure Java object that must be converted to a native representation on the fly when needed.
SDLQuitEvent: The SDLQuitEvent represents a user quit event. When the user closes the window, for example, this event will occur.
SDLJoyBallEvent: The SDLJoyBallEvent represents a joystick trackball motion event.
SDLActiveEvent: The SDLActiveEvent represents an application visibility event.
SDLJoyAxisEvent: The SDLJoyAxisEvent represents a joystick axis motion event.
SDLJoyHatEvent: The SDLJoyHatEvent represents a joystick hat position event.
SDLMouseState: The SDLMouseState represents a snapshot of the mouse state.

Home | Contact Us | Privacy Policy | Terms of Service