Initial revision
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401
This commit is contained in:
commit
2f110628a7
892 changed files with 170313 additions and 0 deletions
2
docs/man3/.cvsignore
Normal file
2
docs/man3/.cvsignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
Makefile.in
|
||||
Makefile
|
174
docs/man3/Makefile.am
Normal file
174
docs/man3/Makefile.am
Normal file
|
@ -0,0 +1,174 @@
|
|||
man_MANS = \
|
||||
SDLKey.3 \
|
||||
SDL_ActiveEvent.3 \
|
||||
SDL_AddTimer.3 \
|
||||
SDL_AudioCVT.3 \
|
||||
SDL_AudioSpec.3 \
|
||||
SDL_BlitSurface.3 \
|
||||
SDL_BuildAudioCVT.3 \
|
||||
SDL_CD.3 \
|
||||
SDL_CDClose.3 \
|
||||
SDL_CDEject.3 \
|
||||
SDL_CDName.3 \
|
||||
SDL_CDNumDrives.3 \
|
||||
SDL_CDOpen.3 \
|
||||
SDL_CDPause.3 \
|
||||
SDL_CDPlay.3 \
|
||||
SDL_CDPlayTracks.3 \
|
||||
SDL_CDResume.3 \
|
||||
SDL_CDStatus.3 \
|
||||
SDL_CDStop.3 \
|
||||
SDL_CDtrack.3 \
|
||||
SDL_CloseAudio.3 \
|
||||
SDL_Color.3 \
|
||||
SDL_CondBroadcast.3 \
|
||||
SDL_CondSignal.3 \
|
||||
SDL_CondWait.3 \
|
||||
SDL_CondWaitTimeout.3 \
|
||||
SDL_ConvertAudio.3 \
|
||||
SDL_ConvertSurface.3 \
|
||||
SDL_CreateCond.3 \
|
||||
SDL_CreateCursor.3 \
|
||||
SDL_CreateMutex.3 \
|
||||
SDL_CreateRGBSurface.3 \
|
||||
SDL_CreateRGBSurfaceFrom.3 \
|
||||
SDL_CreateSemaphore.3 \
|
||||
SDL_CreateThread.3 \
|
||||
SDL_CreateYUVOverlay.3 \
|
||||
SDL_Delay.3 \
|
||||
SDL_DestroyCond.3 \
|
||||
SDL_DestroyMutex.3 \
|
||||
SDL_DestroySemaphore.3 \
|
||||
SDL_DisplayFormat.3 \
|
||||
SDL_DisplayFormatAlpha.3 \
|
||||
SDL_DisplayYUVOverlay.3 \
|
||||
SDL_EnableKeyRepeat.3 \
|
||||
SDL_EnableUNICODE.3 \
|
||||
SDL_Event.3 \
|
||||
SDL_EventState.3 \
|
||||
SDL_FillRect.3 \
|
||||
SDL_Flip.3 \
|
||||
SDL_FreeCursor.3 \
|
||||
SDL_FreeSurface.3 \
|
||||
SDL_FreeWAV.3 \
|
||||
SDL_FreeYUVOverlay.3 \
|
||||
SDL_GL_GetAttribute.3 \
|
||||
SDL_GL_GetProcAddress.3 \
|
||||
SDL_GL_LoadLibrary.3 \
|
||||
SDL_GL_SetAttribute.3 \
|
||||
SDL_GL_SwapBuffers.3 \
|
||||
SDL_GLattr.3 \
|
||||
SDL_GetAppState.3 \
|
||||
SDL_GetAudioStatus.3 \
|
||||
SDL_GetClipRect.3 \
|
||||
SDL_GetCursor.3 \
|
||||
SDL_GetEventFilter.3 \
|
||||
SDL_GetGamma.3 \
|
||||
SDL_GetGammaRamp.3 \
|
||||
SDL_GetKeyName.3 \
|
||||
SDL_GetKeyState.3 \
|
||||
SDL_GetModState.3 \
|
||||
SDL_GetMouseState.3 \
|
||||
SDL_GetRGB.3 \
|
||||
SDL_GetRGBA.3 \
|
||||
SDL_GetRelativeMouseState.3 \
|
||||
SDL_GetThreadID.3 \
|
||||
SDL_GetTicks.3 \
|
||||
SDL_GetVideoInfo.3 \
|
||||
SDL_GetVideoSurface.3 \
|
||||
SDL_Init.3 \
|
||||
SDL_InitSubSystem.3 \
|
||||
SDL_JoyAxisEvent.3 \
|
||||
SDL_JoyBallEvent.3 \
|
||||
SDL_JoyButtonEvent.3 \
|
||||
SDL_JoyHatEvent.3 \
|
||||
SDL_JoystickClose.3 \
|
||||
SDL_JoystickEventState.3 \
|
||||
SDL_JoystickGetAxis.3 \
|
||||
SDL_JoystickGetBall.3 \
|
||||
SDL_JoystickGetButton.3 \
|
||||
SDL_JoystickGetHat.3 \
|
||||
SDL_JoystickIndex.3 \
|
||||
SDL_JoystickName.3 \
|
||||
SDL_JoystickNumAxes.3 \
|
||||
SDL_JoystickNumBalls.3 \
|
||||
SDL_JoystickNumButtons.3 \
|
||||
SDL_JoystickNumHats.3 \
|
||||
SDL_JoystickOpen.3 \
|
||||
SDL_JoystickOpened.3 \
|
||||
SDL_JoystickUpdate.3 \
|
||||
SDL_KeyboardEvent.3 \
|
||||
SDL_KillThread.3 \
|
||||
SDL_ListModes.3 \
|
||||
SDL_LoadBMP.3 \
|
||||
SDL_LoadWAV.3 \
|
||||
SDL_LockAudio.3 \
|
||||
SDL_LockSurface.3 \
|
||||
SDL_LockYUVOverlay.3 \
|
||||
SDL_MapRGB.3 \
|
||||
SDL_MapRGBA.3 \
|
||||
SDL_MixAudio.3 \
|
||||
SDL_MouseButtonEvent.3 \
|
||||
SDL_MouseMotionEvent.3 \
|
||||
SDL_NumJoysticks.3 \
|
||||
SDL_OpenAudio.3 \
|
||||
SDL_Overlay.3 \
|
||||
SDL_Palette.3 \
|
||||
SDL_PauseAudio.3 \
|
||||
SDL_PeepEvents.3 \
|
||||
SDL_PixelFormat.3 \
|
||||
SDL_PollEvent.3 \
|
||||
SDL_PumpEvents.3 \
|
||||
SDL_PushEvent.3 \
|
||||
SDL_Quit.3 \
|
||||
SDL_QuitEvent.3 \
|
||||
SDL_QuitSubSystem.3 \
|
||||
SDL_RWFromFile.3 \
|
||||
SDL_Rect.3 \
|
||||
SDL_RemoveTimer.3 \
|
||||
SDL_ResizeEvent.3 \
|
||||
SDL_SaveBMP.3 \
|
||||
SDL_SemPost.3 \
|
||||
SDL_SemTryWait.3 \
|
||||
SDL_SemValue.3 \
|
||||
SDL_SemWait.3 \
|
||||
SDL_SemWaitTimeout.3 \
|
||||
SDL_SetAlpha.3 \
|
||||
SDL_SetClipRect.3 \
|
||||
SDL_SetColorKey.3 \
|
||||
SDL_SetColors.3 \
|
||||
SDL_SetCursor.3 \
|
||||
SDL_SetEventFilter.3 \
|
||||
SDL_SetGamma.3 \
|
||||
SDL_SetGammaRamp.3 \
|
||||
SDL_SetModState.3 \
|
||||
SDL_SetPalette.3 \
|
||||
SDL_SetTimer.3 \
|
||||
SDL_SetVideoMode.3 \
|
||||
SDL_ShowCursor.3 \
|
||||
SDL_Surface.3 \
|
||||
SDL_SysWMEvent.3 \
|
||||
SDL_ThreadID.3 \
|
||||
SDL_UnlockAudio.3 \
|
||||
SDL_UnlockSurface.3 \
|
||||
SDL_UnlockYUVOverlay.3 \
|
||||
SDL_UpdateRect.3 \
|
||||
SDL_UpdateRects.3 \
|
||||
SDL_UserEvent.3 \
|
||||
SDL_VideoDriverName.3 \
|
||||
SDL_VideoInfo.3 \
|
||||
SDL_VideoModeOK.3 \
|
||||
SDL_WM_GetCaption.3 \
|
||||
SDL_WM_GrabInput.3 \
|
||||
SDL_WM_IconifyWindow.3 \
|
||||
SDL_WM_SetCaption.3 \
|
||||
SDL_WM_SetIcon.3 \
|
||||
SDL_WM_ToggleFullScreen.3 \
|
||||
SDL_WaitEvent.3 \
|
||||
SDL_WaitThread.3 \
|
||||
SDL_WarpMouse.3 \
|
||||
SDL_WasInit.3 \
|
||||
SDL_keysym.3 \
|
||||
SDL_mutexP.3 \
|
||||
SDL_mutexV.3
|
||||
EXTRA_DIST = $(man_MANS)
|
161
docs/man3/SDLKey.3
Normal file
161
docs/man3/SDLKey.3
Normal file
|
@ -0,0 +1,161 @@
|
|||
.TH "SDLKey" "3" "Wed 11 Oct 2000, 22:28" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDLKey\- SDL Keysym Definitions
|
||||
.SH "SDL Keysym definitions"
|
||||
.PP
|
||||
\fBSDLKey ASCII value Common Name\fR
|
||||
.nf
|
||||
\f(CWSDLK_BACKSPACE '\\b' backspace
|
||||
SDLK_TAB '\\t' tab
|
||||
SDLK_CLEAR clear
|
||||
SDLK_RETURN '\\r' return
|
||||
SDLK_PAUSE pause
|
||||
SDLK_ESCAPE '^[' escape
|
||||
SDLK_SPACE ' ' space
|
||||
SDLK_EXCLAIM '!' exclaim
|
||||
SDLK_QUOTEDBL '"' quotedbl
|
||||
SDLK_HASH '#' hash
|
||||
SDLK_DOLLAR '$' dollar
|
||||
SDLK_AMPERSAND '&' ampersand
|
||||
SDLK_QUOTE ''' quote
|
||||
SDLK_LEFTPAREN '(' left parenthesis
|
||||
SDLK_RIGHTPAREN ')' right parenthesis
|
||||
SDLK_ASTERISK '*' asterisk
|
||||
SDLK_PLUS '+' plus sign
|
||||
SDLK_COMMA ',' comma
|
||||
SDLK_MINUS '-' minus sign
|
||||
SDLK_PERIOD '.' period
|
||||
SDLK_SLASH '/' forward slash
|
||||
SDLK_0 '0' 0
|
||||
SDLK_1 '1' 1
|
||||
SDLK_2 '2' 2
|
||||
SDLK_3 '3' 3
|
||||
SDLK_4 '4' 4
|
||||
SDLK_5 '5' 5
|
||||
SDLK_6 '6' 6
|
||||
SDLK_7 '7' 7
|
||||
SDLK_8 '8' 8
|
||||
SDLK_9 '9' 9
|
||||
SDLK_COLON ':' colon
|
||||
SDLK_SEMICOLON ';' semicolon
|
||||
SDLK_LESS '<' less-than sign
|
||||
SDLK_EQUALS '=' equals sign
|
||||
SDLK_GREATER '>' greater-than sign
|
||||
SDLK_QUESTION '?' question mark
|
||||
SDLK_AT '@' at
|
||||
SDLK_LEFTBRACKET '[' left bracket
|
||||
SDLK_BACKSLASH '\\' backslash
|
||||
SDLK_RIGHTBRACKET ']' right bracket
|
||||
SDLK_CARET '^' caret
|
||||
SDLK_UNDERSCORE '_' underscore
|
||||
SDLK_BACKQUOTE '`' grave
|
||||
SDLK_a 'a' a
|
||||
SDLK_b 'b' b
|
||||
SDLK_c 'c' c
|
||||
SDLK_d 'd' d
|
||||
SDLK_e 'e' e
|
||||
SDLK_f 'f' f
|
||||
SDLK_g 'g' g
|
||||
SDLK_h 'h' h
|
||||
SDLK_i 'i' i
|
||||
SDLK_j 'j' j
|
||||
SDLK_k 'k' k
|
||||
SDLK_l 'l' l
|
||||
SDLK_m 'm' m
|
||||
SDLK_n 'n' n
|
||||
SDLK_o 'o' o
|
||||
SDLK_p 'p' p
|
||||
SDLK_q 'q' q
|
||||
SDLK_r 'r' r
|
||||
SDLK_s 's' s
|
||||
SDLK_t 't' t
|
||||
SDLK_u 'u' u
|
||||
SDLK_v 'v' v
|
||||
SDLK_w 'w' w
|
||||
SDLK_x 'x' x
|
||||
SDLK_y 'y' y
|
||||
SDLK_z 'z' z
|
||||
SDLK_DELETE '^?' delete
|
||||
SDLK_KP0 keypad 0
|
||||
SDLK_KP1 keypad 1
|
||||
SDLK_KP2 keypad 2
|
||||
SDLK_KP3 keypad 3
|
||||
SDLK_KP4 keypad 4
|
||||
SDLK_KP5 keypad 5
|
||||
SDLK_KP6 keypad 6
|
||||
SDLK_KP7 keypad 7
|
||||
SDLK_KP8 keypad 8
|
||||
SDLK_KP9 keypad 9
|
||||
SDLK_KP_PERIOD '.' keypad period
|
||||
SDLK_KP_DIVIDE '/' keypad divide
|
||||
SDLK_KP_MULTIPLY '*' keypad multiply
|
||||
SDLK_KP_MINUS '-' keypad minus
|
||||
SDLK_KP_PLUS '+' keypad plus
|
||||
SDLK_KP_ENTER '\\r' keypad enter
|
||||
SDLK_KP_EQUALS '=' keypad equals
|
||||
SDLK_UP up arrow
|
||||
SDLK_DOWN down arrow
|
||||
SDLK_RIGHT right arrow
|
||||
SDLK_LEFT left arrow
|
||||
SDLK_INSERT insert
|
||||
SDLK_HOME home
|
||||
SDLK_END end
|
||||
SDLK_PAGEUP page up
|
||||
SDLK_PAGEDOWN page down
|
||||
SDLK_F1 F1
|
||||
SDLK_F2 F2
|
||||
SDLK_F3 F3
|
||||
SDLK_F4 F4
|
||||
SDLK_F5 F5
|
||||
SDLK_F6 F6
|
||||
SDLK_F7 F7
|
||||
SDLK_F8 F8
|
||||
SDLK_F9 F9
|
||||
SDLK_F10 F10
|
||||
SDLK_F11 F11
|
||||
SDLK_F12 F12
|
||||
SDLK_F13 F13
|
||||
SDLK_F14 F14
|
||||
SDLK_F15 F15
|
||||
SDLK_NUMLOCK numlock
|
||||
SDLK_CAPSLOCK capslock
|
||||
SDLK_SCROLLOCK scrollock
|
||||
SDLK_RSHIFT right shift
|
||||
SDLK_LSHIFT left shift
|
||||
SDLK_RCTRL right ctrl
|
||||
SDLK_LCTRL left ctrl
|
||||
SDLK_RALT right alt
|
||||
SDLK_LALT left alt
|
||||
SDLK_RMETA right meta
|
||||
SDLK_LMETA left meta
|
||||
SDLK_LSUPER left windows key
|
||||
SDLK_RSUPER right windows key
|
||||
SDLK_MODE mode shift
|
||||
SDLK_HELP help
|
||||
SDLK_PRINT print-screen
|
||||
SDLK_SYSREQ SysRq
|
||||
SDLK_BREAK break
|
||||
SDLK_MENU menu
|
||||
SDLK_POWER power
|
||||
SDLK_EURO euro\fR
|
||||
.fi
|
||||
|
||||
|
||||
.SH "SDL modifier definitions"
|
||||
.PP
|
||||
\fBSDL Modifier Meaning\fR
|
||||
.nf
|
||||
\f(CWKMOD_NONE No modifiers applicable
|
||||
KMOD_NUM Numlock is down
|
||||
KMOD_CAPS Capslock is down
|
||||
KMOD_LCTRL Left Control is down
|
||||
KMOD_RCTRL Right Control is down
|
||||
KMOD_RSHIFT Right Shift is down
|
||||
KMOD_LSHIFT Left Shift is down
|
||||
KMOD_RALT Right Alt is down
|
||||
KMOD_LALT Left Alt is down
|
||||
KMOD_CTRL A Control key is down
|
||||
KMOD_SHIFT A Shift key is down
|
||||
KMOD_ALT An Alt key is down\fR
|
||||
.fi
|
||||
|
38
docs/man3/SDL_ActiveEvent.3
Normal file
38
docs/man3/SDL_ActiveEvent.3
Normal file
|
@ -0,0 +1,38 @@
|
|||
.TH "SDL_ActiveEvent" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_ActiveEvent\- Application visibility event structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 type;
|
||||
Uint8 gain;
|
||||
Uint8 state;
|
||||
} SDL_ActiveEvent;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
\fBSDL_ACTIVEEVENT\&.\fP
|
||||
.TP 20
|
||||
\fBgain\fR
|
||||
0 if the event is a loss or 1 if it is a gain\&.
|
||||
.TP 20
|
||||
\fBstate\fR
|
||||
\fBSDL_APPMOUSEFOCUS\fP if mouse focus was gained or lost, \fBSDL_APPINPUTFOCUS\fP if input focus was gained or lost, or \fBSDL_APPACTIVE\fP if the application was iconified (\fBgain\fR=0) or restored(\fBgain\fR=1)\&.
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_ActiveEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_ACTIVEEVENT\fP is reported\&.
|
||||
.PP
|
||||
When the mouse leaves or enters the window area a \fBSDL_APPMOUSEFOCUS\fP type activation event occurs, if the mouse entered the window then \fBgain\fR will be 1, otherwise \fBgain\fR will be 0\&. A \fBSDL_APPINPUTFOCUS\fP type activation event occurs when the application loses or gains keyboard focus\&. This usually occurs when another application is made active\&. Finally, a \fBSDL_APPACTIVE\fP type event occurs when the application is either minimised/iconified (\fBgain\fR=0) or restored\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
This event does not occur when an application window is first created\&.
|
||||
.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR, \fI\fBSDL_GetAppState\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
38
docs/man3/SDL_AddTimer.3
Normal file
38
docs/man3/SDL_AddTimer.3
Normal file
|
@ -0,0 +1,38 @@
|
|||
.TH "SDL_AddTimer" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_AddTimer\- Add a timer which will call a callback after the specified number of milliseconds has elapsed\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_TimerID \fBSDL_AddTimer\fP\fR(\fBUint32 interval, SDL_NewTimerCallback callback, void *param\fR);
|
||||
.SH "CALLBACK"
|
||||
.PP
|
||||
.nf
|
||||
\f(CW/* type definition for the "new" timer callback function */
|
||||
typedef Uint32 (*SDL_NewTimerCallback)(Uint32 interval, void *param);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Adds a callback function to be run after the specified number of milliseconds has elapsed\&. The callback function is passed the current timer interval and the user supplied parameter from the \fBSDL_AddTimer\fP call and returns the next timer interval\&. If the returned value from the callback is the same as the one passed in, the periodic alarm continues, otherwise a new alarm is scheduled\&.
|
||||
.PP
|
||||
To cancel a currently running timer call \fISDL_RemoveTimer\fR with the timer ID returned from \fBSDL_AddTimer\fP\&.
|
||||
.PP
|
||||
The timer callback function may run in a different thread than your main program, and so shouldn\&'t call any functions from within itself\&.
|
||||
.PP
|
||||
The maximum resolution of this timer is 10 ms, which means that if you request a 16 ms timer, your callback will run approximately 20 ms later on an unloaded system\&. If you wanted to set a flag signaling a frame update at 30 frames per second (every 33 ms), you might set a timer for 30 ms (see example below)\&. If you use this function, you need to pass \fBSDL_INIT_TIMER\fP to \fISDL_Init\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns an ID value for the added timer or \fBNULL\fR if there was an error\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWmy_timer_id = SDL_AddTimer((33/10)*10, my_callbackfunc, my_callback_param);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_RemoveTimer\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
68
docs/man3/SDL_AudioCVT.3
Normal file
68
docs/man3/SDL_AudioCVT.3
Normal file
|
@ -0,0 +1,68 @@
|
|||
.TH "SDL_AudioCVT" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_AudioCVT\- Audio Conversion Structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
int needed;
|
||||
Uint16 src_format;
|
||||
Uint16 dest_format;
|
||||
double rate_incr;
|
||||
Uint8 *buf;
|
||||
int len;
|
||||
int len_cvt;
|
||||
int len_mult;
|
||||
double len_ratio;
|
||||
void (*filters[10])(struct SDL_AudioCVT *cvt, Uint16 format);
|
||||
int filter_index;
|
||||
} SDL_AudioCVT;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBneeded\fR
|
||||
Set to one if the conversion is possible
|
||||
.TP 20
|
||||
\fBsrc_format\fR
|
||||
Audio format of the source
|
||||
.TP 20
|
||||
\fBdest_format\fR
|
||||
Audio format of the destination
|
||||
.TP 20
|
||||
\fBrate_incr\fR
|
||||
Rate conversion increment
|
||||
.TP 20
|
||||
\fBbuf\fR
|
||||
Audio buffer
|
||||
.TP 20
|
||||
\fBlen\fR
|
||||
Length of the original audio buffer in bytes
|
||||
.TP 20
|
||||
\fBlen_cvt\fR
|
||||
Length of converted audio buffer in bytes (calculated)
|
||||
.TP 20
|
||||
\fBlen_mult\fR
|
||||
\fBbuf\fR must be \fBlen\fR*\fBlen_mult\fR bytes in size(calculated)
|
||||
.TP 20
|
||||
\fBlen_ratio\fR
|
||||
Final audio size is \fBlen\fR*\fBlen_ratio\fR
|
||||
.TP 20
|
||||
\fBfilters[10](\&.\&.)\fR
|
||||
Pointers to functions needed for this conversion
|
||||
.TP 20
|
||||
\fBfilter_index\fR
|
||||
Current conversion function
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The \fBSDL_AudioCVT\fR is used to convert audio data between different formats\&. A \fBSDL_AudioCVT\fR structure is created with the \fI\fBSDL_BuildAudioCVT\fP\fR function, while the actual conversion is done by the \fI\fBSDL_ConvertAudio\fP\fR function\&.
|
||||
.PP
|
||||
Many of the fields in the \fBSDL_AudioCVT\fR structure should be considered private and their function will not be discussed here\&.
|
||||
.IP "\fBUint8 *\fP\fBbuf\fR" 10This points to the audio data that will be used in the conversion\&. It is both the source and the destination, which means the converted audio data overwrites the original data\&. It also means that the converted data may be larger than the original data (if you were converting from 8-bit to 16-bit, for instance), so you must ensure \fBbuf\fR is large enough\&. See below\&.
|
||||
.IP "\fBint\fP \fBlen\fR" 10This is the length of the original audio data in bytes\&.
|
||||
.IP "\fBint\fP \fBlen_mult\fR" 10As explained above, the audio buffer needs to be big enough to store the converted data, which may be bigger than the original audio data\&. The length of \fBbuf\fR should be \fBlen\fR*\fBlen_mult\fR\&.
|
||||
.IP "\fBdouble\fP \fBlen_ratio\fR" 10When you have finished converting your audio data, you need to know how much of your audio buffer is valid\&. \fBlen\fR*\fBlen_ratio\fR is the size of the converted audio data in bytes\&. This is very similar to \fBlen_mult\fR, however when the convert audio data is shorter than the original \fBlen_mult\fR would be 1\&. \fBlen_ratio\fR, on the other hand, would be a fractional number between 0 and 1\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioSpec\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
70
docs/man3/SDL_AudioSpec.3
Normal file
70
docs/man3/SDL_AudioSpec.3
Normal file
|
@ -0,0 +1,70 @@
|
|||
.TH "SDL_AudioSpec" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_AudioSpec\- Audio Specification Structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
int freq;
|
||||
Uint16 format;
|
||||
Uint8 channels;
|
||||
Uint8 silence;
|
||||
Uint16 samples;
|
||||
Uint32 size;
|
||||
void (*callback)(void *userdata, Uint8 *stream, int len);
|
||||
void *userdata;
|
||||
} SDL_AudioSpec;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBfreq\fR
|
||||
Audio frequency in samples per second
|
||||
.TP 20
|
||||
\fBformat\fR
|
||||
Audio data format
|
||||
.TP 20
|
||||
\fBchannels\fR
|
||||
Number of channels: 1 mono, 2 stereo
|
||||
.TP 20
|
||||
\fBsilence\fR
|
||||
Audio buffer silence value (calculated)
|
||||
.TP 20
|
||||
\fBsamples\fR
|
||||
Audio buffer size in samples
|
||||
.TP 20
|
||||
\fBsize\fR
|
||||
Audio buffer size in bytes (calculated)
|
||||
.TP 20
|
||||
\fBcallback(\&.\&.)\fR
|
||||
Callback function for filling the audio buffer
|
||||
.TP 20
|
||||
\fBuserdata\fR
|
||||
Pointer the user data which is passed to the callback function
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The \fBSDL_AudioSpec\fR structure is used to describe the format of some audio data\&. This structure is used by \fI\fBSDL_OpenAudio\fP\fR and \fI\fBSDL_LoadWAV\fP\fR\&. While all fields are used by \fBSDL_OpenAudio\fP only \fBfreq\fR, \fBformat\fR, \fBsamples\fR and \fBchannels\fR are used by \fBSDL_LoadWAV\fP\&. We will detail these common members here\&.
|
||||
.TP 20
|
||||
\fBfreq\fR
|
||||
The number of samples sent to the sound device every second\&. Common values are 11025, 22050 and 44100\&. The higher the better\&.
|
||||
.TP 20
|
||||
\fBformat\fR
|
||||
Specifies the size and type of each sample element
|
||||
.IP "\fBAUDIO_U8\fP" 10Unsigned 8-bit samples
|
||||
.IP "\fBAUDIO_S8\fP" 10Signed 8-bit samples
|
||||
.IP "\fBAUDIO_U16\fP or \fBAUDIO_U16LSB\fP" 10Unsigned 16-bit little-endian samples
|
||||
.IP "\fBAUDIO_S16\fP or \fBAUDIO_S16LSB\fP" 10Signed 16-bit little-endian samples
|
||||
.IP "\fBAUDIO_U16MSB\fP" 10Unsigned 16-bit big-endian samples
|
||||
.IP "\fBAUDIO_S16MSB\fP" 10Signed 16-bit big-endian samples
|
||||
.IP "\fBAUDIO_U16SYS\fP" 10Either \fBAUDIO_U16LSB\fP or \fBAUDIO_U16MSB\fP depending on you systems endianness
|
||||
.IP "\fBAUDIO_S16SYS\fP" 10Either \fBAUDIO_S16LSB\fP or \fBAUDIO_S16MSB\fP depending on you systems endianness
|
||||
.TP 20
|
||||
\fBchannels\fR
|
||||
The number of seperate sound channels\&. 1 is mono (single channel), 2 is stereo (dual channel)\&.
|
||||
.TP 20
|
||||
\fBsamples\fR
|
||||
When used with \fI\fBSDL_OpenAudio\fP\fR this refers to the size of the audio buffer in samples\&. A sample a chunk of audio data of the size specified in \fBformat\fR mulitplied by the number of channels\&. When the \fBSDL_AudioSpec\fR is used with \fI\fBSDL_LoadWAV\fP\fR \fBsamples\fR is set to 4096\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_OpenAudio\fP\fR, \fI\fBSDL_LoadWAV\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
45
docs/man3/SDL_BlitSurface.3
Normal file
45
docs/man3/SDL_BlitSurface.3
Normal file
|
@ -0,0 +1,45 @@
|
|||
.TH "SDL_BlitSurface" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_BlitSurface\- This performs a fast blit from the source surface to the destination surface\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_BlitSurface\fP\fR(\fBSDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This performs a fast blit from the source surface to the destination surface\&.
|
||||
.PP
|
||||
Only the position is used in the \fBdstrect\fR (the width and height are ignored)\&.
|
||||
.PP
|
||||
If either \fBsrcrect\fR or \fBdstrect\fR are \fBNULL\fP, the entire surface (\fBsrc\fR or \fBdst\fR) is copied\&.
|
||||
.PP
|
||||
The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&.
|
||||
.PP
|
||||
The blit function should not be called on a locked surface\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
The results of blitting operations vary greatly depending on whether \fBSDL_SRCAPLHA\fP is set or not\&. See \fISDL_SetAlpha\fR\&.
|
||||
.RE
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&.
|
||||
.PP
|
||||
If either of the surfaces were in video memory, and the blit returns \fB-2\fR, the video memory was lost, so it should be reloaded with artwork and re-blitted:
|
||||
.PP
|
||||
.nf
|
||||
\f(CW while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
|
||||
while ( SDL_LockSurface(image)) < 0 )
|
||||
Sleep(10);
|
||||
-- Write image pixels to image->pixels --
|
||||
SDL_UnlockSurface(image);
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
This happens under DirectX 5\&.0 when the system switches away from your fullscreen application\&. Locking the surface will also fail until you have access to the video memory again\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
23
docs/man3/SDL_BuildAudioCVT.3
Normal file
23
docs/man3/SDL_BuildAudioCVT.3
Normal file
|
@ -0,0 +1,23 @@
|
|||
.TH "SDL_BuildAudioCVT" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_BuildAudioCVT\- Initializes a SDL_AudioCVT structure for conversion
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_BuildAudioCVT\fP\fR(\fBSDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Before an \fI\fBSDL_AudioCVT\fR\fR structure can be used to convert audio data it must be initialized with source and destination information\&.
|
||||
.PP
|
||||
\fBsrc_format\fR and \fBdst_format\fR are the source and destination format of the conversion\&. (For information on audio formats see \fI\fB SDL_AudioSpec\fR\fR)\&. \fBsrc_channels\fR and \fBdst_channels\fR are the number of channels in the source and destination formats\&. Finally, \fBsrc_rate\fR and \fBdst_rate\fR are the frequency or samples-per-second of the source and destination formats\&. Once again, see \fI\fBSDL_AudioSpec\fR\fR\&.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
Returns \fB-1\fR if the filter could not be built or 1 if it could\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
See \fI\fBSDL_ConvertAudio\fP\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_ConvertAudio\fP\fR, \fI\fBSDL_AudioCVT\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
57
docs/man3/SDL_CD.3
Normal file
57
docs/man3/SDL_CD.3
Normal file
|
@ -0,0 +1,57 @@
|
|||
.TH "SDL_CD" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CD\- CDROM Drive Information
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
int id;
|
||||
CDstatus status;
|
||||
int numtracks;
|
||||
int cur_track;
|
||||
int cur_frame;
|
||||
SDL_CDtrack track[SDL_MAX_TRACKS+1];
|
||||
} SDL_CD;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBid\fR
|
||||
Private drive identifier
|
||||
.TP 20
|
||||
\fBstatus\fR
|
||||
Drive \fIstatus\fR
|
||||
.TP 20
|
||||
\fBnumtracks\fR
|
||||
Number of tracks on the CD
|
||||
.TP 20
|
||||
\fBcur_track\fR
|
||||
Current track
|
||||
.TP 20
|
||||
\fBcur_frame\fR
|
||||
Current frame offset within the track
|
||||
.TP 20
|
||||
\fBtrack\fR[SDL_MAX_TRACKS+1]
|
||||
Array of track descriptions\&. (see \fI\fBSDL_CDtrack\fR\fR)
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
An \fBSDL_CD\fR structure is returned by \fI\fBSDL_CDOpen\fP\fR\&. It represents an opened CDROM device and stores information on the layout of the tracks on the disc\&.
|
||||
.PP
|
||||
A frame is the base data unit of a CD\&. \fBCD_FPS\fP frames is equal to 1 second of music\&. SDL provides two macros for converting between time and frames: \fBFRAMES_TO_MSF(f, M,S,F)\fP and \fBMSF_TO_FRAMES\fP\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWint min, sec, frame;
|
||||
int frame_offset;
|
||||
|
||||
FRAMES_TO_MSF(cdrom->cur_frame, &min, &sec, &frame);
|
||||
printf("Current Position: %d minutes, %d seconds, %d frames
|
||||
", min, sec, frame);
|
||||
|
||||
frame_offset=MSF_TO_FRAMES(min, sec, frame);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CDtrack\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
15
docs/man3/SDL_CDClose.3
Normal file
15
docs/man3/SDL_CDClose.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_CDClose" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDClose\- Closes a SDL_CD handle
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_CDClose\fP\fR(\fBSDL_CD *cdrom\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Closes the given \fBcdrom\fR handle\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDOpen\fP\fR, \fI\fBSDL_CD\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
18
docs/man3/SDL_CDEject.3
Normal file
18
docs/man3/SDL_CDEject.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_CDEject" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDEject\- Ejects a CDROM
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDEject\fP\fR(\fBSDL_CD *cdrom\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Ejects the given \fBcdrom\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CD\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
23
docs/man3/SDL_CDName.3
Normal file
23
docs/man3/SDL_CDName.3
Normal file
|
@ -0,0 +1,23 @@
|
|||
.TH "SDL_CDName" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDName\- Returns a human-readable, system-dependent identifier for the CD-ROM\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBconst char *\fBSDL_CDName\fP\fR(\fBint drive\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns a human-readable, system-dependent identifier for the CD-ROM\&. \fBdrive\fR is the index of the drive\&. Drive indices start to 0 and end at \fBSDL_CDNumDrives()\fP-1\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.IP " \(bu" 6
|
||||
"/dev/cdrom"
|
||||
.IP " \(bu" 6
|
||||
"E:"
|
||||
.IP " \(bu" 6
|
||||
"/dev/disk/ide/1/master"
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDNumDrives\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
15
docs/man3/SDL_CDNumDrives.3
Normal file
15
docs/man3/SDL_CDNumDrives.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_CDNumDrives" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDNumDrives\- Returns the number of CD-ROM drives on the system\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDNumDrives\fP\fR(\fBvoid\fR)
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the number of CD-ROM drives on the system\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
58
docs/man3/SDL_CDOpen.3
Normal file
58
docs/man3/SDL_CDOpen.3
Normal file
|
@ -0,0 +1,58 @@
|
|||
.TH "SDL_CDOpen" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDOpen\- Opens a CD-ROM drive for access\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_CD *\fBSDL_CDOpen\fP\fR(\fBint drive\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Opens a CD-ROM drive for access\&. It returns a \fI\fBSDL_CD\fR\fR structure on success, or \fBNULL\fP if the drive was invalid or busy\&. This newly opened CD-ROM becomes the default CD used when other CD functions are passed a \fBNULL\fP CD-ROM handle\&.
|
||||
.PP
|
||||
Drives are numbered starting with 0\&. Drive 0 is the system default CD-ROM\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_CD *cdrom;
|
||||
int cur_track;
|
||||
int min, sec, frame;
|
||||
SDL_Init(SDL_INIT_CDROM);
|
||||
atexit(SDL_Quit);
|
||||
|
||||
/* Check for CD drives */
|
||||
if(!SDL_CDNumDrives()){
|
||||
/* None found */
|
||||
fprintf(stderr, "No CDROM devices available
|
||||
");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Open the default drive */
|
||||
cdrom=SDL_CDOpen(0);
|
||||
|
||||
/* Did if open? Check if cdrom is NULL */
|
||||
if(!cdrom){
|
||||
fprintf(stderr, "Couldn\&'t open drive: %s
|
||||
", SDL_GetError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Print Volume info */
|
||||
printf("Name: %s
|
||||
", SDL_CDName(0));
|
||||
printf("Tracks: %d
|
||||
", cdrom->numtracks);
|
||||
for(cur_track=0;cur_track < cdrom->numtracks; cur_track++){
|
||||
FRAMES_TO_MSF(cdrom->track[cur_track]\&.length, &min, &sec, &frame);
|
||||
printf(" Track %d: Length %d:%d
|
||||
", cur_track, min, sec);
|
||||
}
|
||||
|
||||
SDL_CDClose(cdrom);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CD\fR\fR, \fI\fBSDL_CDtrack\fR\fR, \fI\fBSDL_CDClose\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
18
docs/man3/SDL_CDPause.3
Normal file
18
docs/man3/SDL_CDPause.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_CDPause" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDPause\- Pauses a CDROM
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDPause\fP\fR(\fBSDL_CD *cdrom\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Pauses play on the given \fBcdrom\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDResume\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
18
docs/man3/SDL_CDPlay.3
Normal file
18
docs/man3/SDL_CDPlay.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_CDPlay" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDPlay\- Play a CD
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDPlay\fP\fR(\fBSDL_CD *cdrom, int start, int length\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Plays the given \fBcdrom\fR, starting a frame \fBstart\fR for \fBlength\fR frames\&.
|
||||
.SH "RETURN VALUES"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDPlayTracks\fP\fR, \fI\fBSDL_CDStop\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
47
docs/man3/SDL_CDPlayTracks.3
Normal file
47
docs/man3/SDL_CDPlayTracks.3
Normal file
|
@ -0,0 +1,47 @@
|
|||
.TH "SDL_CDPlayTracks" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDPlayTracks\- Play the given CD track(s)
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDPlayTracks\fP\fR(\fBSDL_CD *cdrom, int start_track, int start_frame, int ntracks, int nframes)\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_CDPlayTracks\fP plays the given CD starting at track \fBstart_track\fR, for \fBntracks\fR tracks\&.
|
||||
.PP
|
||||
\fBstart_frame\fR is the frame offset, from the beginning of the \fBstart_track\fR, at which to start\&. \fBnframes\fR is the frame offset, from the beginning of the last track (\fBstart_track\fR+\fBntracks\fR), at which to end playing\&.
|
||||
.PP
|
||||
\fBSDL_CDPlayTracks\fP should only be called after calling \fI\fBSDL_CDStatus\fP\fR to get track information about the CD\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
Data tracks are ignored\&.
|
||||
.RE
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR, or \fB-1\fR if there was an error\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CW/* assuming cdrom is a previously opened device */
|
||||
/* Play the entire CD */
|
||||
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 0, 0);
|
||||
|
||||
/* Play the first track */
|
||||
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
|
||||
SDL_CDPlayTracks(cdrom, 0, 0, 1, 0);
|
||||
|
||||
/* Play first 15 seconds of the 2nd track */
|
||||
if(CD_INDRIVE(SDL_CDStatus(cdrom)))
|
||||
SDL_CDPlayTracks(cdrom, 1, 0, 0, CD_FPS*15);\fR
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDStatus\fP\fR, \fI\fBSDL_CD\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
18
docs/man3/SDL_CDResume.3
Normal file
18
docs/man3/SDL_CDResume.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_CDResume" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDResume\- Resumes a CDROM
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDResume\fP\fR(\fBSDL_CD *cdrom\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Resumes play on the given \fBcdrom\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDPlay\fP\fR, \fI\fBSDL_CDPause\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
59
docs/man3/SDL_CDStatus.3
Normal file
59
docs/man3/SDL_CDStatus.3
Normal file
|
@ -0,0 +1,59 @@
|
|||
.TH "SDL_CDStatus" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDStatus\- Returns the current status of the given drive\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBCDstatus \fBSDL_CDStatus\fP\fR(\fBSDL_CD *cdrom\fR);
|
||||
\fB/* Given a status, returns true if there\&'s a disk in the drive */
|
||||
#define CD_INDRIVE(status) ((int)status > 0)
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function returns the current status of the given drive\&. Status is described like so:
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef enum {
|
||||
CD_TRAYEMPTY,
|
||||
CD_STOPPED,
|
||||
CD_PLAYING,
|
||||
CD_PAUSED,
|
||||
CD_ERROR = -1
|
||||
} CDstatus;\fR
|
||||
.fi
|
||||
.PP
|
||||
.PP
|
||||
If the drive has a CD in it, the table of contents of the CD and current play position of the CD will be stored in the SDL_CD structure\&.
|
||||
.PP
|
||||
The macro \fBCD_INDRIVE\fP is provided for convenience, and given a status returns true if there\&'s a disk in the drive\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
\fBSDL_CDStatus\fP also updates the \fI\fBSDL_CD\fR\fR structure passed to it\&.
|
||||
.RE
|
||||
.SH "EXAMPLE"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWint playTrack(int track)
|
||||
{
|
||||
int playing = 0;
|
||||
|
||||
if ( CD_INDRIVE(SDL_CDStatus(cdrom)) ) {
|
||||
/* clamp to the actual number of tracks on the CD */
|
||||
if (track >= cdrom->numtracks) {
|
||||
track = cdrom->numtracks-1;
|
||||
}
|
||||
|
||||
if ( SDL_CDPlayTracks(cdrom, track, 0, 1, 0) == 0 ) {
|
||||
playing = 1;
|
||||
}
|
||||
}
|
||||
return playing;
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CD\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_CDStop.3
Normal file
18
docs/man3/SDL_CDStop.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_CDStop" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDStop\- Stops a CDROM
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CDStop\fP\fR(\fBSDL_CD *cdrom\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Stops play on the given \fBcdrom\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CDPlay\fP\fR,
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
40
docs/man3/SDL_CDtrack.3
Normal file
40
docs/man3/SDL_CDtrack.3
Normal file
|
@ -0,0 +1,40 @@
|
|||
.TH "SDL_CDtrack" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CDtrack\- CD Track Information Structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 id;
|
||||
Uint8 type;
|
||||
Uint32 length;
|
||||
Uint32 offset;
|
||||
} SDL_CDtrack;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBid\fR
|
||||
Track number (0-99)
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
\fBSDL_AUDIO_TRACK\fP or \fBSDL_DATA_TRACK\fP
|
||||
.TP 20
|
||||
\fBlength\fR
|
||||
Length, in frames, of this track
|
||||
.TP 20
|
||||
\fBoffset\fR
|
||||
Frame offset to the beginning of this track
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_CDtrack\fR stores data on each track on a CD, its fields should be pretty self explainatory\&. It is a member a the \fI\fBSDL_CD\fR\fR structure\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
Frames can be converted to standard timings\&. There are \fBCD_FPS\fP frames per second, so \fBSDL_CDtrack\fR\&.\fBlength\fR/\fBCD_FPS\fP=length_in_seconds\&.
|
||||
.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CD\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
15
docs/man3/SDL_CloseAudio.3
Normal file
15
docs/man3/SDL_CloseAudio.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_CloseAudio" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CloseAudio\- Shuts down audio processing and closes the audio device\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_CloseAudio\fP\fR(\fBvoid\fR)
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function shuts down audio processing and closes the audio device\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_OpenAudio\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
34
docs/man3/SDL_Color.3
Normal file
34
docs/man3/SDL_Color.3
Normal file
|
@ -0,0 +1,34 @@
|
|||
.TH "SDL_Color" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_Color\- Format independent color description
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 r;
|
||||
Uint8 g;
|
||||
Uint8 b;
|
||||
Uint8 unused;
|
||||
} SDL_Color;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBr\fR
|
||||
Red intensity
|
||||
.TP 20
|
||||
\fBg\fR
|
||||
Green intensity
|
||||
.TP 20
|
||||
\fBb\fR
|
||||
Blue intensity
|
||||
.TP 20
|
||||
\fBunused\fR
|
||||
Unused
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_Color\fR describes a color in a format independent way\&. You can convert a \fBSDL_Color\fR to a pixel value for a certain pixel format using \fI\fBSDL_MapRGB\fP\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_SetColors\fP\fR, \fI\fBSDL_Palette\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
16
docs/man3/SDL_CondBroadcast.3
Normal file
16
docs/man3/SDL_CondBroadcast.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_CondBroadcast" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CondBroadcast\- Restart all threads waiting on a condition variable
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CondBroadcast\fP\fR(\fBSDL_cond *cond\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Restarts all threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_CondWait\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
16
docs/man3/SDL_CondSignal.3
Normal file
16
docs/man3/SDL_CondSignal.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_CondSignal" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CondSignal\- Restart a thread wait on a condition variable
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CondSignal\fP\fR(\fBSDL_cond *cond\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Restart one of the threads that are waiting on the condition variable, \fBcond\fR\&. Returns \fB0\fR on success of \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondBroadcast\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
16
docs/man3/SDL_CondWait.3
Normal file
16
docs/man3/SDL_CondWait.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_CondWait" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CondWait\- Wait on a condition variable
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CondWait\fP\fR(\fBSDL_cond *cond, SDL_mutex *mut\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Wait on the condition variable \fBcond\fR and unlock the provided mutex\&. The mutex must the locked before entering this function\&. Returns \fB0\fR when it is signalled, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CondWaitTimeout\fP\fR, \fI\fBSDL_CondSignal\fP\fR, \fI\fBSDL_mutexP\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
16
docs/man3/SDL_CondWaitTimeout.3
Normal file
16
docs/man3/SDL_CondWaitTimeout.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_CondWaitTimeout" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CondWaitTimeout\- Wait on a condition variable, with timeout
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_CondWaitTimeout\fP\fR(\fBSDL_cond *cond, SDL_mutex *mutex, Uint32 ms\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Wait on the condition variable \fBcond\fR for, at most, \fBms\fR milliseconds\&. \fBmut\fR is unlocked so it must be locked when the function is called\&. Returns \fBSDL_MUTEX_TIMEDOUT\fP if the condition is not signalled in the allotted time, \fB0\fR if it was signalled or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CondWait\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
95
docs/man3/SDL_ConvertAudio.3
Normal file
95
docs/man3/SDL_ConvertAudio.3
Normal file
|
@ -0,0 +1,95 @@
|
|||
.TH "SDL_ConvertAudio" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_ConvertAudio\- Convert audio data to a desired audio format\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_ConvertAudio\fP\fR(\fBSDL_AudioCVT *cvt\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_ConvertAudio\fP takes one parameter, \fBcvt\fR, which was previously initilized\&. Initilizing a \fI\fBSDL_AudioCVT\fR\fR is a two step process\&. First of all, the structure must be passed to \fI\fBSDL_BuildAudioCVT\fP\fR along with source and destination format parameters\&. Secondly, the \fBcvt\fR->\fBbuf\fR and \fBcvt\fR->\fBlen\fR fields must be setup\&. \fBcvt\fR->\fBbuf\fR should point to the audio data and \fBcvt\fR->\fBlen\fR should be set to the length of the audio data in bytes\&. Remember, the length of the buffer pointed to by \fBbuf\fR show be \fBlen\fR*\fBlen_mult\fR bytes in length\&.
|
||||
.PP
|
||||
Once the \fBSDL_AudioCVT\fRstructure is initilized then we can pass it to \fBSDL_ConvertAudio\fP, which will convert the audio data pointer to by \fBcvt\fR->\fBbuf\fR\&. If \fBSDL_ConvertAudio\fP returned \fB0\fR then the conversion was completed successfully, otherwise \fB-1\fR is returned\&.
|
||||
.PP
|
||||
If the conversion completed successfully then the converted audio data can be read from \fBcvt\fR->\fBbuf\fR\&. The amount of valid, converted, audio data in the buffer is equal to \fBcvt\fR->\fBlen\fR*\fBcvt\fR->\fBlen_ratio\fR\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CW/* Converting some WAV data to hardware format */
|
||||
void my_audio_callback(void *userdata, Uint8 *stream, int len);
|
||||
|
||||
SDL_AudioSpec *desired, *obtained;
|
||||
SDL_AudioSpec wav_spec;
|
||||
SDL_AudioCVT wav_cvt;
|
||||
Uint32 wav_len;
|
||||
Uint8 *wav_buf;
|
||||
int ret;
|
||||
|
||||
/* Allocated audio specs */
|
||||
desired=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
|
||||
obtained=(SDL_AudioSpec *)malloc(sizeof(SDL_AudioSpec));
|
||||
|
||||
/* Set desired format */
|
||||
desired->freq=22050;
|
||||
desired->format=AUDIO_S16LSB;
|
||||
desired->samples=8192;
|
||||
desired->callback=my_audio_callback;
|
||||
desired->userdata=NULL;
|
||||
|
||||
/* Open the audio device */
|
||||
if ( SDL_OpenAudio(desired, obtained) < 0 ){
|
||||
fprintf(stderr, "Couldn\&'t open audio: %s
|
||||
", SDL_GetError());
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
free(desired);
|
||||
|
||||
/* Load the test\&.wav */
|
||||
if( SDL_LoadWAV("test\&.wav", &wav_spec, &wav_buf, &wav_len) == NULL ){
|
||||
fprintf(stderr, "Could not open test\&.wav: %s
|
||||
", SDL_GetError());
|
||||
SDL_CloseAudio();
|
||||
free(obtained);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
/* Build AudioCVT */
|
||||
ret = SDL_BuildAudioCVT(&wav_cvt,
|
||||
wav_spec\&.format, wav_spec\&.channels, wav_spec\&.freq,
|
||||
obtained->format, obtained->channels, obtained->freq);
|
||||
|
||||
/* Check that the convert was built */
|
||||
if(ret==-1){
|
||||
fprintf(stderr, "Couldn\&'t build converter!
|
||||
");
|
||||
SDL_CloseAudio();
|
||||
free(obtained);
|
||||
SDL_FreeWAV(wav_buf);
|
||||
}
|
||||
|
||||
/* Setup for conversion */
|
||||
wav_cvt\&.buf=(Uint8 *)malloc(wav_len*wav_cvt\&.len_mult);
|
||||
wav_cvt\&.len=wav_len;
|
||||
memcpy(wav_cvt\&.buf, wav_buf, wav_len);
|
||||
|
||||
/* We can delete to original WAV data now */
|
||||
SDL_FreeWAV(wav_buf);
|
||||
|
||||
/* And now we\&'re ready to convert */
|
||||
SDL_ConvertAudio(&wav_cvt);
|
||||
|
||||
/* do whatever */
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
|
||||
\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_BuildAudioCVT\fP\fR, \fI\fBSDL_AudioCVT\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
22
docs/man3/SDL_ConvertSurface.3
Normal file
22
docs/man3/SDL_ConvertSurface.3
Normal file
|
@ -0,0 +1,22 @@
|
|||
.TH "SDL_ConvertSurface" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_ConvertSurface\- Converts a surface to the same format as another surface\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Surface *\fBSDL_ConvertSurface\fP\fR(\fBSDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Creates a new surface of the specified format, and then copies and maps the given surface to it\&. If this function fails, it returns \fBNULL\fP\&.
|
||||
.PP
|
||||
The \fBflags\fR parameter is passed to \fI\fBSDL_CreateRGBSurface\fP\fR and has those semantics\&.
|
||||
.PP
|
||||
This function is used internally by \fI\fBSDL_DisplayFormat\fP\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns either a pointer to the new surface, or \fBNULL\fP on error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_DisplayFormat\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
31
docs/man3/SDL_CreateCond.3
Normal file
31
docs/man3/SDL_CreateCond.3
Normal file
|
@ -0,0 +1,31 @@
|
|||
.TH "SDL_CreateCond" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateCond\- Create a condition variable
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBSDL_cond *\fBSDL_CreateCond\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Creates a condition variable\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_cond *cond;
|
||||
|
||||
cond=SDL_CreateCond();
|
||||
\&.
|
||||
\&.
|
||||
/* Do stuff */
|
||||
|
||||
\&.
|
||||
\&.
|
||||
SDL_DestroyCond(cond);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_DestroyCond\fP\fR, \fI\fBSDL_CondWait\fP\fR, \fI\fBSDL_CondSignal\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
120
docs/man3/SDL_CreateCursor.3
Normal file
120
docs/man3/SDL_CreateCursor.3
Normal file
|
@ -0,0 +1,120 @@
|
|||
.TH "SDL_CreateCursor" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateCursor\- Creates a new mouse cursor\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Cursor *\fBSDL_CreateCursor\fP\fR(\fBUint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Create a cursor using the specified \fBdata\fR and \fBmask\fR (in MSB format)\&. The cursor width must be a multiple of 8 bits\&.
|
||||
.PP
|
||||
The cursor is created in black and white according to the following:
|
||||
.TP 20
|
||||
\fBData / Mask\fR
|
||||
\fBResulting pixel on screen\fR
|
||||
.TP 20
|
||||
0 / 1
|
||||
White
|
||||
.TP 20
|
||||
1 / 1
|
||||
Black
|
||||
.TP 20
|
||||
0 / 0
|
||||
Transparent
|
||||
.TP 20
|
||||
1 / 0
|
||||
Inverted color if possible, black if not\&.
|
||||
.PP
|
||||
Cursors created with this function must be freed with \fISDL_FreeCursor\fR\&.
|
||||
.SH "EXAMPLE"
|
||||
.PP
|
||||
.nf
|
||||
\f(CW/* Stolen from the mailing list */
|
||||
/* Creates a new mouse cursor from an XPM */
|
||||
|
||||
|
||||
/* XPM */
|
||||
static const char *arrow[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 3 1",
|
||||
/* colors */
|
||||
"X c #000000",
|
||||
"\&. c #ffffff",
|
||||
" c None",
|
||||
/* pixels */
|
||||
"X ",
|
||||
"XX ",
|
||||
"X\&.X ",
|
||||
"X\&.\&.X ",
|
||||
"X\&.\&.\&.X ",
|
||||
"X\&.\&.\&.\&.X ",
|
||||
"X\&.\&.\&.\&.\&.X ",
|
||||
"X\&.\&.\&.\&.\&.\&.X ",
|
||||
"X\&.\&.\&.\&.\&.\&.\&.X ",
|
||||
"X\&.\&.\&.\&.\&.\&.\&.\&.X ",
|
||||
"X\&.\&.\&.\&.\&.XXXXX ",
|
||||
"X\&.\&.X\&.\&.X ",
|
||||
"X\&.X X\&.\&.X ",
|
||||
"XX X\&.\&.X ",
|
||||
"X X\&.\&.X ",
|
||||
" X\&.\&.X ",
|
||||
" X\&.\&.X ",
|
||||
" X\&.\&.X ",
|
||||
" XX ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
"0,0"
|
||||
};
|
||||
|
||||
static SDL_Cursor *init_system_cursor(const char *image[])
|
||||
{
|
||||
int i, row, col;
|
||||
Uint8 data[4*32];
|
||||
Uint8 mask[4*32];
|
||||
int hot_x, hot_y;
|
||||
|
||||
i = -1;
|
||||
for ( row=0; row<32; ++row ) {
|
||||
for ( col=0; col<32; ++col ) {
|
||||
if ( col % 8 ) {
|
||||
data[i] <<= 1;
|
||||
mask[i] <<= 1;
|
||||
} else {
|
||||
++i;
|
||||
data[i] = mask[i] = 0;
|
||||
}
|
||||
switch (image[4+row][col]) {
|
||||
case \&'X\&':
|
||||
data[i] |= 0x01;
|
||||
k[i] |= 0x01;
|
||||
break;
|
||||
case \&'\&.\&':
|
||||
mask[i] |= 0x01;
|
||||
break;
|
||||
case \&' \&':
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
|
||||
return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_FreeCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
43
docs/man3/SDL_CreateMutex.3
Normal file
43
docs/man3/SDL_CreateMutex.3
Normal file
|
@ -0,0 +1,43 @@
|
|||
.TH "SDL_CreateMutex" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateMutex\- Create a mutex
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBSDL_mutex *\fBSDL_CreateMutex\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Create a new, unlocked mutex\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_mutex *mut;
|
||||
|
||||
mut=SDL_CreateMutex();
|
||||
\&.
|
||||
\&.
|
||||
if(SDL_mutexP(mut)==-1){
|
||||
fprintf(stderr, "Couldn\&'t lock mutex
|
||||
");
|
||||
exit(-1);
|
||||
}
|
||||
\&.
|
||||
/* Do stuff while mutex is locked */
|
||||
\&.
|
||||
\&.
|
||||
if(SDL_mutexV(mut)==-1){
|
||||
fprintf(stderr, "Couldn\&'t unlock mutex
|
||||
");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
SDL_DestroyMutex(mut);
|
||||
\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_mutexP\fP\fR, \fI\fBSDL_mutexV\fP\fR, \fI\fBSDL_DestroyMutex\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
29
docs/man3/SDL_CreateRGBSurface.3
Normal file
29
docs/man3/SDL_CreateRGBSurface.3
Normal file
|
@ -0,0 +1,29 @@
|
|||
.TH "SDL_CreateRGBSurface" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateRGBSurface\- Create an empty SDL_Surface
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Surface *\fBSDL_CreateRGBSurface\fP\fR(\fBUint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Allocate an empty surface (must be called after \fISDL_SetVideoMode\fR)
|
||||
.PP
|
||||
If \fBdepth\fR is 8 bits an empty palette is allocated for the surface, otherwise a \&'packed-pixel\&' \fI\fBSDL_PixelFormat\fR\fR is created using the \fB[RGBA]mask\fR\&'s provided (see \fI\fBSDL_PixelFormat\fR\fR)\&. The \fBflags\fR specifies the type of surface that should be created, it is an OR\&'d combination of the following possible values\&.
|
||||
.TP 20
|
||||
\fBSDL_SWSURFACE\fP
|
||||
SDL will create the surface in system memory\&. This improves the performance of pixel level access, however you may not be able to take advantage of some types of hardware blitting\&.
|
||||
.TP 20
|
||||
\fBSDL_HWSURFACE\fP
|
||||
SDL will attempt to create the surface in video memory\&. This will allow SDL to take advantage of Video->Video blits (which are often accelerated)\&.
|
||||
.TP 20
|
||||
\fBSDL_SRCCOLORKEY\fP
|
||||
With this flag SDL will attempt to find the best location for this surface, either in system memory or video memory, to obtain hardware colorkey blitting support\&.
|
||||
.TP 20
|
||||
\fBSDL_SRCALPHA\fP
|
||||
With this flag SDL will attempt to find the best location for this surface, either in system memory or video memory, to obtain hardware alpha support
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateRGBSurfaceFrom\fP\fR, \fI\fBSDL_FreeSurface\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_PixelFormat\fR\fR, \fI\fBSDL_Surface\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
19
docs/man3/SDL_CreateRGBSurfaceFrom.3
Normal file
19
docs/man3/SDL_CreateRGBSurfaceFrom.3
Normal file
|
@ -0,0 +1,19 @@
|
|||
.TH "SDL_CreateRGBSurfaceFrom" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateRGBSurfaceFrom\- Create an SDL_Surface from pixel data
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Surface *\fBSDL_CreateRGBSurfaceFrom\fP\fR(\fBvoid *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Creates an SDL_Surface from the provided pixel data\&.
|
||||
.PP
|
||||
The data stored in \fBpixels\fR is assumed to be of the \fBdepth\fR specified in the parameter list\&. The pixel data is not copied into the \fBSDL_Surface\fR structure so it should no be freed until the surface has been freed with a called to \fISDL_FreeSurface\fR\&. \fBpitch\fR is the length of each scanline in bytes\&.
|
||||
.PP
|
||||
See \fI\fBSDL_CreateRGBSurface\fP\fR for a more detailed description of the other parameters\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateRGBSurface\fP\fR, \fI\fBSDL_FreeSurface\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
32
docs/man3/SDL_CreateSemaphore.3
Normal file
32
docs/man3/SDL_CreateSemaphore.3
Normal file
|
@ -0,0 +1,32 @@
|
|||
.TH "SDL_CreateSemaphore" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateSemaphore\- Creates a new semaphore and assigns an initial value to it\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBSDL_sem *\fBSDL_CreateSemaphore\fP\fR(\fBUint32 initial_value\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_CreateSemaphore()\fP creates a new semaphore and initializes it with the value \fBinitial_value\fR\&. Each locking operation on the semaphore by \fISDL_SemWait\fR, \fISDL_SemTryWait\fR or \fISDL_SemWaitTimeout\fR will atomically decrement the semaphore value\&. The locking operation will be blocked if the semaphore value is not positive (greater than zero)\&. Each unlock operation by \fISDL_SemPost\fR will atomically increment the semaphore value\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns a pointer to an initialized semaphore or \fBNULL\fR if there was an error\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_sem *my_sem;
|
||||
|
||||
my_sem = SDL_CreateSemaphore(INITIAL_SEM_VALUE);
|
||||
|
||||
if (my_sem == NULL) {
|
||||
return CREATE_SEM_FAILED;
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_DestroySemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
16
docs/man3/SDL_CreateThread.3
Normal file
16
docs/man3/SDL_CreateThread.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_CreateThread" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateThread\- Creates a new thread of execution that shares its parent\&'s properties\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBSDL_Thread *\fBSDL_CreateThread\fP\fR(\fBint (*fn)(void *), void *data\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_CreateThread\fP creates a new thread of execution that shares all of its parent\&'s global memory, signal handlers, file descriptors, etc, and runs the function \fBfn\fR passed the void pointer \fBdata\fR The thread quits when this function returns\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_KillThread\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
17
docs/man3/SDL_CreateYUVOverlay.3
Normal file
17
docs/man3/SDL_CreateYUVOverlay.3
Normal file
|
@ -0,0 +1,17 @@
|
|||
.TH "SDL_CreateYUVOverlay" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_CreateYUVOverlay\- Create a YUV video overlay
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Overlay *\fBSDL_CreateYUVOverlay\fP\fR(\fBint width, int height, Uint32 format, SDL_Surface *display\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_CreateYUVOverlay\fP creates a YUV overlay of the specified \fBwidth\fR, \fBheight\fR and \fBformat\fR (see \fI\fBSDL_Overlay\fR\fR for a list of available formats), for the provided \fBdisplay\fR\&. A \fI\fBSDL_Overlay\fR\fR structure is returned\&.
|
||||
.PP
|
||||
The term \&'overlay\&' is a misnomer since, unless the overlay is created in hardware, the contents for the display surface underneath the area where the overlay is shown will be overwritten when the overlay is displayed\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_Delay.3
Normal file
15
docs/man3/SDL_Delay.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_Delay" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_Delay\- Wait a specified number of milliseconds before returning\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_Delay\fP\fR(\fBUint32 ms\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Wait a specified number of milliseconds before returning\&. \fBSDL_Delay\fP will wait at \fIleast\fP the specified time, but possible longer due to OS scheduling\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_AddTimer\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
16
docs/man3/SDL_DestroyCond.3
Normal file
16
docs/man3/SDL_DestroyCond.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_DestroyCond" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_DestroyCond\- Destroy a condition variable
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_DestroyCond\fP\fR(\fBSDL_cond *cond\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Destroys a condition variable\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateCond\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
16
docs/man3/SDL_DestroyMutex.3
Normal file
16
docs/man3/SDL_DestroyMutex.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_DestroyMutex" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_DestroyMutex\- Destroy a mutex
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_DestroyMutex\fP\fR(\fBSDL_mutex *mutex\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Destroy a previously \fIcreated\fR mutex\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateMutex\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
26
docs/man3/SDL_DestroySemaphore.3
Normal file
26
docs/man3/SDL_DestroySemaphore.3
Normal file
|
@ -0,0 +1,26 @@
|
|||
.TH "SDL_DestroySemaphore" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_DestroySemaphore\- Destroys a semaphore that was created by \fISDL_CreateSemaphore\fR\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_DestroySemaphore\fP\fR(\fBSDL_sem *sem\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_DestroySemaphore\fP destroys the semaphore pointed to by \fBsem\fR that was created by \fI\fBSDL_CreateSemaphore\fP\fR\&. It is not safe to destroy a semaphore if there are threads currently blocked waiting on it\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWif (my_sem != NULL) {
|
||||
SDL_DestroySemaphore(my_sem);
|
||||
my_sem = NULL;
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateSemaphore\fP\fR, \fI\fBSDL_SemWait\fP\fR, \fI\fBSDL_SemTryWait\fP\fR, \fI\fBSDL_SemWaitTimeout\fP\fR, \fI\fBSDL_SemPost\fP\fR, \fI\fBSDL_SemValue\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
22
docs/man3/SDL_DisplayFormat.3
Normal file
22
docs/man3/SDL_DisplayFormat.3
Normal file
|
@ -0,0 +1,22 @@
|
|||
.TH "SDL_DisplayFormat" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_DisplayFormat\- Convert a surface to the display format
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Surface *\fBSDL_DisplayFormat\fP\fR(\fBSDL_Surface *surface\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR
|
||||
.PP
|
||||
If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&.
|
||||
.PP
|
||||
If you want an alpha channel, see \fISDL_DisplayFormatAlpha\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
If the conversion fails or runs out of memory, it returns \fBNULL\fR
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_ConvertSurface\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR \fI\fBSDL_SetAlpha\fP\fR, \fI\fBSDL_SetColorKey\fP\fR, \fI\fBSDL_Surface\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
20
docs/man3/SDL_DisplayFormatAlpha.3
Normal file
20
docs/man3/SDL_DisplayFormatAlpha.3
Normal file
|
@ -0,0 +1,20 @@
|
|||
.TH "SDL_DisplayFormatAlpha" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_DisplayFormatAlpha\- Convert a surface to the display format
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Surface *\fBSDL_DisplayFormatAlpha\fP\fR(\fBSDL_Surface *surface\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function takes a surface and copies it to a new surface of the pixel format and colors of the video framebuffer plus an alpha channel, suitable for fast blitting onto the display surface\&. It calls \fISDL_ConvertSurface\fR
|
||||
.PP
|
||||
If you want to take advantage of hardware colorkey or alpha blit acceleration, you should set the colorkey and alpha value before calling this function\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
If the conversion fails or runs out of memory, it returns \fBNULL\fR
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fISDL_ConvertSurface\fR, \fISDL_SetAlpha\fR, \fISDL_SetColorKey\fR, \fISDL_DisplayFormat\fR, \fISDL_Surface\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_DisplayYUVOverlay.3
Normal file
15
docs/man3/SDL_DisplayYUVOverlay.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_DisplayYUVOverlay" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_DisplayYUVOverlay\- Blit the overlay to the display
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_DisplayYUVOverlay\fP\fR(\fBSDL_Overlay *overlay, SDL_Rect *dstrect\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Blit the \fBoverlay\fR to the surface specified when it was \fIcreated\fR\&. The \fI\fBSDL_Rect\fR\fR structure, \fBdstrect\fR, specifies the position and size of the destination\&. If the \fBdstrect\fR is a larger or smaller than the overlay then the overlay will be scaled, this is optimized for 2x scaling\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_CreateYUVOverlay\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
17
docs/man3/SDL_EnableKeyRepeat.3
Normal file
17
docs/man3/SDL_EnableKeyRepeat.3
Normal file
|
@ -0,0 +1,17 @@
|
|||
.TH "SDL_EnableKeyRepeat" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_EnableKeyRepeat\- Set keyboard repeat rate\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_EnableKeyRepeat\fP\fR(\fBint delay, int interval\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Enables or disables the keyboard repeat rate\&. \fBdelay\fR specifies how long the key must be pressed before it begins repeating, it then repeats at the speed specified by \fBinterval\fR\&. Both \fBdelay\fR and \fBinterval\fR are expressed in milliseconds\&.
|
||||
.PP
|
||||
Setting \fBdelay\fR to 0 disables key repeating completely\&. Good default values are \fBSDL_DEFAULT_REPEAT_DELAY\fP and \fISDL_DEFAULT_REPEAT_INTERVAL\fP\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success and \fB-1\fR on failure\&.
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
20
docs/man3/SDL_EnableUNICODE.3
Normal file
20
docs/man3/SDL_EnableUNICODE.3
Normal file
|
@ -0,0 +1,20 @@
|
|||
.TH "SDL_EnableUNICODE" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_EnableUNICODE\- Enable UNICODE translation
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_EnableUNICODE\fP\fR(\fBint enable\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Enables/Disables UNICODE keyboard translation\&.
|
||||
.PP
|
||||
If you wish to translate a keysym to it\&'s printable representation, you need to enable UNICODE translation using this function (\fBenable\fR=0) and then look in the \fBunicode\fR member of the \fI\fBSDL_keysym\fR\fR structure\&. This value will be zero for keysyms that do not have a printable representation\&. UNICODE translation is disabled by default as the conversion can cause a slight overhead\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns the previous translation mode\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_keysym\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
175
docs/man3/SDL_Event.3
Normal file
175
docs/man3/SDL_Event.3
Normal file
|
@ -0,0 +1,175 @@
|
|||
.TH "SDL_Event" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_Event\- General event structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef union{
|
||||
Uint8 type;
|
||||
SDL_ActiveEvent active;
|
||||
SDL_KeyboardEvent key;
|
||||
SDL_MouseMotionEvent motion;
|
||||
SDL_MouseButtonEvent button;
|
||||
SDL_JoyAxisEvent jaxis;
|
||||
SDL_JoyBallEvent jball;
|
||||
SDL_JoyHatEvent jhat;
|
||||
SDL_JoyButtonEvent jbutton;
|
||||
SDL_ResizeEvent resize;
|
||||
SDL_QuitEvent quit;
|
||||
SDL_UserEvent user;
|
||||
SDL_SywWMEvent syswm;
|
||||
} SDL_Event;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
The type of event
|
||||
.TP 20
|
||||
\fBactive\fR
|
||||
\fIActivation event\fR
|
||||
.TP 20
|
||||
\fBkey\fR
|
||||
\fIKeyboard event\fR
|
||||
.TP 20
|
||||
\fBmotion\fR
|
||||
\fIMouse motion event\fR
|
||||
.TP 20
|
||||
\fBbutton\fR
|
||||
\fIMouse button event\fR
|
||||
.TP 20
|
||||
\fBjaxis\fR
|
||||
\fIJoystick axis motion event\fR
|
||||
.TP 20
|
||||
\fBjball\fR
|
||||
\fIJoystick trackball motion event\fR
|
||||
.TP 20
|
||||
\fBjhat\fR
|
||||
\fIJoystick hat motion event\fR
|
||||
.TP 20
|
||||
\fBjbutton\fR
|
||||
\fIJoystick button event\fR
|
||||
.TP 20
|
||||
\fBresize\fR
|
||||
\fIApplication window resize event\fR
|
||||
.TP 20
|
||||
\fBquit\fR
|
||||
\fIApplication quit request event\fR
|
||||
.TP 20
|
||||
\fBuser\fR
|
||||
\fIUser defined event\fR
|
||||
.TP 20
|
||||
\fBsyswm\fR
|
||||
\fIUndefined window manager event\fR
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The \fBSDL_Event\fR union is the core to all event handling is SDL, its probably the most important structure after \fBSDL_Surface\fR\&. \fBSDL_Event\fR is a union of all event structures used in SDL, using it is a simple matter of knowing which union member relates to which event \fBtype\fR\&.
|
||||
.PP
|
||||
.TP 20
|
||||
\fBEvent \fBtype\fR\fR
|
||||
\fBEvent Structure\fR
|
||||
.TP 20
|
||||
\fBSDL_ACTIVEEVENT\fP
|
||||
\fI\fBSDL_ActiveEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_KEYDOWN/UP\fP
|
||||
\fI\fBSDL_KeyboardEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_MOUSEMOTION\fP
|
||||
\fI\fBSDL_MouseMotionEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_MOUSEBUTTONDOWN/UP\fP
|
||||
\fI\fBSDL_MouseButtonEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_JOYAXISMOTION\fP
|
||||
\fI\fBSDL_JoyAxisEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_JOYBALLMOTION\fP
|
||||
\fI\fBSDL_JoyBallEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_JOYHATMOTION\fP
|
||||
\fI\fBSDL_JoyHatEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_JOYBUTTONDOWN/UP\fP
|
||||
\fI\fBSDL_JoyButtonEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_QUIT\fP
|
||||
\fI\fBSDL_QuitEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_SYSWMEVENT\fP
|
||||
\fI\fBSDL_SysWMEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_VIDEORESIZE\fP
|
||||
\fI\fBSDL_ResizeEvent\fR\fR
|
||||
.TP 20
|
||||
\fBSDL_USEREVENT\fP
|
||||
\fI\fBSDL_UserEvent\fR\fR
|
||||
.SH "USE"
|
||||
.PP
|
||||
The \fBSDL_Event\fR structure has two uses
|
||||
.IP " \(bu" 6
|
||||
Reading events on the event queue
|
||||
.IP " \(bu" 6
|
||||
Placing events on the event queue
|
||||
.PP
|
||||
Reading events from the event queue is done with either \fI\fBSDL_PollEvent\fP\fR or \fI\fBSDL_PeepEvents\fP\fR\&. We\&'ll use \fBSDL_PollEvent\fP and step through an example\&.
|
||||
.PP
|
||||
First off, we create an empty \fBSDL_Event\fR structure\&.
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_Event test_event;\fR
|
||||
.fi
|
||||
.PP
|
||||
\fBSDL_PollEvent\fP removes the next event from the event queue, if there are no events on the queue it returns \fB0\fR otherwise it returns \fB1\fR\&. We use a \fBwhile\fP loop to process each event in turn\&.
|
||||
.PP
|
||||
.nf
|
||||
\f(CWwhile(SDL_PollEvent(&test_event)) {\fR
|
||||
.fi
|
||||
.PP
|
||||
The \fBSDL_PollEvent\fP function take a pointer to an \fBSDL_Event\fR structure that is to be filled with event information\&. We know that if \fBSDL_PollEvent\fP removes an event from the queue then the event information will be placed in our \fBtest_event\fR structure, but we also know that the \fItype\fP of event will be placed in the \fBtype\fR member of \fBtest_event\fR\&. So to handle each event \fBtype\fR seperately we use a \fBswitch\fP statement\&.
|
||||
.PP
|
||||
.nf
|
||||
\f(CW switch(test_event\&.type) {\fR
|
||||
.fi
|
||||
.PP
|
||||
We need to know what kind of events we\&'re looking for \fIand\fP the event \fBtype\fR\&'s of those events\&. So lets assume we want to detect where the user is moving the mouse pointer within our application\&. We look through our event types and notice that \fBSDL_MOUSEMOTION\fP is, more than likely, the event we\&'re looking for\&. A little \fImore\fR research tells use that \fBSDL_MOUSEMOTION\fP events are handled within the \fI\fBSDL_MouseMotionEvent\fR\fR structure which is the \fBmotion\fR member of \fBSDL_Event\fR\&. We can check for the \fBSDL_MOUSEMOTION\fP event \fBtype\fR within our \fBswitch\fP statement like so:
|
||||
.PP
|
||||
.nf
|
||||
\f(CW case SDL_MOUSEMOTION:\fR
|
||||
.fi
|
||||
.PP
|
||||
All we need do now is read the information out of the \fBmotion\fR member of \fBtest_event\fR\&.
|
||||
.PP
|
||||
.nf
|
||||
\f(CW printf("We got a motion event\&.
|
||||
");
|
||||
printf("Current mouse position is: (%d, %d)
|
||||
", test_event\&.motion\&.x, test_event\&.motion\&.y);
|
||||
break;
|
||||
default:
|
||||
printf("Unhandled Event!
|
||||
");
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("Event queue empty\&.
|
||||
");\fR
|
||||
.fi
|
||||
.PP
|
||||
.PP
|
||||
It is also possible to push events onto the event queue and so use it as a two-way communication path\&. Both \fI\fBSDL_PushEvent\fP\fR and \fI\fBSDL_PeepEvents\fP\fR allow you to place events onto the event queue\&. This is usually used to place a \fBSDL_USEREVENT\fP on the event queue, however you could use it to post fake input events if you wished\&. Creating your own events is a simple matter of choosing the event type you want, setting the \fBtype\fR member and filling the appropriate member structure with information\&.
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_Event user_event;
|
||||
|
||||
user_event\&.type=SDL_USEREVENT;
|
||||
user_event\&.user\&.code=2;
|
||||
user_event\&.user\&.data1=NULL;
|
||||
user_event\&.user\&.data2=NULL;
|
||||
SDL_PushEvent(&user_event);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_PollEvent\fP\fR, \fI\fBSDL_PushEvent\fP\fR, \fI\fBSDL_PeepEvents\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
23
docs/man3/SDL_EventState.3
Normal file
23
docs/man3/SDL_EventState.3
Normal file
|
@ -0,0 +1,23 @@
|
|||
.TH "SDL_EventState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_EventState\- This function allows you to set the state of processing certain events\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 \fBSDL_EventState\fP\fR(\fBUint8 type, int state\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function allows you to set the state of processing certain event \fBtype\fR\&'s\&.
|
||||
.PP
|
||||
If \fBstate\fR is set to \fBSDL_IGNORE\fP, that event \fBtype\fR will be automatically dropped from the event queue and will not be filtered\&.
|
||||
.PP
|
||||
If \fBstate\fR is set to \fBSDL_ENABLE\fP, that event \fBtype\fR will be processed normally\&.
|
||||
.PP
|
||||
If \fBstate\fR is set to \fBSDL_QUERY\fP, \fBSDL_EventState\fP will return the current processing state of the specified event \fBtype\fR\&.
|
||||
.PP
|
||||
A list of event \fBtype\fR\&'s can be found in the \fI\fBSDL_Event\fR\fR section\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
22
docs/man3/SDL_FillRect.3
Normal file
22
docs/man3/SDL_FillRect.3
Normal file
|
@ -0,0 +1,22 @@
|
|||
.TH "SDL_FillRect" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_FillRect\- This function performs a fast fill of the given rectangle with some color
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_FillRect\fP\fR(\fBSDL_Surface *dst, SDL_Rect *dstrect, Uint32 color\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function performs a fast fill of the given rectangle with \fBcolor\fR\&. If \fBdstrect\fR is \fBNULL\fP, the whole surface will be filled with \fBcolor\fR\&.
|
||||
.PP
|
||||
The color should be a pixel of the format used by the surface, and can be generated by the \fISDL_MapRGB\fR function\&.
|
||||
.PP
|
||||
If there is a clip rectangle set on the destination (set via \fISDL_SetClipRect\fR) then this function will clip based on the intersection of the clip rectangle and the \fBdstrect\fR rectangle\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
This function returns \fB0\fR on success, or \fB-1\fR on error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Rect\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
20
docs/man3/SDL_Flip.3
Normal file
20
docs/man3/SDL_Flip.3
Normal file
|
@ -0,0 +1,20 @@
|
|||
.TH "SDL_Flip" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_Flip\- Swaps screen buffers
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_Flip\fP\fR(\fBSDL_Surface *screen\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
On hardware that supports double-buffering, this function sets up a flip and returns\&. The hardware will wait for vertical retrace, and then swap video buffers before the next video surface blit or lock will return\&. On hardware that doesn\&'t support double-buffering, this is equivalent to calling \fISDL_UpdateRect\fR\fB(screen, 0, 0, 0, 0)\fR
|
||||
.PP
|
||||
The \fBSDL_DOUBLEBUF\fP flag must have been passed to \fISDL_SetVideoMode\fR, when setting the video mode for this function to perform hardware flipping\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
This function returns \fB0\fR if successful, or \fB-1\fR if there was an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_UpdateRect\fP\fR, \fI\fBSDL_Surface\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_FreeCursor.3
Normal file
15
docs/man3/SDL_FreeCursor.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_FreeCursor" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_FreeCursor\- Frees a cursor created with SDL_CreateCursor\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_FreeCursor\fP\fR(\fBSDL_Cursor *cursor\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Frees a \fBSDL_Cursor\fR that was created using \fISDL_CreateCursor\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fISDL_CreateCursor\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_FreeSurface.3
Normal file
15
docs/man3/SDL_FreeSurface.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_FreeSurface" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_FreeSurface\- Frees (deletes) and SDL_Surface
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_FreeSurface\fP\fR(\fBSDL_Surface *surface\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Frees the resources used by a previously created \fBSDL_Surface\fR\&. If the surface was created using \fISDL_CreateRGBSurfaceFrom\fR then the pixel data is not freed\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_CreateRGBSurface\fP\fR \fI\fBSDL_CreateRGBSurfaceFrom\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_FreeWAV.3
Normal file
15
docs/man3/SDL_FreeWAV.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_FreeWAV" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_FreeWAV\- Frees previously opened WAV data
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_FreeWAV\fP\fR(\fBUint8 *audio_buf\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
After a WAVE file has been opened with \fI\fBSDL_LoadWAV\fP\fR its data can eventually be freed with \fBSDL_FreeWAV\fP\&. \fBaudio_buf\fR is a pointer to the buffer created by \fBSDL_LoadWAV\fP\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_LoadWAV\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
15
docs/man3/SDL_FreeYUVOverlay.3
Normal file
15
docs/man3/SDL_FreeYUVOverlay.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_FreeYUVOverlay" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_FreeYUVOverlay\- Free a YUV video overlay
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_FreeYUVOverlay\fP\fR(\fBSDL_Overlay *overlay\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Frees and \fI\fBoverlay\fR\fR created by \fI\fBSDL_CreateYUVOverlay\fP\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Overlay\fR\fR, \fI\fBSDL_DisplayYUVOverlay\fP\fR, \fI\fBSDL_FreeYUVOverlay\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
18
docs/man3/SDL_GL_GetAttribute.3
Normal file
18
docs/man3/SDL_GL_GetAttribute.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_GL_GetAttribute" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GL_GetAttribute\- Get the value of a special SDL/OpenGL attribute
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_GL_GetAttribute\fP\fR(\fBSDLGLattr attr, int *value\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Places the value of the SDL/OpenGL \fIattribute\fR \fBattr\fR into \fBvalue\fR\&. This is useful after a call to \fI\fBSDL_SetVideoMode\fP\fR to check whether your attributes have been \fIset\fR as you expected\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on an error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GL_SetAttribute\fP\fR, \fIGL Attributes\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
48
docs/man3/SDL_GL_GetProcAddress.3
Normal file
48
docs/man3/SDL_GL_GetProcAddress.3
Normal file
|
@ -0,0 +1,48 @@
|
|||
.TH "SDL_GL_GetProcAddress" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GL_GetProcAddress\- Get the address of a GL function
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid *\fBSDL_GL_GetProcAddress\fP\fR(\fBconst char* proc\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the address of the GL function \fBproc\fR, or \fBNULL\fR if the function is not found\&. If the GL library is loaded at runtime, with \fI\fBSDL_GL_LoadLibrary\fP\fR, then \fIall\fP GL functions must be retrieved this way\&. Usually this is used to retrieve function pointers to OpenGL extensions\&.
|
||||
.SH "EXAMPLE"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef void (*GL_ActiveTextureARB_Func)(unsigned int);
|
||||
GL_ActiveTextureARB_Func glActiveTextureARB_ptr = 0;
|
||||
int has_multitexture=1;
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
/* Get function pointer */
|
||||
glActiveTextureARB_ptr=(GL_ActiveTextureARB_Func) SDL_GL_GetProcAddress("glActiveTextureARB");
|
||||
|
||||
/* Check for a valid function ptr */
|
||||
if(!glActiveTextureARB_ptr){
|
||||
fprintf(stderr, "Multitexture Extensions not present\&.
|
||||
");
|
||||
has_multitexture=0;
|
||||
}
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
if(has_multitexture){
|
||||
glActiveTextureARB_ptr(GL_TEXTURE0_ARB);
|
||||
\&.
|
||||
\&.
|
||||
}
|
||||
else{
|
||||
\&.
|
||||
\&.
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GL_LoadLibrary\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GL_LoadLibrary.3
Normal file
15
docs/man3/SDL_GL_LoadLibrary.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GL_LoadLibrary" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GL_LoadLibrary\- Specify an OpenGL library
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_GL_LoadLibrary\fP\fR(\fBconst char *path\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
If you wish, you may load the OpenGL library at runtime, this must be done before \fI\fBSDL_SetVideoMode\fP\fR is called\&. The \fBpath\fR of the GL library is passed to \fBSDL_GL_LoadLibrary\fP and it returns \fB0\fR on success, or \fB-1\fR on an error\&. You must then use \fI\fBSDL_GL_GetProcAddress\fP\fR to retrieve function pointers to GL functions\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GL_GetProcAddress\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
40
docs/man3/SDL_GL_SetAttribute.3
Normal file
40
docs/man3/SDL_GL_SetAttribute.3
Normal file
|
@ -0,0 +1,40 @@
|
|||
.TH "SDL_GL_SetAttribute" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GL_SetAttribute\- Set a special SDL/OpenGL attribute
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_GL_SetAttribute\fP\fR(\fBSDL_GLattr attr, int value\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Sets the OpenGL \fIattribute\fR \fBattr\fR to \fBvalue\fR\&. The attributes you set don\&'t take effect until after a call to \fI\fBSDL_SetVideoMode\fP\fR\&. You should use \fI\fBSDL_GL_GetAttribute\fP\fR to check the values after a \fBSDL_SetVideoMode\fP call\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success, or \fB-1\fR on error\&.
|
||||
.SH "EXAMPLE"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
|
||||
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
|
||||
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
|
||||
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
|
||||
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
|
||||
if ( (screen=SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL )) == NULL ) {
|
||||
fprintf(stderr, "Couldn\&'t set GL mode: %s
|
||||
", SDL_GetError());
|
||||
SDL_Quit();
|
||||
return;
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
The \fBSDL_DOUBLEBUF\fP flag is not required to enable double buffering when setting an OpenGL video mode\&. Double buffering is enabled or disabled using the SDL_GL_DOUBLEBUFFER attribute\&.
|
||||
.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GL_GetAttribute\fP\fR, \fIGL Attributes\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GL_SwapBuffers.3
Normal file
15
docs/man3/SDL_GL_SwapBuffers.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GL_SwapBuffers" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GL_SwapBuffers\- Swap OpenGL framebuffers/Update Display
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_GL_SwapBuffers\fP\fR(\fBvoid \fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Swap the OpenGL buffers, if double-buffering is supported\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_GL_SetAttribute\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
47
docs/man3/SDL_GLattr.3
Normal file
47
docs/man3/SDL_GLattr.3
Normal file
|
@ -0,0 +1,47 @@
|
|||
.TH "SDL_GLattr" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GLattr\- SDL GL Attributes
|
||||
.SH "ATTRIBUTES"
|
||||
.TP 20
|
||||
\fBSDL_GL_RED_SIZE\fP
|
||||
Size of the framebuffer red component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_GREEN_SIZE\fP
|
||||
Size of the framebuffer green component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_BLUE_SIZE\fP
|
||||
Size of the framebuffer blue component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_ALPHA_SIZE\fP
|
||||
Size of the framebuffer alpha component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_DOUBLEBUFFER\fP
|
||||
0 or 1, enable or disable double buffering
|
||||
.TP 20
|
||||
\fBSDL_GL_BUFFER_SIZE\fP
|
||||
Size of the framebuffer, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_DEPTH_SIZE\fP
|
||||
Size of the depth buffer, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_STENCIL_SIZE\fP
|
||||
Size of the stencil buffer, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_ACCUM_RED_SIZE\fP
|
||||
Size of the accumulation buffer red component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_ACCUM_GREEN_SIZE\fP
|
||||
Size of the accumulation buffer green component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_ACCUM_BLUE_SIZE\fP
|
||||
Size of the accumulation buffer blue component, in bits
|
||||
.TP 20
|
||||
\fBSDL_GL_ACCUM_ALPHA_SIZE\fP
|
||||
Size of the accumulation buffer alpha component, in bits
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
While you can set most OpenGL attributes normally, the attributes list above must be known \fIbefore\fP SDL sets the video mode\&. These attributes a set and read with \fI\fBSDL_GL_SetAttribute\fP\fR and \fI\fBSDL_GL_GetAttribute\fP\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GL_SetAttribute\fP\fR, \fI\fBSDL_GL_GetAttribute\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
24
docs/man3/SDL_GetAppState.3
Normal file
24
docs/man3/SDL_GetAppState.3
Normal file
|
@ -0,0 +1,24 @@
|
|||
.TH "SDL_GetAppState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
\fBSDL_GetAppState\fP\- Get the state of the application
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 \fBSDL_GetAppState\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function returns the current state of the application\&. The value returned is a bitwise combination of:
|
||||
.TP 20
|
||||
\fBSDL_APPMOUSEFOCUS\fP
|
||||
The application has mouse focus\&.
|
||||
.TP 20
|
||||
\fBSDL_APPINPUTFOCUS\fP
|
||||
The application has keyboard focus
|
||||
.TP 20
|
||||
\fBSDL_APPACTIVE\fP
|
||||
The application is visible
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_ActiveEvent\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
24
docs/man3/SDL_GetAudioStatus.3
Normal file
24
docs/man3/SDL_GetAudioStatus.3
Normal file
|
@ -0,0 +1,24 @@
|
|||
.TH "SDL_GetAudioStatus" "3" "Mon 12 Mar 2001, 01:02" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetAudioStatus\- Get the current audio state
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_audiostatus\fBSDL_GetAudioStatus\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef enum{
|
||||
SDL_AUDIO_STOPPED,
|
||||
SDL_AUDIO_PAUSED,
|
||||
SDL_AUDIO_PLAYING
|
||||
} SDL_audiostatus;\fR
|
||||
.fi
|
||||
.PP
|
||||
.PP
|
||||
Returns either \fBSDL_AUDIO_STOPPED\fP, \fBSDL_AUDIO_PAUSED\fP or \fBSDL_AUDIO_PLAYING\fP depending on the current audio state\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_PauseAudio\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:02
|
17
docs/man3/SDL_GetClipRect.3
Normal file
17
docs/man3/SDL_GetClipRect.3
Normal file
|
@ -0,0 +1,17 @@
|
|||
.TH "SDL_GetClipRect" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetClipRect\- Gets the clipping rectangle for a surface\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_GetClipRect\fP\fR(\fBSDL_Surface *surface, SDL_Rect *rect\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Gets the clipping rectangle for a surface\&. When this surface is the destination of a blit, only the area within the clip rectangle is drawn into\&.
|
||||
.PP
|
||||
The rectangle pointed to by \fBrect\fR will be filled with the clipping rectangle of the surface\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_SetClipRect\fP\fR, \fI\fBSDL_BlitSurface\fP\fR, \fI\fBSDL_Surface\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GetCursor.3
Normal file
15
docs/man3/SDL_GetCursor.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GetCursor" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetCursor\- Get the currently active mouse cursor\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Cursor *\fBSDL_GetCursor\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the currently active mouse cursor\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_CreateCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
23
docs/man3/SDL_GetEventFilter.3
Normal file
23
docs/man3/SDL_GetEventFilter.3
Normal file
|
@ -0,0 +1,23 @@
|
|||
.TH "SDL_GetEventFilter" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetEventFilter\- Retrieves a pointer to he event filter
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_EventFilter \fBSDL_GetEventFilter\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function retrieces a pointer to the event filter that was previously set using \fI\fBSDL_SetEventFilter\fP\fR\&. An SDL_EventFilter function is defined as:
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef int (*SDL_EventFilter)(const SDL_Event *event);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns a pointer to the event filter or \fBNULL\fP if no filter has been set\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR, \fI\fBSDL_SetEventFilter\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
21
docs/man3/SDL_GetGamma.3
Normal file
21
docs/man3/SDL_GetGamma.3
Normal file
|
@ -0,0 +1,21 @@
|
|||
.TH "SDL_GetGamma" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetGamma\- Gets the gamma of the display
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_GetGamma\fP\fR(\fBfloat *red, float *green, float *blue\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Gets the color gamma of the display\&. The gamma value for each color component will be place in the parameters \fBred\fR, \fBgreen\fR and \fBblue\fR\&. The values can range from 0\&.1 to 10\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
This function currently only works on XFreee 4\&.0 and up\&.
|
||||
.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_SetGamma\fP\fR, \fI\fBSDL_SetVideoMode\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
20
docs/man3/SDL_GetGammaRamp.3
Normal file
20
docs/man3/SDL_GetGammaRamp.3
Normal file
|
@ -0,0 +1,20 @@
|
|||
.TH "SDL_GetGammaRamp" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetGammaRamp\- Gets the color gamma lookup tables for the display
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_GetGammaRamp\fP\fR(\fBUint16 *redtable, Uint16 *greentable, Uint16 *bluetable\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Gets the gamma translation lookup tables currently used by the display\&. Each table is an array of 256 Uint16 values\&.
|
||||
.PP
|
||||
Not all display hardware is able to change gamma\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns -1 on error\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fISDL_SetGamma\fR \fISDL_SetGammaRamp\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GetKeyName.3
Normal file
15
docs/man3/SDL_GetKeyName.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GetKeyName" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetKeyName\- Get the name of an SDL virtual keysym
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBchar *\fBSDL_GetKeyName\fP\fR(\fBSDLKey key\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the SDL-defined name of the \fI\fBSDLKey\fR\fR \fBkey\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDLKey\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
30
docs/man3/SDL_GetKeyState.3
Normal file
30
docs/man3/SDL_GetKeyState.3
Normal file
|
@ -0,0 +1,30 @@
|
|||
.TH "SDL_GetKeyState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetKeyState\- Get a snapshot of the current keyboard state
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 *\fBSDL_GetKeyState\fP\fR(\fBint *numkeys\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Gets a snapshot of the current keyboard state\&. The current state is return as a pointer to an array, the size of this array is stored in \fBnumkeys\fR\&. The array is indexed by the \fI\fBSDLK_*\fP\fR symbols\&. A value of 1 means the key is pressed and a value of 0 means its not\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
Use \fI\fBSDL_PumpEvents\fP\fR to update the state array\&.
|
||||
.RE
|
||||
.SH "EXAMPLE"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWUint8 *keystate = SDL_GetKeyState(NULL);
|
||||
if ( keystate[SDLK_RETURN] ) printf("Return Key Pressed\&.
|
||||
");\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL Key Symbols\fP\fR, \fI\fBSDL_PumpEvents\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
54
docs/man3/SDL_GetModState.3
Normal file
54
docs/man3/SDL_GetModState.3
Normal file
|
@ -0,0 +1,54 @@
|
|||
.TH "SDL_GetModState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetModState\- Get the state of modifier keys\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDLMod \fBSDL_GetModState\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the current of the modifier keys (CTRL, ALT, etc\&.)\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
The return value can be an OR\&'d combination of the SDLMod enum\&.
|
||||
.PP
|
||||
.PP
|
||||
.RS
|
||||
\fBSDLMod\fR
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef enum {
|
||||
KMOD_NONE = 0x0000,
|
||||
KMOD_LSHIFT= 0x0001,
|
||||
KMOD_RSHIFT= 0x0002,
|
||||
KMOD_LCTRL = 0x0040,
|
||||
KMOD_RCTRL = 0x0080,
|
||||
KMOD_LALT = 0x0100,
|
||||
KMOD_RALT = 0x0200,
|
||||
KMOD_LMETA = 0x0400,
|
||||
KMOD_RMETA = 0x0800,
|
||||
KMOD_NUM = 0x1000,
|
||||
KMOD_CAPS = 0x2000,
|
||||
KMOD_MODE = 0x4000,
|
||||
} SDLMod;\fR
|
||||
.fi
|
||||
.PP
|
||||
.RE
|
||||
SDL also defines the following symbols for convenience:
|
||||
.PP
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
\f(CW#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL)
|
||||
#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT)
|
||||
#define KMOD_ALT (KMOD_LALT|KMOD_RALT)
|
||||
#define KMOD_META (KMOD_LMETA|KMOD_RMETA)\fR
|
||||
.fi
|
||||
.PP
|
||||
.RE
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GetKeyState\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
24
docs/man3/SDL_GetMouseState.3
Normal file
24
docs/man3/SDL_GetMouseState.3
Normal file
|
@ -0,0 +1,24 @@
|
|||
.TH "SDL_GetMouseState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetMouseState\- Retrieve the current state of the mouse
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 \fBSDL_GetMouseState\fP\fR(\fBint *x, int *y\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the current mouse cursor position\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&.
|
||||
.SH "EXAMPLE"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_PumpEvents();
|
||||
if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(1))
|
||||
printf("Mouse Button 1(left) is pressed\&.
|
||||
");\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GetRelativeMouseState\fP\fR, \fI\fBSDL_PumpEvents\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
17
docs/man3/SDL_GetRGB.3
Normal file
17
docs/man3/SDL_GetRGB.3
Normal file
|
@ -0,0 +1,17 @@
|
|||
.TH "SDL_GetRGB" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetRGB\- Get RGB values from a pixel in the specified pixel format\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_GetRGB\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Get RGB component values from a pixel stored in the specified pixel format\&.
|
||||
.PP
|
||||
This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_MapRGB\fP\fR, \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_PixelFormat\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
19
docs/man3/SDL_GetRGBA.3
Normal file
19
docs/man3/SDL_GetRGBA.3
Normal file
|
@ -0,0 +1,19 @@
|
|||
.TH "SDL_GetRGBA" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetRGBA\- Get RGBA values from a pixel in the specified pixel format\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_GetRGBA\fP\fR(\fBUint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Get RGBA component values from a pixel stored in the specified pixel format\&.
|
||||
.PP
|
||||
This function uses the entire 8-bit [0\&.\&.255] range when converting color components from pixel formats with less than 8-bits per RGB component (e\&.g\&., a completely white pixel in 16-bit RGB565 format would return [0xff, 0xff, 0xff] not [0xf8, 0xfc, 0xf8])\&.
|
||||
.PP
|
||||
If the surface has no alpha component, the alpha will be returned as 0xff (100% opaque)\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fISDL_GetRGB\fR, \fISDL_MapRGB\fR, \fISDL_MapRGBA\fR, \fISDL_PixelFormat\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GetRelativeMouseState.3
Normal file
15
docs/man3/SDL_GetRelativeMouseState.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GetRelativeMouseState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetRelativeMouseState\- Retrieve the current state of the mouse
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 \fBSDL_GetRelativeMouseState\fP\fR(\fBint *x, int *y\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
The current button state is returned as a button bitmask, which can be tested using the \fBSDL_BUTTON(X)\fP macros, and \fBx\fR and \fBy\fR are set to the change in the mouse position since the last call to \fBSDL_GetRelativeMouseState\fP or since event initialization\&. You can pass \fBNULL\fP for either \fBx\fR or \fBy\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_GetMouseState\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
16
docs/man3/SDL_GetThreadID.3
Normal file
16
docs/man3/SDL_GetThreadID.3
Normal file
|
@ -0,0 +1,16 @@
|
|||
.TH "SDL_GetThreadID" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetThreadID\- Get the SDL thread ID of a SDL_Thread
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
#include "SDL_thread\&.h"
|
||||
.sp
|
||||
\fBUint32 \fBSDL_GetThreadID\fP\fR(\fBSDL_Thread *thread\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the ID of a \fBSDL_Thread\fR created by \fISDL_CreateThread\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fISDL_CreateThread\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GetTicks.3
Normal file
15
docs/man3/SDL_GetTicks.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GetTicks" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetTicks\- Get the number of milliseconds since the SDL library initialization\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint32 \fBSDL_GetTicks\fP\fR(\fBvoid\fR)
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Get the number of milliseconds since the SDL library initialization\&. Note that this value wraps if the program runs for more than ~49 days\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Delay\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GetVideoInfo.3
Normal file
15
docs/man3/SDL_GetVideoInfo.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GetVideoInfo" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetVideoInfo\- returns a pointer to information about the video hardware
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_VideoInfo *\fBSDL_GetVideoInfo\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function returns a read-only pointer to \fIinformation\fR about the video hardware\&. If this is called before \fISDL_SetVideoMode\fR, the \fBvfmt\fR member of the returned structure will contain the pixel format of the "best" video mode\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_SetVideoMode\fP\fR, \fI\fBSDL_VideoInfo\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
15
docs/man3/SDL_GetVideoSurface.3
Normal file
15
docs/man3/SDL_GetVideoSurface.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_GetVideoSurface" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_GetVideoSurface\- returns a pointer to the current display surface
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Surface *\fBSDL_GetVideoSurface\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function returns a pointer to the current display surface\&. If SDL is doing format conversion on the display surface, this function returns the publicly visible surface, not the real video surface\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Surface\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04
|
41
docs/man3/SDL_Init.3
Normal file
41
docs/man3/SDL_Init.3
Normal file
|
@ -0,0 +1,41 @@
|
|||
.TH "SDL_Init" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_Init\- Initializes SDL
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_Init\fP\fR(\fBUint32 flags\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Initializes SDL\&. This should be called before all other SDL functions\&. The \fBflags\fR parameter specifies what part(s) of SDL to initialize\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_TIMER\fP
|
||||
Initializes the \fItimer\fR subsystem\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_AUDIO\fP
|
||||
Initializes the \fIaudio\fR subsystem\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_VIDEO\fP
|
||||
Initializes the \fIvideo\fR subsystem\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_CDROM\fP
|
||||
Initializes the \fIcdrom\fR subsystem\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_JOYSTICK\fP
|
||||
Initializes the \fIjoystick\fR subsystem\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_EVERYTHING\fP
|
||||
Initialize all of the above\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_NOPARACHUTE\fP
|
||||
Prevents SDL from catching fatal signals\&.
|
||||
.TP 20
|
||||
\fBSDL_INIT_EVENTTHREAD\fP
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB-1\fR on an error or \fB0\fR on success\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Quit\fP\fR, \fI\fBSDL_InitSubSystem\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
41
docs/man3/SDL_InitSubSystem.3
Normal file
41
docs/man3/SDL_InitSubSystem.3
Normal file
|
@ -0,0 +1,41 @@
|
|||
.TH "SDL_InitSubSystem" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_InitSubSystem\- Initialize subsystems
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_InitSubSystem\fP\fR(\fBUint32 flags\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
After SDL has been initialized with \fI\fBSDL_Init\fP\fR you may initialize uninitialized subsystems with \fBSDL_InitSubSystem\fP\&. The \fBflags\fR parameter is the same as that used in \fI\fBSDL_Init\fP\fR\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.nf
|
||||
\f(CW/* Seperating Joystick and Video initialization\&. */
|
||||
SDL_Init(SDL_INIT_VIDEO);
|
||||
\&.
|
||||
\&.
|
||||
SDL_SetVideoMode(640, 480, 16, SDL_DOUBLEBUF|SDL_FULLSCREEN);
|
||||
\&.
|
||||
/* Do Some Video stuff */
|
||||
\&.
|
||||
\&.
|
||||
/* Initialize the joystick subsystem */
|
||||
SDL_InitSubSystem(SDL_INIT_JOYSTICK);
|
||||
|
||||
/* Do some stuff with video and joystick */
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
/* Shut them both down */
|
||||
SDL_Quit();\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB-1\fR on an error or \fB0\fR on success\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Init\fP\fR, \fI\fBSDL_Quit\fP\fR, \fI\fBSDL_QuitSubSystem\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
36
docs/man3/SDL_JoyAxisEvent.3
Normal file
36
docs/man3/SDL_JoyAxisEvent.3
Normal file
|
@ -0,0 +1,36 @@
|
|||
.TH "SDL_JoyAxisEvent" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoyAxisEvent\- Joystick axis motion event structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 type;
|
||||
Uint8 which;
|
||||
Uint8 axis;
|
||||
Sint16 value;
|
||||
} SDL_JoyAxisEvent;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
\fBSDL_JOYAXISMOTION\fP
|
||||
.TP 20
|
||||
\fBwhich\fR
|
||||
Joystick device index
|
||||
.TP 20
|
||||
\fBaxis\fR
|
||||
Joystick axis index
|
||||
.TP 20
|
||||
\fBvalue\fR
|
||||
Axis value (range: -32768 to 32767)
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_JoyAxisEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYAXISMOTION\fP is reported\&.
|
||||
.PP
|
||||
A \fBSDL_JOYAXISMOTION\fP event occurs when ever a user moves an axis on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBaxis\fR is the index of the axis (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the axis\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetAxis\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
36
docs/man3/SDL_JoyBallEvent.3
Normal file
36
docs/man3/SDL_JoyBallEvent.3
Normal file
|
@ -0,0 +1,36 @@
|
|||
.TH "SDL_JoyBallEvent" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoyBallEvent\- Joystick trackball motion event structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 type;
|
||||
Uint8 which;
|
||||
Uint8 ball;
|
||||
Sint16 xrel, yrel;
|
||||
} SDL_JoyBallEvent;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
\fBSDL_JOYBALLMOTION\fP
|
||||
.TP 20
|
||||
\fBwhich\fR
|
||||
Joystick device index
|
||||
.TP 20
|
||||
\fBball\fR
|
||||
Joystick trackball index
|
||||
.TP 20
|
||||
\fBxrel\fR, \fByrel\fR
|
||||
The relative motion in the X/Y direction
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_JoyBallEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBALLMOTION\fP is reported\&.
|
||||
.PP
|
||||
A \fBSDL_JOYBALLMOTION\fP event occurs when a user moves a trackball on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBball\fR is the index of the trackball (for a more detailed explaination see the \fIJoystick section\fR)\&. Trackballs only return relative motion, this is the change in position on the ball since it was last polled (last cycle of the event loop) and it is stored in \fBxrel\fR and \fByrel\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetBall\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
36
docs/man3/SDL_JoyButtonEvent.3
Normal file
36
docs/man3/SDL_JoyButtonEvent.3
Normal file
|
@ -0,0 +1,36 @@
|
|||
.TH "SDL_JoyButtonEvent" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoyButtonEvent\- Joystick button event structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 type;
|
||||
Uint8 which;
|
||||
Uint8 button;
|
||||
Uint8 state;
|
||||
} SDL_JoyButtonEvent;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
\fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP
|
||||
.TP 20
|
||||
\fBwhich\fR
|
||||
Joystick device index
|
||||
.TP 20
|
||||
\fBbutton\fR
|
||||
Joystick button index
|
||||
.TP 20
|
||||
\fBstate\fR
|
||||
\fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_JoyButtonEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP is reported\&.
|
||||
.PP
|
||||
A \fBSDL_JOYBUTTONDOWN\fP or \fBSDL_JOYBUTTONUP\fP event occurs when ever a user presses or releases a button on a joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBbutton\fR is the index of the button (for a more detailed explaination see the \fIJoystick section\fR)\&. \fBstate\fR is the current state or the button which is either \fBSDL_PRESSED\fP or \fBSDL_RELEASED\fP\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetButton\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
56
docs/man3/SDL_JoyHatEvent.3
Normal file
56
docs/man3/SDL_JoyHatEvent.3
Normal file
|
@ -0,0 +1,56 @@
|
|||
.TH "SDL_JoyHatEvent" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoyHatEvent\- Joystick hat position change event structure
|
||||
.SH "STRUCTURE DEFINITION"
|
||||
.PP
|
||||
.nf
|
||||
\f(CWtypedef struct{
|
||||
Uint8 type;
|
||||
Uint8 which;
|
||||
Uint8 hat;
|
||||
Uint8 value;
|
||||
} SDL_JoyHatEvent;\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "STRUCTURE DATA"
|
||||
.TP 20
|
||||
\fBtype\fR
|
||||
\fBSDL_JOY\fP
|
||||
.TP 20
|
||||
\fBwhich\fR
|
||||
Joystick device index
|
||||
.TP 20
|
||||
\fBhat\fR
|
||||
Joystick hat index
|
||||
.TP 20
|
||||
\fBvalue\fR
|
||||
Hat position
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_JoyHatEvent\fR is a member of the \fI\fBSDL_Event\fR\fR union and is used when an event of type \fBSDL_JOYHATMOTION\fP is reported\&.
|
||||
.PP
|
||||
A \fBSDL_JOYHATMOTION\fP event occurs when ever a user moves a hat on the joystick\&. The field \fBwhich\fR is the index of the joystick that reported the event and \fBhat\fR is the index of the hat (for a more detailed exlaination see the \fIJoystick section\fR)\&. \fBvalue\fR is the current position of the hat\&. It is a logically OR\&'d combination of the following values (whose meanings should be pretty obvious:) :
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_CENTERED\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_UP\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_RIGHT\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_DOWN\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_LEFT\fP
|
||||
.PP
|
||||
The following defines are also provided:
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_RIGHTUP\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_RIGHTDOWN\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_LEFTUP\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_LEFTDOWN\fP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_Event\fR\fR, \fIJoystick Functions\fR, \fI\fBSDL_JoystickEventState\fP\fR, \fI\fBSDL_JoystickGetHat\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
15
docs/man3/SDL_JoystickClose.3
Normal file
15
docs/man3/SDL_JoystickClose.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_JoystickClose" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickClose\- Closes a previously opened joystick
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_JoystickClose\fP\fR(\fBSDL_Joystick *joystick\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Close a \fBjoystick\fR that was previously opened with \fI\fBSDL_JoystickOpen\fP\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickOpened\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
24
docs/man3/SDL_JoystickEventState.3
Normal file
24
docs/man3/SDL_JoystickEventState.3
Normal file
|
@ -0,0 +1,24 @@
|
|||
.TH "SDL_JoystickEventState" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickEventState\- Enable/disable joystick event polling
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickEventState\fP\fR(\fBint state\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
This function is used to enable or disable joystick event processing\&. With joystick event processing disabled you will have to update joystick states with \fI\fBSDL_JoystickUpdate\fP\fR and read the joystick information manually\&. \fBstate\fR is either \fBSDL_QUERY\fP, \fBSDL_ENABLE\fP or \fBSDL_IGNORE\fP\&.
|
||||
.PP
|
||||
.RS
|
||||
\fBNote:
|
||||
.PP
|
||||
Joystick event handling is prefered
|
||||
.RE
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
If \fBstate\fR is \fBSDL_QUERY\fP then the current state is returned, otherwise the new processing \fBstate\fR is returned\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fISDL Joystick Functions\fR, \fI\fBSDL_JoystickUpdate\fP\fR, \fI\fBSDL_JoyAxisEvent\fR\fR, \fI\fBSDL_JoyBallEvent\fR\fR, \fI\fBSDL_JoyButtonEvent\fR\fR, \fI\fBSDL_JoyHatEvent\fR\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
32
docs/man3/SDL_JoystickGetAxis.3
Normal file
32
docs/man3/SDL_JoystickGetAxis.3
Normal file
|
@ -0,0 +1,32 @@
|
|||
.TH "SDL_JoystickGetAxis" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickGetAxis\- Get the current state of an axis
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSint16 \fBSDL_JoystickGetAxis\fP\fR(\fBSDL_Joystick *joystick, int axis\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
\fBSDL_JoystickGetAxis\fP returns the current state of the given \fBaxis\fR on the given \fBjoystick\fR\&.
|
||||
.PP
|
||||
On most modern joysticks the X axis is usually represented by \fBaxis\fR 0 and the Y axis by \fBaxis\fR 1\&. The value returned by \fBSDL_JoystickGetAxis\fP is a signed integer (-32768 to 32768) representing the current position of the \fBaxis\fR, it maybe necessary to impose certain tolerances on these values to account for jitter\&. It is worth noting that some joysticks use axes 2 and 3 for extra buttons\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns a 16-bit signed integer representing the current position of the \fBaxis\fR\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSint16 x_move, y_move;
|
||||
SDL_Joystick *joy1;
|
||||
\&.
|
||||
\&.
|
||||
x_move=SDL_JoystickGetAxis(joy1, 0);
|
||||
y_move=SDL_JoystickGetAxis(joy1, 1);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickNumAxes\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
37
docs/man3/SDL_JoystickGetBall.3
Normal file
37
docs/man3/SDL_JoystickGetBall.3
Normal file
|
@ -0,0 +1,37 @@
|
|||
.TH "SDL_JoystickGetBall" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickGetBall\- Get relative trackball motion
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickGetBall\fP\fR(\fBSDL_Joystick *joystick, int ball, int *dx, int *dy\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Get the \fBball\fR axis change\&.
|
||||
.PP
|
||||
Trackballs can only return relative motion since the last call to \fBSDL_JoystickGetBall\fP, these motion deltas a placed into \fBdx\fR and \fBdy\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB0\fR on success or \fB-1\fR on failure
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWint delta_x, delta_y;
|
||||
SDL_Joystick *joy;
|
||||
\&.
|
||||
\&.
|
||||
\&.
|
||||
SDL_JoystickUpdate();
|
||||
if(SDL_JoystickGetBall(joy, 0, &delta_x, &delta_y)==-1)
|
||||
printf("TrackBall Read Error!
|
||||
");
|
||||
printf("Trackball Delta- X:%d, Y:%d
|
||||
", delta_x, delta_y);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickNumBalls\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickGetButton.3
Normal file
18
docs/man3/SDL_JoystickGetButton.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickGetButton" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickGetButton\- Get the current state of a given button on a given joystick
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 \fBSDL_JoystickGetButton\fP\fR(\fBSDL_Joystick *joystick, int button\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
SDL_JoystickGetButton returns the current state of the given \fBbutton\fR on the given \fBjoystick\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
\fB1\fR if the button is pressed\&. Otherwise, \fB0\fR\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickNumButtons\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
36
docs/man3/SDL_JoystickGetHat.3
Normal file
36
docs/man3/SDL_JoystickGetHat.3
Normal file
|
@ -0,0 +1,36 @@
|
|||
.TH "SDL_JoystickGetHat" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickGetHat\- Get the current state of a joystick hat
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBUint8 \fBSDL_JoystickGetHat\fP\fR(\fBSDL_Joystick *joystick, int hat\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
SDL_JoystickGetHat returns the current state of the given \fBhat\fR on the given \fBjoystick\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
The current state is returned as a Uint8 which is defined as an OR\&'d combination of one or more of the following
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_CENTERED\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_UP\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_RIGHT\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_DOWN\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_LEFT\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_RIGHTUP\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_RIGHTDOWN\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_LEFTUP\fP
|
||||
.IP "" 10
|
||||
\fBSDL_HAT_LEFTDOWN\fP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickNumHats\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickIndex.3
Normal file
18
docs/man3/SDL_JoystickIndex.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickIndex" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickIndex\- Get the index of an SDL_Joystick\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickIndex\fP\fR(\fBSDL_Joystick *joystick\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Returns the index of a given \fBSDL_Joystick\fR structure\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Index number of the joystick\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
32
docs/man3/SDL_JoystickName.3
Normal file
32
docs/man3/SDL_JoystickName.3
Normal file
|
@ -0,0 +1,32 @@
|
|||
.TH "SDL_JoystickName" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickName\- Get joystick name\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBconst char *\fBSDL_JoystickName\fP\fR(\fBint index\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Get the implementation dependent name of joystick\&. The \fBindex\fR parameter refers to the N\&'th joystick on the system\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns a char pointer to the joystick name\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CW/* Print the names of all attached joysticks */
|
||||
int num_joy, i;
|
||||
num_joy=SDL_NumJoysticks();
|
||||
printf("%d joysticks found
|
||||
", num_joy);
|
||||
for(i=0;i<num_joy;i++)
|
||||
printf("%s
|
||||
", SDL_JoystickName(i);\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickNumAxes.3
Normal file
18
docs/man3/SDL_JoystickNumAxes.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickNumAxes" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickNumAxes\- Get the number of joystick axes
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickNumAxes\fP\fR(\fBSDL_Joystick *joystick\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Return the number of axes available from a previously opened \fBSDL_Joystick\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Number of axes\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickGetAxis\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickNumBalls.3
Normal file
18
docs/man3/SDL_JoystickNumBalls.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickNumBalls" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickNumBalls\- Get the number of joystick trackballs
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickNumBalls\fP\fR(\fBSDL_Joystick *joystick\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Return the number of trackballs available from a previously opened \fBSDL_Joystick\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Number of trackballs\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickGetBall\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickNumButtons.3
Normal file
18
docs/man3/SDL_JoystickNumButtons.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickNumButtons" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickNumButtons\- Get the number of joysitck buttons
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickNumButtons\fP\fR(\fBSDL_Joystick *joystick\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Return the number of buttons available from a previously opened \fBSDL_Joystick\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Number of buttons\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickGetButton\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickNumHats.3
Normal file
18
docs/man3/SDL_JoystickNumHats.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickNumHats" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickNumHats\- Get the number of joystick hats
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickNumHats\fP\fR(\fBSDL_Joystick *joystick\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Return the number of hats available from a previously opened \fBSDL_Joystick\fR\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Number of hats\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickGetHat\fP\fR, \fI\fBSDL_JoystickOpen\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
51
docs/man3/SDL_JoystickOpen.3
Normal file
51
docs/man3/SDL_JoystickOpen.3
Normal file
|
@ -0,0 +1,51 @@
|
|||
.TH "SDL_JoystickOpen" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickOpen\- Opens a joystick for use\&.
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBSDL_Joystick *\fBSDL_JoystickOpen\fP\fR(\fBint index\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Opens a joystick for use within SDL\&. The \fBindex\fR refers to the N\&'th joystick in the system\&. A joystick must be opened before it game be used\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns a \fBSDL_Joystick\fR structure on success\&. \fBNULL\fR on failure\&.
|
||||
.SH "EXAMPLES"
|
||||
.PP
|
||||
.PP
|
||||
.nf
|
||||
\f(CWSDL_Joystick *joy;
|
||||
// Check for joystick
|
||||
if(SDL_NumJoysticks()>0){
|
||||
// Open joystick
|
||||
joy=SDL_JoystickOpen(0);
|
||||
|
||||
if(joy)
|
||||
{
|
||||
printf("Opened Joystick 0
|
||||
");
|
||||
printf("Name: %s
|
||||
", SDL_JoystickName(0));
|
||||
printf("Number of Axes: %s
|
||||
", SDL_JoystickNumAxes(joy));
|
||||
printf("Number of Buttons: %s
|
||||
", SDL_JoystickNumButtons(joy));
|
||||
printf("Number of Balls: %s
|
||||
", SDL_JoystickNumBalls(joy));
|
||||
}
|
||||
else
|
||||
printf("Couldn\&'t open Joystick 0
|
||||
");
|
||||
|
||||
// Close if opened
|
||||
if(SDL_JoystickOpened(0))
|
||||
SDL_JoystickClose(joy);
|
||||
}\fR
|
||||
.fi
|
||||
.PP
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickClose\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
18
docs/man3/SDL_JoystickOpened.3
Normal file
18
docs/man3/SDL_JoystickOpened.3
Normal file
|
@ -0,0 +1,18 @@
|
|||
.TH "SDL_JoystickOpened" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickOpened\- Determine if a joystick has been opened
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBint \fBSDL_JoystickOpened\fP\fR(\fBint index\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Determines whether a joystick has already been opened within the application\&. \fBindex\fR refers to the N\&'th joystick on the system\&.
|
||||
.SH "RETURN VALUE"
|
||||
.PP
|
||||
Returns \fB1\fR if the joystick has been opened, or \fB0\fR if it has not\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickOpen\fP\fR, \fI\fBSDL_JoystickClose\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
15
docs/man3/SDL_JoystickUpdate.3
Normal file
15
docs/man3/SDL_JoystickUpdate.3
Normal file
|
@ -0,0 +1,15 @@
|
|||
.TH "SDL_JoystickUpdate" "3" "Mon 12 Mar 2001, 01:03" "SDL" "SDL API Reference"
|
||||
.SH "NAME"
|
||||
SDL_JoystickUpdate\- Updates the state of all joysticks
|
||||
.SH "SYNOPSIS"
|
||||
.PP
|
||||
\fB#include "SDL\&.h"
|
||||
.sp
|
||||
\fBvoid \fBSDL_JoystickUpdate\fP\fR(\fBvoid\fR);
|
||||
.SH "DESCRIPTION"
|
||||
.PP
|
||||
Updates the state(position, buttons, etc\&.) of all open joysticks\&. If joystick events have been enabled with \fI\fBSDL_JoystickEventState\fP\fR then this is called automatically in the event loop\&.
|
||||
.SH "SEE ALSO"
|
||||
.PP
|
||||
\fI\fBSDL_JoystickEventState\fP\fR
|
||||
...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:03
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue