home
 
 index of namespace default
 
 index of project tksdl
 
 index of module tksdl

Class tksdl.SDL


SynopsisStatic wrapper class for the SDL library. 

  Base classes:
  Methods:
  Constants: Description:


Please notice that some functionality is placed in separate classes (Mouse, Viewport, AudioDevice, Cursor, FPS)
This class uses the following signals/callbacks:
- onKeyboard(Key k) - onMouse(int absx, int absy, int currbuttonstate, int changedbuttonstate) - onJoyAxisMotion(int dev, int axis, int val) - onJoyButton(int dev, int button, int pressed) - onJoyHatMotion(int dev, int hat, int state) - onJoyBallMotion(int dev, int hat, int dx, int dy) - onDraw() - onExit() - onEvent(Event ev) - onReopen() - onExpose() - onApplicationActive(boolean bActive) - onMouseFocusActive(boolean bActive) - onInputFocusActive(boolean bActive) - onIdle()


 
 top of page
Method delay
Deprecated:  Use TKS.sleep()() instead
Suspend thread for the given number of millisec
Signature
delay(intmillisec)
Arguments
intmillisec

 
 top of page
Method enableKeyRepeat
Deprecated:  Since this is a global setting it is recommend to use the tkui (per widget) keyrepeat mechanism instead
Configure SDL key repeat
Signature
enableKeyRepeat(intdelay,
  intrate 
  )  
Arguments
intdelay
intrate
Description

This is a wrapper for the SDL_EnableKeyRepeat() native function.

 
 top of page
Method enableUNICODE
Configure whether unicode conversion shall be performed when processing keyboard events
Signature
enableUNICODE(booleanbEnabled)
Arguments
booleanbEnabled
Description

This is a wrapper for the SDL_EnableUNICODE() native function.

 
 top of page
Method eventLoop
Enter SDL event loop.
Signature
eventLoop()
Description
This method does not return until the window is closed resp. exitEventLoop() is called.
See also:  


 
 top of page
Method exitEventLoop
Exit SDL event loop.
Signature
exitEventLoop()
Description

This causes the eventLoop() method to return.
See also:  


 
 top of page
Method getEventPolling
Query whether blocking waits shall be used when retrieving the next SDL message
Signature
getEventPolling():boolean
Returns
boolean

 
 top of page
Method getJoystick
Return Joystick device object
Signature
getJoystick(intdev)
 :Joystick
Arguments
intdev
Returns

 
 top of page
Method getNumJoysticks
Query number of available joystick devices.
Signature
getNumJoysticks():int
Returns
int

 
 top of page
Method getRedrawFlag
Query redraw behaviour
Signature
getRedrawFlag():int
Returns
int

 
 top of page
Method getTicks
Deprecated:  Use the milliSeconds()() core function instead
Return number of ticks (millisec) since app. start
Signature
getTicks():int
Returns
int
See also:  


 
 top of page
Method isApplicationActive
Query whether the application windows is currently in the foreground.
Signature
isApplicationActive():boolean
Returns
boolean

 
 top of page
Method reportJoystickEvent
Configure whether joystick events shall be reported
Signature
reportJoystickEvent(booleanbEnable)
Arguments
booleanbEnable
Description

This is a wrapper for the SDL_JoystickEventState() native function.

 
 top of page
Method sendUserEvent
Post event message to event queue
Signature
sendUserEvent(Stringev)
Arguments
Stringev
Description

Useful for asynchronous thread communication

 
 top of page
Method setEventPolling
Configure whether blocking waits shall be used when retrieving the next SDL message
Signature
setEventPolling(booleanbEnabled)
Arguments
booleanbEnabled

 
 top of page
Method setRedrawFlag
Control redraw behaviour
Signature
setRedrawFlag(intflags)
Arguments
intflagsREDRAW_ALL = redraw everytime REDRAW_DIRTY = only redraw if Viewport.needRedraw()() was called

 
 top of page
Method triggerEvent
Deprecated:  Call your event handler directly instead
Immediately send user event
Signature
triggerEvent(Stringev)
Arguments
Stringev
See also:  


 
 top of page
Method updateJoysticks
Update joystick state
Signature
updateJoysticks()
Description

This is a wrapper for the SDL_JoystickUpdate() native function.

 
 top of page
Constant DEFAULT_KEYBOARD_REPEAT_DELAY (int)
Constant DEFAULT_KEYBOARD_REPEAT_INTERVAL (int)
Constant MOUSE_LBUTTON (int)
Constant MOUSE_MBUTTON (int)
Constant MOUSE_POINTER_ENTER (int)
Constant MOUSE_POINTER_MANUAL (int)
Constant MOUSE_POINTER_MOVE (int)
Constant MOUSE_RBUTTON (int)
Constant MOUSE_WHEELDOWN (int)
Constant MOUSE_WHEELUP (int)
Constant REDRAW_ALL (int)
Constant REDRAW_DIRTY (int)
Constant SDL_NOFRAME (int)
Constant SDL_RESIZABLE (int)

 

Project Modules:tksdl 
Project Classes:AudioDevice , AudioSample , Cursor , FPS , Joystick , Key , Mouse , SamplePlayer , SDL , Viewport 
Project Functions:MIDINoteToFrequency 
All Namespaces:default , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Sat, 31/Dec/2011 16:12:20