mirror of https://github.com/encounter/SDL.git
doxygen: wrap some game controller code examples in "```c" blocks.
This commit is contained in:
parent
7390bc0e5e
commit
04196a46a5
|
@ -99,6 +99,8 @@ typedef struct SDL_GameControllerButtonBind
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* To count the number of game controllers in the system for the following:
|
* To count the number of game controllers in the system for the following:
|
||||||
|
*
|
||||||
|
* ```c
|
||||||
* int nJoysticks = SDL_NumJoysticks();
|
* int nJoysticks = SDL_NumJoysticks();
|
||||||
* int nGameControllers = 0;
|
* int nGameControllers = 0;
|
||||||
* for (int i = 0; i < nJoysticks; i++) {
|
* for (int i = 0; i < nJoysticks; i++) {
|
||||||
|
@ -106,6 +108,7 @@ typedef struct SDL_GameControllerButtonBind
|
||||||
* nGameControllers++;
|
* nGameControllers++;
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
* Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
|
||||||
* guid,name,mappings
|
* guid,name,mappings
|
||||||
|
@ -119,8 +122,10 @@ typedef struct SDL_GameControllerButtonBind
|
||||||
* Buttons can be used as a controller axis and vice versa.
|
* Buttons can be used as a controller axis and vice versa.
|
||||||
*
|
*
|
||||||
* This string shows an example of a valid mapping for a controller
|
* This string shows an example of a valid mapping for a controller
|
||||||
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
|
||||||
*
|
*
|
||||||
|
* ```c
|
||||||
|
* "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
||||||
|
* ```
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -174,7 +179,7 @@ extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw,
|
||||||
*
|
*
|
||||||
* This string shows an example of a valid mapping for a controller:
|
* This string shows an example of a valid mapping for a controller:
|
||||||
*
|
*
|
||||||
* ```
|
* ```c
|
||||||
* "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
|
* "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7"
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue