news ] downloads ] plugins ] modules ] documentation ] info ]
SDL / SDL_net -- Documentation for the TKScript SDL bindings.
last updated: 01. May 2005
 

Table of contents

The tksdl plugin

The tksdl plugin provides bindings for the SDL (and SDL_net) hardware abstraction layer.

Constants

MOUSE_LBUTTON, MOUSE_RBUTTON, MOUSE_MBUTTON, MOUSE_WHEELUP, MOUSE_WHEELDOWN, MOUSE_POINTER_ENTER, MOUSE_POINTER_MOVE, MOUSE_POINTER_MANUAL, PRIORITY_IDLE, PRIORITY_NORMAL, PRIORITY_HIGH, PRIORITY_REALTIME, REDRAW_ALL, REDRAW_DIRTY, SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGTERM, SIGABRT, DEFAULT_KEYBOARD_REPEAT_DELAY, DEFAULT_KEYBOARD_REPEAT_INTERVAL,
SDL_RESIZABLE, SDL_NOFRAME
VKEY_PRESSED (0x80000000),
VKEY_BACKSPACE, VKEY_TAB, VKEY_CLEAR, VKEY_RETURN, VKEY_PAUSE, VKEY_ESCAPE, VKEY_SPACE, VKEY_EXCLAIM, VKEY_QUOTEDBL, VKEY_HASH, VKEY_DOLLAR, VKEY_AMPERSAND, VKEY_QUOTE, VKEY_LEFTPAREN, VKEY_RIGHTPAREN, VKEY_ASTERISK, VKEY_PLUS, VKEY_COMMA, VKEY_MINUS, VKEY_PERIOD, VKEY_SLASH, VKEY_0, VKEY_1, VKEY_2, VKEY_3, VKEY_4, VKEY_5, VKEY_6, VKEY_7, VKEY_8, VKEY_9, VKEY_COLON, VKEY_SEMICOLON, VKEY_LESS, VKEY_EQUALS, VKEY_GREATER, VKEY_QUESTION, VKEY_AT, VKEY_LEFTBRACKET, VKEY_BACKSLASH, VKEY_RIGHTBRACKET, VKEY_CARET, VKEY_UNDERSCORE, VKEY_BACKQUOTE, VKEY_DELETE,
VKEY_KP0, VKEY_KP1, VKEY_KP2, VKEY_KP3, VKEY_KP4, VKEY_KP5, VKEY_KP6, VKEY_KP7, VKEY_KP8, VKEY_KP9, VKEY_KP_PERIOD, VKEY_KP_DIVIDE, VKEY_KP_MULTIPLY, VKEY_KP_MINUS, VKEY_KP_PLUS, VKEY_KP_ENTER, VKEY_KP_EQUALS,
VKEY_UP, VKEY_DOWN, VKEY_RIGHT, VKEY_LEFT, VKEY_INSERT, VKEY_HOME, VKEY_END, VKEY_PAGEUP, VKEY_PAGEDOWN,
VKEY_F1, VKEY_F2, VKEY_F3, VKEY_F4, VKEY_F5, VKEY_F6, VKEY_F7, VKEY_F8, VKEY_F9, VKEY_F10, VKEY_F11, VKEY_F12, VKEY_F13, VKEY_F14, VKEY_F15,
VKEY_NUMLOCK, VKEY_CAPSLOCK, VKEY_SCROLLOCK, VKEY_RSHIFT, VKEY_LSHIFT, VKEY_RCTRL, VKEY_LCTRL, VKEY_RALT, VKEY_LALT, VKEY_RMETA, VKEY_LMETA,
VKEY_LSUPER /* Left "Windows" key */, VKEY_RSUPER /* Right "Windows" key */, VKEY_MODE /* "Alt Gr" key */, VKEY_COMPOSE /* Multi-key compose key */,
VKEY_HELP, VKEY_PRINT, VKEY_SYSREQ, VKEY_BREAK, VKEY_MENU, VKEY_POWER /* Power Macintosh power key */, VKEY_EURO /* Some european keyboards */
/* additional modifiers */ VMOD_LSHIFT, VMOD_RSHIFT, VMOD_LCTRL, VMOD_RCTRL, VMOD_LALT, VMOD_RALT, VMOD_LMETA, VMOD_RMETA, VMOD_NUM, VMOD_CAPS, VMOD_MODE,
SDL_HAT_CENTERED, SDL_HAT_UP, SDL_HAT_RIGHT, SDL_HAT_DOWN, SDL_HAT_LEFT, SDL_HAT_RIGHTUP, SDL_HAT_RIGHTDOWN, SDL_HAT_LEFTUP, SDL_HAT_LEFTDOWN
INADDR_ANY (0), INADDR_NONE (0xFFFFFFFF),

Signals

  • AudioDevice:
    • onAudioBeginBlock(FloatArray _fa) - called when a new block of (_fa.numElements/2 stereo l/r pairs) audio samples need to be calculated
    • onAudioFrame() (called by sequencer) - called when a new timeframe starts (according to bpm and ppq settings)
    • onAudioPostProcess(FloatArray _fa) - called when the current audiobuffer is to be sent to the audio hardware
    • onAudioRender(FloatArray _fa) (called by sequencer) - called when a new audiobuffer needs to be rendered. Applications may want to call AudioDevice.processTimeFrames().
  • SDL:
    • onApplicationActive(boolean _gain) - called when the application was iconified (_gain=0) or restored (_gain=1)
    • onEvent(String _event) - general purpose event mechanism
    • onExit()
    • onExpose() - called when the toplevel window becomes visible (again)
    • onKeyboard(Key _k) - called when a key on the keyboard has been pressed or released
    • onJoyAxisMotion(int _dev, int _axis, int _value) - called when a joystick paddle is moved
    • onJoyButton(int _dev, int _button, int _pressed) - called when a joystick button is pressed or released
    • onJoyHatMotion(int _dev, int _hat, int _state) - called when a joystick hat is moved
    • onJoyBallMotion(int _dev, int _ball, int _dx, int _dy)
    • onDraw() - render a new frame. During the calculation of graphical entities, applications should take the FPS.precision field into account to achieve smoother animations.
    • onMouse(int _x, int _y, int _cstate, int _nstate) - called when the mouse (or trackball/touchpad/..) is moved
    • onMouseFocusActive(boolean _gain) - called when the mouse focus was gained (_gain=1) or lost (_gain=0)
    • onReopen() - called when switching between window and fullscreen mode
    • onResize() - called when the toplevel window size changes
    • onSignal(int _signal) - SIGINT, SIGILL, SIGFPE, SIGSEGV, SIGTERM, SIGABRT, ...
    • onTick() - used for constant time frame physics (deprecated)

Examples

Please download the tks-examples.zip archive which also contains several OpenGL/SDL demos.

 

SimpleDirectLayer library OpenGL zlib compression library The FreeType project PortableNetworkGraphics MySQL