Compare commits

...
803 Commits
Author SHA1 Message Date
Alug 3b07022379 remove spritecliphack shader and readd fickle fix
the shader aint working out that well so just do this for now
2024-06-22 20:43:27 +02:00
Alug a4fce0b3b1 add shader for shadows to also fix sprite shadows in pal render 2024-06-03 16:19:41 +02:00
Alug 79ad1f8d51 readd sprite shadows and give dropshadows their own cvar 2024-06-03 15:46:30 +02:00
Alug 73aef11554 make shadow hack less noticable lul 2024-06-03 15:24:59 +02:00
Alug 318916abc9 Merge branch 'Saturn-Next' into nomobjshadows 2024-06-03 15:24:54 +02:00
Alug 1ab7a2acf4 add toggle for beta intermission screen + smol cleanup 2024-06-03 15:13:46 +02:00
Alug f977af6a80 fix le dispoffset 2024-06-03 15:13:39 +02:00
indev cae40928ad Use Z_Calloc to allocate wadfile_t to avoid having uninitialized fields 2024-06-03 00:18:11 +03:00
Alug ee2ec01eb9 use shader to prevent sprite floor clipping
from durr lul
2024-06-02 22:16:09 +02:00
Alug 164a9d604a conflict moment 2024-06-02 22:15:58 +02:00
Alug 7696b115ae add maxinterpdist to shadows 2024-06-02 22:15:28 +02:00
Alug b8ecaf336c fix ogl shadows for the 500th time 2024-06-02 22:15:25 +02:00
Alug 1ea8ebf84c o 2024-06-02 22:15:23 +02:00
Alug 9f70fe5373 fix ogl whiteshadows 2024-06-02 22:15:20 +02:00
Alug 9695ede7c2 reenable shadow skewing in software 2024-06-02 22:15:17 +02:00
Alug a5cd72d5db smth smth shader 2024-06-02 22:15:14 +02:00
Alug f87e282981 readd shadowscale since some things need manual scale 2024-06-02 22:15:11 +02:00
Alug 4b15972543 make software shadows more opague 2024-06-02 22:15:09 +02:00
Alug d5753bb15a smol fix and dont colormap software shadows either 2024-06-02 22:15:06 +02:00
Alug a92e5b3f7b dont colourmap shadows
todo software renderer ugh
2024-06-02 22:14:56 +02:00
Alug 72d2357560 use shader to prevent sprite floor clipping
from durr lul
2024-06-02 22:14:53 +02:00
Alug d306b560b1 dont rotate shadows with sprite rotation off
theres prob a better way to get an interpolated floorz but this works
also adds a small offset to not let stuff clip into the ground
2024-06-02 22:14:42 +02:00
Alug 4d331d9c9f change shadowscale a little 2024-06-02 22:13:47 +02:00
indev 932f6d83f7 Allow all mobjs to have shadow 2024-06-02 22:13:45 +02:00
Alug d57783aa3a port neat render based shadows
what an absolute arsepain
shearing in software is disabled cause it is inverted for whatever reason
also if someone ever wants to reeimplement lua spawnshadows idk go ahead kek
2024-06-02 22:13:41 +02:00
Alug 1d79854d3b Merge branch 'Saturn-Next' into nomobjshadows 2024-06-02 22:13:30 +02:00
Alug bf75644144 make r_fps if else hell a bit more bearable to look at
lol lmao
2024-06-02 22:12:39 +02:00
Alug 38633a8516 stuffs 2024-06-01 17:03:39 +02:00
Alug 957159d485 forgor to remove that 2024-06-01 16:31:55 +02:00
Alug 8052eb1c3a fix papersprites in software (hopefully)
lul
2024-06-01 16:30:03 +02:00
Alug 37a394ebaa flexible array stuff for columnofs
hopefully this fixes some crashes or smth
2024-06-01 16:29:55 +02:00
Alug b01a2836ea cleanup some super old stuff that did nothing
lul
2024-06-01 16:29:40 +02:00
Alug dc03359f3a theres no value 3 oops
i shouldnt do stuff after waking up at 4 in the morning lol
2024-05-30 19:59:14 +02:00
indev 6269c7c827 Use tmp variable for searchWad since envstr doesn't get changed 2024-05-30 19:32:18 +03:00
indev 040ddb1f40 Revert "Revert "Don't traverse the entire HOME directory to find wads""
This reverts commit 443905ffb3.
2024-05-30 19:23:14 +03:00
Alug faa5dbd0e7 split sprite draw loops
so crap doesent constantly check for papersprites on all sprites
2024-05-28 23:53:28 +02:00
Alug 37d3e2ae1a scale sprite draw distance with mapobjscale 2024-05-28 23:52:13 +02:00
Alug 455bbe47c2 smth smth encore magic numbers idk 2024-05-28 22:55:43 +02:00
Alug 4847e4e3cb that should be there lul 2024-05-28 22:55:40 +02:00
Alug 67aa71170f when not using screentextures draw kart bg on intermission screen 2024-05-28 00:52:52 +02:00
Alug ddddc7a898 draw a black screen instead of "nothing" during wipes on disabled screentextures
should resolve the intense flashing that can occur
2024-05-28 00:52:48 +02:00
indev 7c17f3a93c Merge pull request #130 from GenericHeroGuy/lua-hudinterpolate-redux
Lua HUD interpolation
2024-05-25 19:09:02 +03:00
GenericHeroGuy 05a5651260 Finishing touches
Some cleanup, also interpolate drawfill size
(dunno why it wasn't before)
2024-05-25 17:05:08 +02:00
Alug 8774b14fdf move some cvars to be registerrerd latur in ogl 2024-05-25 14:52:58 +02:00
Alug 518ac3ca28 Turn of FBO downsampling when you turn off screen textures
fbo downsampling needs those and if theyre disabled youre essentially seeing nothing at all lol
2024-05-25 14:44:03 +02:00
Alug 157c95a785 super smol optimization to R_DrawRepeatMaskedColumn
only maths once not twice lul
2024-05-25 14:44:00 +02:00
GenericHeroGuy 142c01f516 Update docs for interpLatch 2024-05-25 14:09:20 +02:00
GenericHeroGuy a17a5387ff Rename interpString to interpLatch 2024-05-25 14:08:52 +02:00
Alug d794de3e83 Cull BSP behind a raised floor or lowered ceiling that covers the entire screen
https://git.do.srb2.org/KartKrew/RingRacers/-/commit/7b8a564f69688515319ccd425f2b88ffe8b7b120
2024-05-25 02:21:04 +02:00
Alug 837746c0a9 declare outside of lööp also add const in r_ 2024-05-25 02:14:20 +02:00
Alug 9f692c1f6a change names to be less basic 2024-05-23 23:28:54 +02:00
Alug 8de340edbe allow gamepad dpad to hold scroll shit in menu aaa
absolute arsepain cant wait to see this breaking kek
2024-05-23 23:28:47 +02:00
GenericHeroGuy 9cd1233c32 Dust this crap off a bit 2024-05-23 16:47:29 +02:00
GenericHeroGuy 3f6575e41f Merge branch 'Saturn-Next' into lua-hudinterpolate-redux 2024-05-23 15:44:46 +02:00
Alug f939b02fd3 Merge branch 'Saturn' into Saturn-Next 2024-05-21 21:01:11 +02:00
Alug 73d0154b6c encore flipcam support 2024-05-21 21:00:33 +02:00
Alug cda7475058 unhack the animated votescreen a little
also make it pause when the game is paused like it was intended originally
2024-05-20 18:42:03 +02:00
Alug 33a31d0ad8 this should be here aswell i suppose 2024-05-20 13:31:13 +02:00
Alug 8dafc2d3d9 Merge pull request #129 from Indev450/Saturn-Next
Saturn v6.2
2024-05-20 13:21:16 +02:00
Alug 5f36557a18 change version string stuff per define lul 2024-05-19 21:31:05 +02:00
Alug 9b4e64011b make this a scroll menu
tbh not gonna bother with moving stuff depending on renderer
2024-05-19 18:43:12 +02:00
Alug 3ca313c14d Merge pull request #125 from Indev450/fborender
Use FBO to allow downsampling in Opengl
2024-05-19 18:20:01 +02:00
Alug 6fcea2f98e RefreshOGLSDLSurface
to make it a little more clearer this is ogl only
2024-05-18 23:52:05 +02:00
Alug c605906408 some stuffs 2024-05-18 23:49:36 +02:00
Alug de6511abe0 dont compile with that with NOHW 2024-05-18 23:40:28 +02:00
Alug c966b5defb forgor 2024-05-18 23:38:04 +02:00
Alug 3c8c273e51 add ogl version check + grey out in menu + turn it off when not avilible 2024-05-18 23:34:27 +02:00
Alug eaeb2575f7 add stuff to experimental menu 2024-05-18 23:22:30 +02:00
Alug 978cc57889 Add NOSCREENFBO compiler flag to be able to build without fbo support 2024-05-18 22:57:25 +02:00
Alug 6db73bfd63 Merge branch 'Saturn-Next' into fborender 2024-05-18 22:33:41 +02:00
Alug af5c3e4201 revert this thing 2024-05-15 17:56:58 +02:00
Alug 39e6668e20 change version 2024-05-15 17:51:11 +02:00
Alug 1ab63613a9 forgor this crap 2024-05-15 16:54:27 +02:00
Alug 57e72db1f8 support gcc14 ig 2024-05-15 16:46:59 +02:00
Alug d1d00d7ec6 shut up compiler 2024-05-05 22:00:22 +02:00
Alug 169e7cd462 Render precip through blockmap instead of during BSP
from RR
2024-05-05 21:54:00 +02:00
Alug e19f6f6656 fix some interpolation issues
minus P_spec change since that aint netsafe
2024-05-05 20:52:06 +02:00
Alug 13249f7ad4 fix potential crash in ogl vissprite sorting 2024-05-05 20:50:36 +02:00
Alug 22166ceccb fix precip overflow 2024-05-05 20:50:32 +02:00
Alug 75ed11a8b6 simplify SOFTLIGHT alot
also should make sure it gets applied everywhere lul
2024-04-29 10:12:58 +02:00
Alug 641cd6b8db use bigfloat for driftgauge offset too 2024-04-27 20:32:52 +02:00
Alug 62fa60e399 fix rare precip crash 2024-04-27 20:03:38 +02:00
Alug 17a6c4191d Merge pull request #128 from Indev450/it-cv-bigfloat
Add IT_CV_BIGFLOAT to use bigger increment for some CV_FLOAT cvars (a…
2024-04-27 20:01:57 +02:00
Alug 3acdcb09f1 inline those 2024-04-24 11:02:25 +02:00
GenericHeroGuy 1abf6a4ce1 Add interpolation docs to LUASTUFF 2024-04-23 21:24:47 +02:00
Alug 836890968c Revert "Merge pull request #121 from Indev450/texload"
This reverts commit b6a5c5b720, reversing
changes made to bcf2b3bab2.
2024-04-23 09:06:51 +02:00
Alug 7110de4b5b Merge branch 'Saturn' into Saturn-Next 2024-04-22 05:25:52 +02:00
Alug b4dfebac58 fix some visual issues with fofs 2024-04-22 05:25:46 +02:00
Alug 38d5ee5ae7 a 2024-04-20 22:54:03 +02:00
Alug d0c50006bc some stuff from ceepeepeecheck 2024-04-20 22:54:00 +02:00
Alug 443905ffb3 Revert "Don't traverse the entire HOME directory to find wads"
This reverts commit 1f019ed277.
2024-04-20 11:42:21 +02:00
indev 2147951a16 Add IT_CV_BIGFLOAT to use bigger increment for some CV_FLOAT cvars (added only to fov atm) 2024-04-20 11:41:17 +03:00
indev ea0cc41d04 For MIN/MAX value of cvar, convert it to float before saving for CV_FLOAT variables 2024-04-20 10:30:34 +03:00
Alug b6a5c5b720 Merge pull request #121 from Indev450/texload
Do not reload every texture when adding a wad
2024-04-20 01:33:50 +02:00
Alug bcf2b3bab2 disable palette rendering if screentextures aint enabled 2024-04-19 06:23:12 +02:00
Alug a238b19c75 z 2024-04-19 06:22:48 +02:00
Alug 9317ccd0be more things
-Fix a division by zero in BCZ2 Metal Sonic's routine
-Fix a bug where adding the same mod multiple times counted towards the mod limit
and other thigns
2024-04-19 06:22:44 +02:00
Alug 463dccab8b some smol fixes 2024-04-19 06:22:22 +02:00
Alug 2ccf91fbfc Make FixedRem less laggy by just using the modulo operator. 2024-04-19 06:22:20 +02:00
indev 36e06e5d6b Fix possible buffer overflow in 'va' function 2024-04-13 21:55:22 +03:00
Alug 6f293945fd add qs22j to cmakelist 2024-04-13 18:40:14 +02:00
Alug 45d73a2ad6 add qs22j to cmakelist 2024-04-13 18:40:00 +02:00
GenericHeroGuy 995777c676 Exclude string mode flags from olditem search 2024-04-12 22:36:23 +02:00
Alug dacfe376e1 smth smth paranthesis 2024-04-12 21:55:53 +02:00
GenericHeroGuy 60e42472e3 Do string coordinate calcs on all functions (and fix) 2024-04-12 21:00:54 +02:00
Alug c92ef4d757 fix software crash
Zzz...
2024-04-12 20:41:25 +02:00
indev 7cd6a031cd Fix compilation warning regarding calloc and sizeof 2024-04-11 19:12:14 +03:00
indev af265d017d Fix potential negative array index in V_ThinStringWidth 2024-04-11 18:55:55 +03:00
Alug 9e104a8632 ok dont use this at all then 2024-04-10 18:18:47 +02:00
Alug 4a1523da57 Zzz... 2024-04-10 18:15:29 +02:00
Alug 6a3987c8f7 fix ifdefs 2024-04-10 17:57:55 +02:00
Alug 1df6c4d4da move this to first init too 2024-04-10 17:47:37 +02:00
Alug 3cab29085a Merge branch 'Saturn-Next' into fborender 2024-04-10 17:46:40 +02:00
Alug 1391e556d6 that wasnt the onchange im sleepy 2024-04-10 17:40:43 +02:00
Alug 94340e6634 forgor to remove those Zzz... 2024-04-10 17:32:13 +02:00
Alug 64f10c36fa should throw that into onchange oops 2024-04-10 17:29:16 +02:00
Alug 955f73d9e8 throw stuff into own function, also check on game start 2024-04-10 17:24:46 +02:00
Alug 40c356395a simplify this crap 2024-04-10 07:02:18 +02:00
indev bce914df6e Don't call menu drawer in wipes on dedicated servers 2024-04-06 01:47:27 +03:00
indev aac74cf93a Don't call menu drawer in wipes on dedicated servers 2024-04-06 01:31:43 +03:00
indev e0d0120337 Merge branch 'Saturn-Next' into Saturn 2024-04-05 20:56:49 +03:00
Alug 87cf75ef84 this can be completely removed actually 2024-04-05 16:31:17 +02:00
Alug 5f237d9e13 (maybe?) fix a checkheap crash 2024-04-05 16:24:27 +02:00
Alug 23050394ac retain old behaviour for raising gamma
or if you dont use any colour correction stuff
basically checks if anything has changed and if the gamma is below 0
otherwise it will apply colour cubus
2024-04-05 01:10:49 +02:00
Alug dbc47e8656 Revert "disable colourcube cause of visual discrepentcies (temporary)"
This reverts commit ed418d5dcf.
2024-04-05 00:27:14 +02:00
GenericHeroGuy 18e0485f39 Make this less insufferable
* Zero is now a valid tag for v.interpolate
* Reset lerp coordinates when v.interpString is called again
* Leaving string mode enabled on exit no longer breaks other scripts
* Fix fadeScreen having an uninitialized ID
2024-04-04 23:39:23 +02:00
Alug d675795014 version change again or else i forger 2024-04-04 20:52:13 +02:00
Alug ed418d5dcf disable colourcube cause of visual discrepentcies (temporary) 2024-04-04 18:59:45 +02:00
Alug d6fb76b833 fix tint equation
idk what happen there but it looked pretty diff on a few maps
2024-04-04 17:38:15 +02:00
Alug ced45061f8 clean this up a bit 2024-04-04 03:53:11 +02:00
Alug 52c6a52a2f fix some smol leaks 2024-04-04 03:53:00 +02:00
GenericHeroGuy aeb5ae994e Subpixel interpolation for strings and drawfill 2024-04-04 00:27:47 +02:00
Alug b2c34906ff try and fix some compile issues 2024-04-03 19:24:51 +02:00
Alug c8f6878c26 try and fix some compile issues 2024-04-03 19:24:44 +02:00
Alug 6d8c375cf5 Fix 3D model crash 2024-04-03 00:28:56 +02:00
Alug c093aa3c73 k then 2024-04-02 22:17:40 +02:00
Alug fc27ed0443 Add option for wipes only in screentex toggle
since the toggle was changed to actually disable ALL screentex functions
2024-04-02 22:14:10 +02:00
GenericHeroGuy b2f9a29eb0 Lua HUD interpolation 2024-04-02 21:00:23 +02:00
Alug bd2fe5b9be use SDL_PeepEvents again
grrrrrrr
2024-04-02 19:19:56 +02:00
Alug 07e50c40a3 forgor those lul 2024-04-02 19:10:51 +02:00
Alug 94248eaea2 use functions for keyshift crap
lmao why tf wasnt this done anyways but copy and pasted 500 times
2024-04-02 16:38:07 +02:00
Alug ebc467f212 more fixup for native layout 2024-04-02 16:14:22 +02:00
Alug 29acff6722 make this less fragile 2024-04-02 15:19:25 +02:00
Alug be71dd66ac Merge branch 'Saturn' into Saturn-Next 2024-04-02 03:48:17 +02:00
Alug 8a1ad4a2de limit to ASCII
also forgor to add stuff to h
2024-04-02 03:48:03 +02:00
Alug 3370d1631e FIXUP native keyboard layout
cleanup GetTypedChar
fix issues with capslock and shift
2024-04-02 03:36:22 +02:00
GenericHeroGuy 5f69bfcf22 Split game drawlist per displayplayer 2024-04-02 03:22:24 +02:00
Alug 21cb42309e Downgrade SDL2 to v2.28.5
v2.3.0 broke some things in 32bit builds Zzz...
2024-04-02 00:22:33 +02:00
GenericHeroGuy 9442a463d4 Shrink drawlists, take 2
Approximately 2/3rds smaller
2024-04-01 23:24:09 +02:00
Alug 8b72cc6b01 Merge branch 'Saturn-Next' into Saturn 2024-04-01 18:28:32 +02:00
Alug 8ed8182a1b Zzz... 2024-04-01 17:18:38 +02:00
Alug e2f4e1f08e update menu text for keyboard layout 2024-04-01 16:38:38 +02:00
Alug 6e59fdacb5 add AZERTY layout as toggable option
so no need to update that thing seperately anymore
2024-04-01 16:34:01 +02:00
Alug 33501b6798 Merge pull request #123 from Indev450/linkedtex
Manage Gpu Textures with a list
2024-04-01 14:31:15 +02:00
Alug ffb72f5fe3 Fix vertical aim being off when using lack of perspective 2024-03-31 23:27:30 +02:00
indev d3f6b983f4 Use 'find' directly in help 2024-03-30 22:18:51 +03:00
indev 9435fa8d6b If command is not found via 'help', tell user about 'find' command 2024-03-30 22:03:10 +03:00
Alug 0ceb9e5ea5 fix this for splitscreen and move to own function 2024-03-30 03:34:58 +01:00
Alug 95c0951727 Merge pull request #122 from Indev450/luadebuglib
Expose debug library to Lua
2024-03-28 15:08:31 +01:00
Alug de6a54bc8c why tf is that here 2024-03-28 14:25:07 +01:00
Alug 1e524a8240 when the GLENCORE 2024-03-28 13:22:06 +01:00
Alug ca1302475e use this instead 2024-03-28 08:13:23 +01:00
Alug 8486bddaf2 fix highresscale issue on startup in the worst way ever cause CV_NOINIT doesent work for whatever reason 2024-03-28 00:15:55 +01:00
Alug d7a1cc6702 Read only header bytes when creating textures list 2024-03-27 21:31:56 +01:00
Alug 847a8cfd81 Zzz... 2024-03-27 20:38:29 +01:00
Alug 2fc6a26e77 GL_GENERATE_MIPMAP is enough
also made MajorGL and MinorGL extern, so can be used in other parts if needed to check for it
2024-03-27 20:36:07 +01:00
Alug a779191feb beter 2024-03-27 18:45:59 +01:00
Alug 23cc0dfc3a add some comments cause i WILL forger what this crap even does 2024-03-27 18:44:32 +01:00
Alug c7a258f32f clean up 2024-03-27 18:34:58 +01:00
Alug a28f025d40 Stuff from displaycrap branch to detect downsampling automatically 2024-03-27 18:33:29 +01:00
Alug 91a3b288ef conflict moment 2024-03-27 18:08:09 +01:00
Alug 200d971d35 Toggle to render to screenFBO
fixes downsampling from higher resolutions
TODO: make this activate automatically if game detects it runs at higher res than desktop res
2024-03-27 18:05:48 +01:00
Alug 4847d2d844 Handle OpenGL textures with a linked list 2024-03-27 17:51:58 +01:00
Alug b487df7771 update sdl xpm stuff 2024-03-27 03:51:59 +01:00
Alug 8ef9668ac5 fix smol conflict 2024-03-27 03:46:52 +01:00
Alug d7ec2da975 some sdl_mixer stuff
- Fix crash with GME sounds when being freed
- fix some looping for gme i forgor somehow
- smol cleanup
2024-03-27 03:45:31 +01:00
Alug b26cdfcc1d update libpng libs for windows to 1.6.37 2024-03-27 02:56:38 +01:00
Alug 56f3249679 Expose debug library to Lua
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2404
2024-03-26 21:03:18 +01:00
indev 54ee3f2961 R_LoadTexturesPwad: don't do anything wad has no textures 2024-03-26 20:40:11 +03:00
Alug c3a71b60b0 Do not reload every texture when adding a wad
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1725?commit_id=37add34b9c729b21e624e22d64159073c9258e25
2024-03-26 14:12:05 +01:00
Alug 205bfc0262 Split R_LoadTextures 2024-03-26 14:11:49 +01:00
Alug 98724949be make custom buttons bindable to joyaxis
triggers and such
2024-03-25 21:18:19 +01:00
Alug 00db0a71f7 reset sound channel origin in s_stopchannel 2024-03-24 20:15:33 +01:00
Alug e1ff973bca raise vissprite limit and precip distance on 64bit builds
lower precip distance to vanilla values in 32bit again
2024-03-24 18:29:57 +01:00
Alug 07e864a4b6 "showspecstuff" to show a more info for spec on vanilla scoreboard
such as skin and ping of specating players
2024-03-24 17:22:03 +01:00
Alug b5bac690c0 more squashes things
Fix buffer overflow in SV_SendPlayerInfo

Pass -fwrapv to GCC compilation flags https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2195

Fix /unlist request https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2294

fix some alpha wrapping for translucent fofs
2024-03-24 17:18:31 +01:00
indev b23eb166eb Fix drift sound keep playing when player go off ground 2024-03-24 19:01:16 +03:00
Alug 850a126847 Fix buffer overflow when loading addons through symlinks
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2402
2024-03-24 15:25:51 +01:00
Alug 1f019ed277 Don't traverse the entire HOME directory to find wads
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2396
2024-03-24 15:25:08 +01:00
Alug 20dd32e716 Fix crash when passing a long string to v.drawString
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2403
2024-03-24 15:10:24 +01:00
Alug 2796340d63 menu stuffss
moved skybox toggle to experimental options
moved vhs effect toggle to normal video menu
moved uppercase menu toggle to saturn options
rearanged saturn menu a bit
made sure both video options dont cut of things on some resolutions
2024-03-24 14:32:30 +01:00
Alug a271f12aef Merge branch 'Saturn-Next' of https://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2024-03-23 18:56:43 +01:00
Alug d0ad6d880a update saturn credits c: 2024-03-23 18:56:37 +01:00
indev ba1de8fde0 Fix NOHW compilation warning 2024-03-23 20:24:41 +03:00
Alug 2348e3b73e changable scaling for high resolutions
range from 0.8 - 1.2
only for higher resolutions since it literally breaks things visually on resolutions that already have a rather high scale
2024-03-23 18:06:53 +01:00
indev aa723f7a2b Fix NOHW compilation (1 error and 1 warning) 2024-03-23 00:46:08 +03:00
indev be83979016 Fix own nametags being always shown in netgames 2024-03-22 21:50:38 +03:00
Alug dd1428c770 oops 2024-03-22 13:18:49 +01:00
Alug de3afbb1c5 this can be just M_PI 2024-03-22 13:10:15 +01:00
Alug e63ba0cb7b hacky hires scale "fix" for waiting screen 2024-03-22 13:09:55 +01:00
Alug 14f29cc029 Merge pull request #120 from GenericHeroGuy/hud-uncap
Uncap hardcode HUD
2024-03-21 22:40:46 +01:00
GenericHeroGuy d2e4939b37 Fix VHS timescale issues
...it was already uncapped in vanilla
2024-03-21 21:56:18 +01:00
Alug 71a00ac555 this does not exist anymore
lul
2024-03-20 00:53:11 +01:00
Alug c0def5a001 toggle to show speedometer in bottle 2024-03-20 00:16:35 +01:00
GenericHeroGuy 9552154b7a Uncap VHS effect 2024-03-19 23:36:04 +01:00
Alug 2c41f817fc a 2024-03-19 22:46:24 +01:00
Alug 19e3e28026 Merge remote-tracking branch 'origin/joinrefusemessage' into Saturn-Next 2024-03-19 22:39:09 +01:00
Alug 080708d05d revert that change for flashpals 2024-03-19 22:36:38 +01:00
Alug 1d52e793b5 clean up p-meter speedometer if else hell 2024-03-19 22:35:46 +01:00
Alug a92ddec391 int32 momento 2024-03-19 22:34:01 +01:00
Alug 62b058c9fb squashed stuff
faster palette stuff for ogl. no number for samplerate. smaller possible sdl mixer buffer size. some inline warning fixes. also some camera interp fix on level load. bigger console buffer for very high resolutons etc.
2024-03-19 22:32:20 +01:00
GenericHeroGuy 4074893899 Merge branch 'Saturn-Next' into hud-uncap 2024-03-19 22:24:18 +01:00
Alug 855ba36921 smol hw_main cleanup 2024-03-19 22:22:40 +01:00
Alug f3a80dd6d9 some cleanup i forgor to merge 2024-03-19 22:16:26 +01:00
GenericHeroGuy 449b70a5eb Uncap K_GetScreenCoords
Plus fix nametags in splitscreen
2024-03-19 22:13:49 +01:00
GenericHeroGuy c51cfcd817 Add cv_uncappedhud toggle and R_GetHudUncap
Turns out I need to AND with FRACMASK everywhere to avoid discrepencies,
so might as well make a function for it

(no, it's NOT interpolation, I swear...!)
2024-03-19 19:49:38 +01:00
Alug 80f003bf79 Merge pull request #104 from Indev450/speedostuff
Changes to the Speedometer
2024-03-19 19:49:17 +01:00
indev 46955b7636 Remove debug print oops 2024-03-19 21:22:21 +03:00
indev 307b348dfa Change speedo_cons_t depending on if required lumps are found 2024-03-19 21:07:59 +03:00
Alug 41c8988c90 remove reduntand code
those do not need a colormap
2024-03-19 19:05:34 +01:00
GenericHeroGuy 4ed335422c Actually uncap battle animations
...am I really using "uncap" and "interpolate" correctly?
2024-03-19 16:37:10 +01:00
Alug e6b2e28734 just call it extra lul 2024-03-19 15:29:35 +01:00
Alug 8dad70fb51 change stuff to retain backwards compat add extra 3 which can be used for whatever you like
mainly cause i want to keep my indev kart hud
also cool way to downscale patches without them looking bad
2024-03-19 15:17:02 +01:00
Alug fbc51f00ef Merge branch 'Saturn-Next' into speedostuff 2024-03-19 14:43:28 +01:00
Alug f6f7258582 version bump so i dont forger 2024-03-19 14:40:22 +01:00
GenericHeroGuy 883522c17b Interp- I mean, uh, uncap battle animations 2024-03-18 23:12:34 +01:00
GenericHeroGuy 9afa1bc036 Needs more stplyrnum 2024-03-18 23:12:34 +01:00
GenericHeroGuy 5c96a12d61 Uncap input display and demo title 2024-03-18 23:12:30 +01:00
GenericHeroGuy 9ff3986656 Uncap title screen 2024-03-18 20:13:07 +01:00
GenericHeroGuy 13b2832a13 Uncap minimap icons 2024-03-18 00:09:53 +01:00
GenericHeroGuy dc2fd4d52d Uncap lap animation
Now handles laps greater than 99
2024-03-18 00:09:53 +01:00
GenericHeroGuy 15c6177df3 Uncap FINISH marquee, level title, intermission scoreboard 2024-03-18 00:09:43 +01:00
Alug eaaa25a584 add the note so i dont forger if i wanna update this again 2024-03-17 22:43:26 +01:00
Alug 4df0673e7a properly link libopenmpt
one dll instead of 4
2024-03-17 22:43:22 +01:00
Alug 9b7eff1a33 cute icon 2024-03-17 19:42:01 +01:00
Alug 216f04717b cute icon 2024-03-17 19:28:14 +01:00
Alug b64af70dc3 fix crashing menu entries 2024-03-17 16:18:54 +01:00
Alug 5685ebc80f Merge pull request #94 from Indev450/compilation-warnings-fix
Compilation warnings fix
2024-03-17 15:07:22 +01:00
Alug e77436d20a Merge pull request #116 from Indev450/httpbackthread
Put HTTP downloading on a background thread
2024-03-17 15:06:34 +01:00
Alug 0668b2004d make this a little less painful to look at 2024-03-17 14:56:14 +01:00
indev 9683f3ee22 Oops we don't use that check now 2024-03-17 16:30:59 +03:00
indev e3fb523562 Fix 'cast to non-matching type' warning 2024-03-17 16:15:58 +03:00
indev 86e9b52107 Fix few things that broke when merging with Saturn-Next 2024-03-17 16:14:14 +03:00
indev bf90b13a4f Merge branch 'Saturn-Next' into compilation-warnings-fix 2024-03-17 16:07:44 +03:00
Alug ed2efacfdf Merge pull request #106 from Indev450/win32timer
Use Windows own high resolution timer for timing things instead of the SDL timer
2024-03-17 13:46:59 +01:00
Alug ed0c076801 Merge pull request #111 from Indev450/qwerty3
Switchable native keyboard input
2024-03-17 13:10:34 +01:00
Alug 4ab5d5ed71 Merge pull request #110 from Indev450/maybemobjcrashfixes
Some potential crash fixes for mobj removal things
2024-03-17 13:02:49 +01:00
Alug 5199aae901 Merge pull request #117 from Indev450/luaoptmenu
Options Menu for lua Cvars
2024-03-17 13:02:19 +01:00
Alug 81ee2d5994 Merge branch 'Saturn-Next' into luaoptmenu 2024-03-17 12:49:35 +01:00
Alug b3fa892b5f Merge pull request #119 from Indev450/dsdaclip
New Opengl Clipping code from DSDA-Doom
2024-03-17 12:23:13 +01:00
Alug 27d47ec738 Merge pull request #114 from Indev450/driftgauge
K_GetScreenCords function to get screen coordinates from mobjs + Driftgauge and  Nametags
2024-03-17 12:23:03 +01:00
Alug a44e0885cb Merge pull request #118 from Indev450/qs22j
Faster sorting Algorithm replacement for qsort
2024-03-17 12:18:26 +01:00
indev 1152ccbf09 Add include guard for qs22j.h 2024-03-17 14:09:22 +03:00
Alug dc72191152 Merge branch 'Saturn-Next' into qs22j 2024-03-17 10:02:03 +01:00
indev 379d737ba6 Add snap to top flag for pause gfx 2024-03-15 13:47:40 +03:00
Alug 0fa01ba0c5 mhhm ternaries 2024-03-13 22:06:56 +01:00
Alug 855f1a876a fix ogl precip interpolation 2024-03-13 17:56:16 +01:00
Alug 3331ddfe1c this looks better lul 2024-03-13 13:31:10 +01:00
Alug 3b5f9dd55a clean up 2024-03-13 10:16:15 +01:00
Alug c96b51d319 forgor menu stuff 2024-03-13 10:07:58 +01:00
Alug 1457000f81 remove xs_CRoundToInt
while ye, less exact stuff doesent matter too much in the context of doom, it matters more in kart, due to polygon rendering and seg processing being extremely heavy and also generally more complex maps
2024-03-13 10:07:10 +01:00
Alug 98d03edf23 Ensure opaque midtextures always use PF_Masked 2024-03-13 09:09:22 +01:00
Alug f4ac17408e remove some suff 2024-03-13 08:33:42 +01:00
Alug 7bfbb9d42c revert that part 2024-03-13 08:32:42 +01:00
Alug 22f16c1d27 optimize HWR_AddLine and HWR_ProcessSeg 2024-03-13 08:32:39 +01:00
Alug 06acf6554d Fix buffer overrun in I_ClipboardPaste
https://git.do.srb2.org/STJr/SRB2/-/commit/9772bbeda172bc60482f137fc465e12070c76f22
2024-03-12 18:51:10 +01:00
indev e0b98707cf If game crashes in level, add it to crash report 2024-03-12 20:39:15 +03:00
Alug ad8cdc676c midi music bros 2024-03-11 23:53:45 +01:00
indev ad252fdbf2 Add snap to bottom flags for race countdown and level title too 2024-03-12 00:24:32 +03:00
Alug a527831aa9 sort grid when opening skin menu instead of everytime a skin is added 2024-03-11 21:21:07 +01:00
Alug d2c157262a those can all be static 2024-03-11 12:40:18 +01:00
Alug 8461449f2f more opitmizations stuff 2024-03-11 12:39:31 +01:00
Alug cbe78cc50f can do that directly 2024-03-11 12:39:26 +01:00
Alug dc465c3581 optimize hwr_renderbpsnode
actually just make it behave like the software version lol
2024-03-11 11:02:18 +01:00
Alug 2fd0d980e3 make 64 default again 2024-03-11 04:28:37 +01:00
Alug 01cce7c9c6 remove pseudoangle as its slower 2024-03-11 04:25:49 +01:00
Alug 95f51a26c1 attempt at unfucking renderview 2024-03-11 04:13:15 +01:00
Alug 5ade9699c1 give this a better name lol 2024-03-11 02:22:48 +01:00
Alug e77453e43a actually move stuff back to hw_clip lmao 2024-03-11 02:15:43 +01:00
Alug 1957712f38 faster serverlist sorting
replace qsort here too
2024-03-10 20:32:30 +01:00
indev d802970bc4 Snap viewpoint text to bottom 2024-03-10 21:41:49 +03:00
Alug 8ec7e23217 clean up stuff a little 2024-03-10 18:53:38 +01:00
Alug 50ba93541d i am in pain 2024-03-10 18:53:25 +01:00
Alug ba376dbbfe Port R_PointToPseudoAngle from dsda-doom 2024-03-10 18:53:18 +01:00
Alug 4dd7f02f33 smol adjustment 2024-03-10 04:43:05 +01:00
Alug db92db393e clean up this mess 2024-03-10 04:43:02 +01:00
Alug 37ad063db8 forgor 2024-03-09 12:02:50 +01:00
Alug 12cab1ef20 sUgGeSt PaReNtHeSeS ArOuNd '&&' 2024-03-09 12:01:28 +01:00
Alug 6489100e13 oops 2024-03-09 11:56:11 +01:00
Alug c6641c58ab implicit declaration of deez nuts 2024-03-09 11:55:43 +01:00
Alug a5184fac13 fix dumbass compiler warnings + reformat it a bit 2024-03-09 11:55:36 +01:00
Alug 09b5954171 use it for other stuff 2024-03-09 11:55:33 +01:00
Alug b2842ca778 faster qsort for rendering 2024-03-09 11:55:10 +01:00
Alug 427a55b45b simplify this crap 2024-03-09 10:52:27 +01:00
Alug d1c75dd4b0 add toggle for old fps counter behaviour
idk people hate the new one so brap
2024-03-09 07:59:21 +01:00
Alug b5ac5fe26c fix shit on party cruiser
well fixing the cullplane broke party cruiser, so im just gonna give it the same parameters as the software version i guess idk
2024-03-08 01:19:44 +01:00
Alug e939fceb5b readd this cause i dumb 2024-03-08 01:19:41 +01:00
Alug 23effd81c2 more mobj stuffs 2024-03-07 00:35:40 +01:00
indev 4df59ce98b Attempt to fix rare K_RepairOrbitChain crash 2024-03-06 00:25:51 +03:00
indev 3f51315863 Make custom cvar menu bit wider 2024-03-04 23:27:21 +03:00
indev bbb0c53616 Don't add string cvars (a bit hacky solution) 2024-03-04 23:07:42 +03:00
Alug 1e0a10afb6 change some numbers uuuuuh 2024-03-04 20:17:26 +01:00
Alug df28c87529 remove minmax sliders 2024-03-04 19:45:58 +01:00
Alug a96e74d02d oops 2024-03-04 19:12:52 +01:00
Alug 48cd09889f dont do stuff for anything thats not in normal us ascii or smth 2024-03-04 18:34:32 +01:00
Alug 19253f8c35 dont use it for control setup 2024-03-04 18:34:29 +01:00
Alug 774caadc79 only use this for text inputs not gameplay 2024-03-04 18:34:26 +01:00
Alug d522f202a6 make netvars red 2024-03-04 16:57:26 +01:00
Alug 94e1a35791 smh 2024-03-04 16:57:21 +01:00
Alug 2857f36836 we dont have IT_CV_FLOATSLIDER so dont even need to check for float 2024-03-04 16:57:15 +01:00
Alug 8093b16f28 Options Menu for custom console variables
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2380#9cc73f4b99ff925448389969b0ade6ba3947fc31
2024-03-04 16:57:00 +01:00
Alug d6dcbb8ba8 dont need this 2024-03-04 16:36:58 +01:00
Alug b2b60a2648 make it even simpler 2024-03-04 16:36:38 +01:00
Alug c9cef60cfd i will just use my compilers memcpy thx 2024-03-04 16:36:34 +01:00
Alug fbcd8bf9fd fix P_PlayerInPain 2024-03-04 16:33:55 +01:00
Alug 09f840fbfc Merge pull request #113 from GenericHeroGuy/lua-hudstuff
Add Lua functions for HUD customization
2024-03-04 16:27:08 +01:00
Alug 62849f2ba3 when the ;; 2024-03-04 00:19:44 +01:00
Alug 037185f8a0 fix ogl freelook breaking with shearing enabled
also removed uneeded stuff
2024-03-03 08:42:16 +01:00
Alug b0feb32f8b bruh
im going insane
2024-03-03 06:45:56 +01:00
Alug 9f26240211 fix this 2024-03-02 23:39:21 +01:00
Alug e211afa9dd dont need to check if we dont use it 2024-03-02 22:57:30 +01:00
Alug 46da9bf98b we have functions for that dont check for slopes everywhere
the functions already do it for us anyways
2024-03-02 22:57:27 +01:00
Alug a4f52ebd10 move sprite mobj checks first 2024-03-02 22:12:40 +01:00
Alug 158d84d638 check for those i guess 2024-03-02 22:12:07 +01:00
Alug 6c9ecf4582 forgor screenspace clipping 2024-03-02 22:12:05 +01:00
Alug 85e49ef2ab GetScreenCoord lua parity 2024-03-02 22:12:02 +01:00
Alug bfddbcde6d fix compiler complains
those were for coronas code which we dont even have
2024-03-02 02:44:08 +01:00
Alug ef076b4576 unhack palrendering screentex stuff 2024-03-02 02:16:28 +01:00
Alug 8cc71fb13a e 2024-03-02 02:16:25 +01:00
Alug f6f5b5caec a 2024-03-02 02:16:22 +01:00
Alug a0ae100186 more stuffs 2024-03-02 02:16:20 +01:00
Alug 4a1eab5ccd more shader stuff 2024-03-02 02:16:14 +01:00
Alug 8223ab07e4 shader stuffs 2024-03-02 02:16:11 +01:00
Alug 960ccaf9a1 Merge branch 'nametags' into driftgauge 2024-03-01 15:25:20 +01:00
Alug 95dd8b079a remove unused thing 2024-03-01 15:23:09 +01:00
indev c773552880 Merge branch 'nametags' of ssh://github.com/Indev450/SRB2Kart-Saturn into nametags 2024-03-01 11:04:03 +03:00
indev 6872a533d4 Fix nametag offsets with reverse gravity and flipcam 2024-03-01 11:03:55 +03:00
Alug 59b9d77c0e fix vertical flip driftgauge
and make non flipcam behave like the sg lua version
2024-03-01 01:54:29 +01:00
Alug 60970e71d3 fix shearing offset with flipcam in K_GetScreenCoords 2024-03-01 01:04:50 +01:00
Alug 3e94cd7c1e fix shearing offset with flipcam in K_GetScreenCoords 2024-03-01 01:04:44 +01:00
Alug 015cf95f4e stimky ugly 2024-02-28 22:32:35 +01:00
Alug 16078d7f2d Merge branch 'Saturn-Next' into qwerty3 2024-02-28 22:14:14 +01:00
Alug 91bda83c92 fix conflict 2024-02-28 22:11:41 +01:00
Alug 4f0ec1a900 kill have_blua 2024-02-28 22:10:57 +01:00
Alug 65001cf899 Merge branch 'Saturn-Next' into driftgauge 2024-02-28 22:09:50 +01:00
Alug 29ffb4200e Merge branch 'Saturn-Next' into nametags 2024-02-28 22:09:07 +01:00
Alug 0df5f4530e kill have_blua 2024-02-28 22:08:14 +01:00
Alug c5461dca4b Revert "dont need SEENAMES"
This reverts commit 3e48bfc8f5.
2024-02-28 22:05:49 +01:00
Alug 694a397ba4 kill delfile 2024-02-28 19:01:44 +01:00
Alug 06045a0751 kill weighted recycling 2024-02-28 19:00:16 +01:00
Alug fe22c7aba0 this doesent even exist anymore lmao 2024-02-28 19:00:08 +01:00
Alug dd7252d9c1 kill eslope_typeshim 2024-02-28 18:27:04 +01:00
Alug 3d46dcc277 kill GL_SHADERS 2024-02-28 18:19:32 +01:00
Alug 10fd862992 Zzz... 2024-02-28 18:19:23 +01:00
Alug 3e48bfc8f5 dont need SEENAMES
esp when we get nametags its obsolete
2024-02-28 17:58:44 +01:00
Alug 0a62fd11a0 kill polyobjects ifdef 2024-02-28 17:58:39 +01:00
Alug 5d2b213f76 those can return earlier 2024-02-28 17:46:46 +01:00
Alug 1be1e7fcbd u 2024-02-28 17:42:01 +01:00
Alug cc4d44f806 e 2024-02-28 17:41:58 +01:00
Alug 47e045db06 kill hw_trick 2024-02-28 17:41:55 +01:00
Alug 05accd5aca kill eslope 2024-02-28 17:41:52 +01:00
Alug 622e0c12fe forgor this 2024-02-28 17:40:03 +01:00
Alug ec80a4ccda OpenGL: Fix linedef type 10 not culling FOFs 2024-02-28 17:40:01 +01:00
Alug b49a46646c missed those 2024-02-27 22:16:59 +01:00
Alug 804b0c2d67 oopsie 2024-02-27 22:11:39 +01:00
Alug 1e232eec3b delete half of srb2 2024-02-27 21:56:27 +01:00
Alug 69fe26847b Fix con_hudlines being off by one, Fix con_hudtime overflow 2024-02-27 20:13:34 +01:00
Alug 253a7c3ee5 some stuff i forgor 2024-02-27 20:09:53 +01:00
Alug 3a42398117 wtf even 2024-02-27 20:05:09 +01:00
indev 0ef51011d4 Change default value for joinrefusemessage because cvars don't support newline characters 2024-02-27 20:26:18 +03:00
indev 0b6796cad9 Add cvar joinrefusemessage for custom messages when allowjoin is Off 2024-02-27 20:18:10 +03:00
GenericHeroGuy 20bd4a8599 Don't return aggregates 2024-02-27 17:37:22 +01:00
Alug 2d160cfc89 Toggle for R_Pointtoangle Ex or 64
Ex may perform better on 32bit clients and some cpus so lets just make it toggable
2024-02-27 15:53:00 +01:00
indev 7fedc0a780 Don't return NULL when creating MT_NULL mobj, since it is needed in some parts of game 2024-02-27 15:16:32 +03:00
Alug 562f3cf611 Merge pull request #107 from Indev450/interpoptimisations
Small Interpolation Optimizations
2024-02-27 00:06:38 +01:00
Alug 84bfb3991e Put HTTP downloading on a background thread
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2322
2024-02-26 23:57:50 +01:00
Alug 07bd1aeb5d e 2024-02-26 23:55:36 +01:00
Alug 7cf407c895 Merge branch 'Saturn-Next' into maybemobjcrashfixes 2024-02-26 23:55:29 +01:00
Alug e4c59824f4 fix compile for qt 2024-02-26 23:49:09 +01:00
Alug 5e836d4bc1 make the menus a little prettier 2024-02-26 22:01:50 +01:00
Alug e7133e9480 toggle for showing nametags during spectating 2024-02-26 22:01:39 +01:00
Alug b1fb1c2293 toggle for showing nametags during spectating 2024-02-26 22:01:23 +01:00
Alug f87c5e2e8d Merge branch 'nametags' into driftgauge 2024-02-26 21:21:12 +01:00
Alug 3e6a66b12d add toggle for showing nametags after you finished a race
off by default to match sg nametags
2024-02-26 21:20:53 +01:00
Alug cda07a1594 use V_LocalTransFlag for driftgauge 2024-02-26 20:59:53 +01:00
Alug 8843fc0bd8 Merge branch 'nametags' into driftgauge 2024-02-26 20:59:47 +01:00
Alug b802e4fa8a use V_LocalTransFlag for nametags 2024-02-26 20:59:26 +01:00
Alug cb1c167fa0 Merge branch 'Saturn-Next' into nametags 2024-02-26 20:59:22 +01:00
Alug 50023b0021 replace SCR_FPSflags with V_LocalTransFlag
so we can actually display hud transparency stuff before the hud appears, since that doesent work with V_HUDTRANS
2024-02-26 20:59:06 +01:00
Alug 05195f4116 Revert "connect loadingscreen should clear menus"
This reverts commit 6b41cf676c.
2024-02-26 01:29:31 +01:00
Alug 7d991d1993 fix tagsdisplayed counter 2024-02-25 21:35:49 +01:00
Alug 91efc08823 fix tagsdisplayed counter 2024-02-25 21:33:46 +01:00
Alug 612bde4e9a dont quit addon downloading with the mousewheel lmao 2024-02-25 19:49:57 +01:00
Alug 6b41cf676c connect loadingscreen should clear menus 2024-02-25 19:49:13 +01:00
Alug 8cae47f756 disable driftgauge by default 2024-02-25 19:49:01 +01:00
Alug 0c1be58854 disable nametag by default 2024-02-25 19:48:58 +01:00
Alug 4d840c5455 disable nametag by default 2024-02-25 19:48:52 +01:00
Alug 78fc67a3eb lua hud disable option for driftgauge 2024-02-25 18:22:59 +01:00
Alug 7293efbe89 Merge branch 'nametags' into driftgauge 2024-02-25 18:22:56 +01:00
Alug f4e39912b4 lua hud disable option for nametags 2024-02-25 18:22:16 +01:00
NepDisk f7e99d6f33 Add coloring to large numbers 2024-02-25 17:34:27 +01:00
NepDisk 3016c2ee7b Fix fillbar 2024-02-25 17:34:24 +01:00
Alug e28722334c fix first person splitscreen driftgauge stuff a 2024-02-25 12:28:33 +01:00
Alug 0dabf65a40 k... 2024-02-25 12:28:29 +01:00
Alug ba4c82d381 add splitscreen to screencoords and fix splitscreen for driftgauge 2024-02-25 12:28:27 +01:00
Alug 2e9704067c use SleepEX on windows and set the min sleep duration to 16ms 2024-02-25 04:11:25 +01:00
Alug 046197c9a0 actually disable it for splitscreen for now
its botched and needs fixing
2024-02-24 20:34:37 +01:00
Alug 48f7f411ad dont draw driftgauge when not using chasecam 2024-02-24 20:15:05 +01:00
indev 5eebdec84d Don't need for long there, fixed_t is big enough 2024-02-24 21:21:20 +03:00
indev 51c888a3fb Merge branch 'driftgauge' of ssh://github.com/Indev450/SRB2Kart-Saturn into driftgauge 2024-02-24 21:20:15 +03:00
indev 2cefb00b5d Don't need for long there, fixed_t is big enough 2024-02-24 21:19:57 +03:00
Alug 1d177b6a35 add -1 check for driftgauge too 2024-02-24 19:16:33 +01:00
Alug 6db95fc37b fix conflict 2024-02-24 17:23:47 +01:00
Alug bd2c8969f1 Revert "Refactor Batching code"
This reverts commit 3dcf4f6f64.
2024-02-24 17:23:41 +01:00
Alug 9173bc8ebe disable driftgauge in record attack
it actually gives you an advantage over using other clients
record attack should be fair and even
2024-02-24 15:59:02 +01:00
Alug 0f1accb378 fix compile 2024-02-24 15:50:18 +01:00
Alug 927599432c rename all of those to not conflict with mods 2024-02-24 15:48:48 +01:00
Alug 9f795701e1 I HATE MENUS I HATE MENUS 2024-02-24 15:46:21 +01:00
Alug c7059b3007 lol 2024-02-24 15:46:06 +01:00
Alug 5c6bafd655 fix warning 2024-02-24 15:45:56 +01:00
Alug e491eac956 rename driftgauge cvar and fix nametag rendering bug 2024-02-24 15:45:42 +01:00
Alug 13a2dc1ba3 e 2024-02-24 15:45:33 +01:00
NepDisk 5b29cf8e13 Driftgauge flipcam 2024-02-24 15:44:58 +01:00
Alug 341a38b2e1 Forgot this lol 2024-02-24 15:44:35 +01:00
Alug ae33b411b0 Driftgauge 2024-02-24 15:43:35 +01:00
Alug 7bebb554e9 fix K_GetScreenCoords y clipping 2024-02-24 15:38:55 +01:00
Alug c9cafeefe7 fixeur conflicts i was too lazy too fix lol 2024-02-24 15:35:49 +01:00
Alug d10fb3fb6a rename all of those to not conflict with mods 2024-02-24 15:34:11 +01:00
Alug 5b850f1b49 fix nametag rendering bug 2024-02-24 15:33:50 +01:00
Alug 9b4f051312 this aswell 2024-02-23 01:35:56 +01:00
Alug bcc15011b2 forgor those aswell 2024-02-23 01:28:10 +01:00
Alug 1c8ffe3d90 Merge branch 'Saturn-Next' into win32timer 2024-02-22 23:50:42 +01:00
Alug 634c0e90b8 Merge branch 'Saturn-Next' into speedostuff 2024-02-22 23:50:29 +01:00
Alug 77f355ee77 Merge branch 'Saturn-Next' into maybemobjcrashfixes 2024-02-22 23:50:18 +01:00
Alug 6d28893f85 Merge branch 'Saturn-Next' into nametags 2024-02-22 23:49:43 +01:00
Alug 0e1ada30ab Merge branch 'Saturn-Next' into compilation-warnings-fix 2024-02-22 23:49:24 +01:00
Alug 339aab8540 use the current not old state
also add dont interp precip angle if it doesent change
2024-02-22 23:45:26 +01:00
Alug bee72c4646 remove redundant check 2024-02-22 23:40:30 +01:00
Alug 029597b2c2 Merge pull request #95 from Indev450/gl-noencore-effect-fix
Fix some things regarding Opengl encore visuals
2024-02-22 23:35:00 +01:00
Alug 0b1add2988 one more 2024-02-22 23:27:26 +01:00
Alug cd239b0f35 fix conflicts 2024-02-22 23:26:18 +01:00
Alug eaace5bf74 Merge branch 'Saturn-Next' into gl-noencore-effect-fix 2024-02-22 23:16:54 +01:00
Alug b96fe0a022 those too 2024-02-22 22:53:04 +01:00
Alug c6e0701581 forgor those 2024-02-22 22:46:51 +01:00
Alug 65cb5b265c fix ternary hell for palette rendering lightlevels 2024-02-22 21:41:53 +01:00
Alug 1e50ecb2cd fix ternary hell for palette rendering lightlevels 2024-02-22 21:41:44 +01:00
Alug 1a91060573 dont interpolate unchanging things + remove unused dynslope interp code 2024-02-22 21:04:35 +01:00
Alug 40593f59cf Merge branch 'Saturn-Next' into interpoptimisations 2024-02-22 21:04:12 +01:00
GenericHeroGuy 5d215ea633 Add enums for drawinfo and offsets 2024-02-22 01:19:37 +01:00
GenericHeroGuy e6adc50e2b Replace draw functions with v.getColorHudPatch
More flexible, more extensible
2024-02-22 00:27:51 +01:00
GenericHeroGuy 913b374f9b Lua functions for colorization, offsets, drawing HUD items
Introduce drawinfo_t to pass coords/flags to both hardcode and Lua

* v.getDrawInfo: return X/Y/flags for the given HUD item
* v.drawItemBox: draw the item box, with support for all effects
* v.drawItemMul: draw multi sticker, for convenience
* v.getHudColor: return HUD color
* v.useColorHud: return true if colorization is enabled
* hud.getOffsets: return xoffset/yoffset for the given HUD item
2024-02-21 22:27:17 +01:00
GenericHeroGuy 9362d5abd4 Add stplyrnum, move to st_stuff 2024-02-21 22:27:17 +01:00
GenericHeroGuy 2fb75f7739 Fix V_SPLITSCREEN on OpenGL
Now matches v_video.c
2024-02-21 22:27:11 +01:00
Alug 8387a00b75 remove R_PointToAngleEx
R_PointToAngle64 does its job better anyways
2024-02-20 21:07:36 +01:00
Alug 1034bde5d1 some fixes 2024-02-20 18:08:38 +01:00
Alug 284a1488a3 Merge branch 'Saturn-Next' into compilation-warnings-fix 2024-02-20 18:08:30 +01:00
Alug 072bb75504 oop 2024-02-20 18:06:13 +01:00
Alug 7deff2bfaa set currenttex to null if it gets an invalid texture id 2024-02-20 18:06:10 +01:00
Alug b02f0fc771 die 2024-02-20 18:05:34 +01:00
NepDisk 23ad0746f1 Nametag sightofline fix 2024-02-19 20:36:12 +01:00
Alug 6fede1a564 add max cap to nametagmaxplayers 2024-02-19 19:03:00 +01:00
NepDisk 8e2b208912 Remove unused functions that were originally added for nametags 2024-02-19 11:13:03 +01:00
NepDisk 957a49248e Fix nametag weight offset for small and minimal 2024-02-19 11:12:30 +01:00
Alug 0d80de55ad Fix nametag limit 2024-02-19 11:12:26 +01:00
Alug 9332f8473d forgor 2024-02-19 01:57:12 +01:00
Alug 35c5881449 remove hpmod stuffs since its not netsafe 2024-02-19 01:54:41 +01:00
Alug e13f58d665 Nametags Rewrites 2
contains netunsafe stuff but easy to remove
2024-02-19 01:54:32 +01:00
NepDisk 0adcdf3441 Nametags Rewrites 2024-02-19 01:54:27 +01:00
Alug 814d125fe0 brap 2024-02-19 01:54:15 +01:00
Alug 1656aee8d3 use this stuff 2024-02-19 01:54:06 +01:00
Alug 16239edf1c fix menu updating + add default to switch 2024-02-19 01:54:00 +01:00
Alug 06f8ea75ff fix menu stuff 2024-02-19 01:53:53 +01:00
Alug 1bc90d22f7 option for small nametags 2024-02-19 01:53:47 +01:00
Alug 85ebbbb3a1 why add the same thing twice? 2024-02-19 01:53:14 +01:00
Alug 22fd967131 also turn this off 2024-02-19 01:53:09 +01:00
Alug 2a10f784cd forgor to comment this out 2024-02-19 01:53:00 +01:00
Alug 26eff18473 Nametags from Chaoskart
https://gitlab.com/Fafabis/kart-chaotic/-/commit/8b4a12e144fbff587ee70c30e7f461900d839650#025e5c90ea9aeb6187b4fe002e0fbb277ef4b33d_7024_7035
2024-02-19 01:52:44 +01:00
Alug 7e6d5db0f2 those are not server commands
idk why i threw them there in the first place but those are not needed at all (or even usefull for that matter) for dedicated servers
also moves some stuff to its group
2024-02-19 00:11:13 +01:00
Alug 0f36c7db1a Merge branch 'Saturn-Next' into interpoptimisations 2024-02-18 23:52:32 +01:00
Alug 3085df1432 fix up colour cube/saturation/gamma
cleans up things, and fixes it not being applied to 3D models and colourmapped sectors when not in palette rendering mode
also adds a new way of handling gamma which can be used if wanted
2024-02-18 20:47:30 +01:00
Alug 418be50ce1 clean up patch drawers a little
esp for software
also Don't blank the screen if the top left pixel of a screen-covering patch is transparent. (Checked via nonzero topdelta for first column)
2024-02-18 20:47:25 +01:00
Alug 7300f36a9b Fix dangling pointer in mapthing after removing mobj 2024-02-17 16:49:59 +01:00
Alug e30b54a149 Fix segfault when removing mobjs while iterating thinglist 2024-02-17 16:49:55 +01:00
Alug e615604adf fix segfaults when damaging mobj with no painstate and when removing source from ShouldDamage 2024-02-17 16:49:50 +01:00
Alug df79e484d8 those too 2024-02-17 16:11:39 +01:00
Alug 46cffe748e forgor 2024-02-17 16:09:50 +01:00
Alug e761bbe361 remove bloat from windows libs + move dlls into dlls folder
+ remove msvc project files since they dont work anyways
2024-02-17 16:04:03 +01:00
Alug 6d6d2b76d2 Merge branch 'Saturn-Next' into speedostuff 2024-02-15 20:25:39 +01:00
Alug e20ca38f6c Merge branch 'Saturn-Next' into win32timer 2024-02-15 20:25:23 +01:00
Alug 2b1d192edd make this save 2024-02-15 20:22:27 +01:00
Alug aa84cc8184 Merge branch 'Saturn-Next' into interpoptimisations 2024-02-15 20:22:20 +01:00
Alug 30d63b7c01 do this again 2024-02-14 17:40:17 +01:00
Alug 59bc9d4814 Revert "remove mobj realscales"
This reverts commit 9f45dabd9c.
2024-02-14 17:36:13 +01:00
Alug ab4fe830fa Revert "move this, remove interp things, and add some comments"
This reverts commit 47c90f63a8.
2024-02-14 17:36:09 +01:00
Alug 065e22adae Revert "forgor"
This reverts commit e4ec7484aa.
2024-02-14 17:36:05 +01:00
Alug d4f2202906 Use po2 patches to fix mipmaps 2024-02-14 12:57:50 +01:00
Alug e4ec7484aa forgor 2024-02-14 12:00:38 +01:00
Alug 47c90f63a8 move this, remove interp things, and add some comments 2024-02-14 12:00:36 +01:00
Alug 9f45dabd9c remove mobj realscales
idk those just seem absolutely useless its literally just an alias for mobj scale
2024-02-14 12:00:33 +01:00
Alug 52d9f7fd06 a? 2024-02-14 11:02:43 +01:00
Alug 3ad62e328b Snap to software lightlevel values when using Paletter renderer
bye bye smooth fades, here i come 32 light levels
2024-02-13 16:53:49 +01:00
Alug d2edcc1170 better comment 2024-02-13 11:16:08 +01:00
Alug d6ed90b2b9 set this to 1440p
also made a new define for use in the png limits so that can stay at 4k. but having both maxvids allocate things for 4k is not a good thing for software renderer, not that anyone would ever want to run it at 4k anyways
2024-02-13 11:15:28 +01:00
Alug 23426b82f1 update SDL2 to v2.30.0 2024-02-12 14:35:13 +01:00
Alug cef9d96a52 update zlib to v1.3.1
update zlib to v1.3.1
2024-02-12 14:34:55 +01:00
Alug 5a5738c162 Merge pull request #103 from Indev450/Saturn-Next-EnumLib
Lua globals library / GLib
2024-02-12 07:37:03 +01:00
Alug 03be5e8118 Merge pull request #102 from Indev450/fix-battle-ending-music
Fix battle playing wrong ending music sometimes
2024-02-12 07:34:32 +01:00
Alug 9079db1a71 Merge pull request #101 from Indev450/ierror-crash-log
If have libbacktrace, write crash reports from I_Error
2024-02-12 07:33:48 +01:00
Alug c1fbd3971d Merge pull request #97 from Indev450/texthings
Texture Related things
2024-02-12 07:33:34 +01:00
indev 1638212ab2 Add transparency flag to record attack input display 2024-02-12 02:15:18 +03:00
Alug 2ebb71fb6c add stuff to menu 2024-02-11 15:21:26 +01:00
Alug 242df89d0e forgor 2024-02-11 15:10:23 +01:00
Alug 088426a654 only interpolate those if we use the stuff that uses them 2024-02-11 15:06:08 +01:00
Alug 8ba926550c only interpolate pitch, roll, slopepitch and sloperoll when using sprite rotation 2024-02-11 14:53:27 +01:00
Alug 4732f95782 toggable mobj subsector interpolation
honestly couldnt spot any difference at all
but R_PointinSubsector is quite expensive so making a toggle seems cool
2024-02-11 14:53:22 +01:00
Alug b0f3b515d2 Add cvar gr_maxinterpdist, which allows to control max distance on which mobjs will be interpolated 2024-02-11 14:53:16 +01:00
Alug f175735366 mobj interp optimization 2024-02-11 14:19:24 +01:00
Alug 45ff86361b a 2024-02-11 13:46:59 +01:00
Alug 858b56d5ae Dont need this
I_GetPrecise Precision already gets the high res windows time anyways
2024-02-11 13:42:19 +01:00
Alug a747e9c7c0 add it here too 2024-02-11 11:26:09 +01:00
Alug 31964b34af oops 2024-02-11 11:26:06 +01:00
Alug 88db48b815 use Windows High Precision Timer on Windows builds
lul may help with frametime and other stuff
2024-02-11 11:26:01 +01:00
indev 53a7a9fa1f Merge branch 'Saturn-Next-EnumLib' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next-EnumLib 2024-02-09 20:40:09 +03:00
indev c6ba2ee0a7 Fix warnings related to boolean glib getters/setters 2024-02-09 20:39:11 +03:00
Alug 8a45a784a0 proper check for colourized speedometer patches 2024-02-09 12:33:58 +01:00
Alug 47f545068a forgor this somehow 2024-02-09 12:19:32 +01:00
Alug 159ee9c41f add achiiro speedometer stuffs 2024-02-09 12:11:20 +01:00
Alug ca9f05272e change x scale a little 2024-02-09 12:10:53 +01:00
Alug 54d8cba549 similar scale to old speedo 2024-02-09 12:10:46 +01:00
Alug 0ce592b0bd ok i can just do it like this lol
now its good finally
2024-02-09 12:10:34 +01:00
Alug a5759b4dbe fix 1 pixel gap
i hate maths
2024-02-09 12:10:22 +01:00
Alug 4997207df2 prep some speedometer stuff 2024-02-09 12:10:13 +01:00
Alug 57eabc80f9 switchable native keyboard input
taken from chaoskart this is completely non invasive
2024-02-09 10:40:39 +01:00
Alug a984476bfc Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Next-EnumLib 2024-02-09 10:20:46 +01:00
Alug 35851483d4 Merge pull request #100 from GenericHeroGuy/ms-startup-crash
Fix master server thread segfaulting on startup
2024-02-09 10:06:55 +01:00
GenericHeroGuy f87efad86b Fix master server thread segfaulting on startup with OpenGL 2024-02-08 18:49:51 +01:00
Alug d3a4dacb6c fix for opengl sprite shadow colour 2024-02-07 09:35:26 +01:00
Alug 567e168a3c split cache functions
seems to fix a few stutters
2024-02-04 23:56:51 +01:00
Alug 0a7f18efe0 Merge branch 'Saturn-Next' into texthings 2024-02-04 23:56:33 +01:00
indev f90a069754 If have libbacktrace, write crash reports from I_Error 2024-02-04 16:12:14 +03:00
Alug e9f8400210 smol cleanup 2024-02-04 07:48:17 +01:00
Alug 7bafdc577b Zzz... 2024-02-04 07:48:12 +01:00
Alug 9a71d806b7 little portal cleanup 2024-02-04 07:47:55 +01:00
Alug 6a3b5cac83 Remove Build2DMipmaps and GLU library stuff
gluBuild2DMipmaps is just broken anyways
and it was the only thing used from the GLU library aswell so can remove things in favor of better solutions
having a pc with opengl 1.4 should be a given by now
2024-02-01 22:24:36 +01:00
Alug 668b99c7f9 add an I_Error for when opengl is started on unsupported hardware or driver 2024-02-01 19:57:32 +01:00
Alug b2b65651d4 move that where it belongs 2024-02-01 04:42:42 +01:00
Alug 5ae85b005a dont need to extra check for this actually 2024-02-01 03:48:23 +01:00
Alug 8a8d997fad fix sprite roll angles in software for sprites with one rotation frame
ofc only when the rotation stuff is set to rotate everything not just the player
also changes that the shadows only rotate on that setting unless someone wants it and wants really dumb checks for it
2024-02-01 03:46:26 +01:00
Alug dacf9eb7ab remove non working fisheye lens code
remnants of birdhouse, this was never finished nor does it work
2024-02-01 03:26:49 +01:00
Alug 4d75e05002 fix software shadow rotation in the worst way possible kek 2024-02-01 03:26:45 +01:00
Alug 6bae725077 make this a little neater 2024-02-01 02:05:55 +01:00
Alug 66961b1097 Buffer API is OpenGL 1.5, so can be used in STATIC_OPENGL
https://git.do.srb2.org/STJr/SRB2/-/commit/623629b04ab72071e6ea4f0c4a3245e6cde72e2c
2024-02-01 02:05:50 +01:00
Alug 580912c335 rotating shadows
uuuuhhh
2024-02-01 01:07:32 +01:00
Alug d581d48714 Merge pull request #96 from Indev450/morenewpalshader
More Palette Rendering things
2024-02-01 00:57:31 +01:00
indev 05aec1cd94 When connecting to server via -connect flag, save ip into lastserver cvar 2024-01-31 18:51:37 +03:00
Alug 53a10d7cba update libopenmpt libs 2024-01-29 18:11:46 +01:00
Alug 9b9620a560 uuuuuuuhhh 2024-01-29 03:56:52 +01:00
Alug 7d92b839aa add "Reset All" button to hud offset menu 2024-01-25 23:02:09 +01:00
Alug 325c452313 remove this since its not needed anymore 2024-01-25 15:15:58 +01:00
Alug 38c9cbc15b more cleanup 2024-01-25 15:14:42 +01:00
Alug 7476dea308 Texture buffer for non RGBA to RGBA conversion 2024-01-25 15:14:15 +01:00
Alug 79be487833 fix merge conflict 2024-01-25 15:14:03 +01:00
Alug 7c368ebc51 Remove 3Dfx and glide things
gr_rounddown toggle did nothing instead the game always resized textures, now it wont, seems like this makes stutters on mapload less
2024-01-25 15:13:53 +01:00
Alug c63142c813 add hw_shaders to cmakelist 2024-01-25 15:06:26 +01:00
Alug 0588442ae2 change this 2024-01-25 15:06:17 +01:00
Alug 79b0b160cb add toggle for custom shaders
it seems better like this, atleast thats how hannu set it up
2024-01-25 15:06:04 +01:00
Alug ce13d4f818 shaderstate should be set here 2024-01-25 15:05:58 +01:00
Alug 51699bfdb5 split hw_shader files 2024-01-25 15:05:52 +01:00
Alug 32d4d288bc OpenGL shader code rearrangement and shader pre-preprocessor
https://git.do.srb2.org/STJr/SRB2/-/commit/de37df1be04e9d1dfb11083a9585eb6ac1761633?merge_request_iid=1516
wew
2024-01-25 15:05:42 +01:00
indev b305759212 Move autoloading to run after everything else is initialized 2024-01-22 23:24:19 +03:00
indev b78d3bb0a8 Force postload for autoloaded character addons 2024-01-22 23:18:53 +03:00
indev a064a9e88e Fix sound, music, and midi music toggles 2024-01-22 10:52:54 +03:00
Alug e2c52c0d14 forgor 2024-01-22 02:52:50 +01:00
Alug 6ab1b09aa8 fix merge conflict 2024-01-21 16:44:36 +01:00
Alug 2b38cb2f1c simplify this uuh 2024-01-21 16:44:13 +01:00
Alug 4c6964590d i hate this so i just make it a boolean
confused the heck outta me so just do it like this lmao
2024-01-21 16:44:06 +01:00
indev 7984f57b73 Remove debug print 2024-01-21 17:45:09 +03:00
indev b79a05f25b Fix freeing sounds that aren't actually replaced 2024-01-21 17:44:51 +03:00
Alug 7dfad132dd grr 2024-01-20 17:24:20 +01:00
Alug 193248b71c oops 2024-01-20 17:03:12 +01:00
Alug db5ada9fa0 cleanup s_sound a little + fix onchanges 2024-01-20 17:01:56 +01:00
Alug f41d7e9e97 make NO_MIDI=0 compile 2024-01-20 16:52:54 +01:00
Alug 8d43f6144a make some things static + remove cdmusic leftovers 2024-01-20 15:45:01 +01:00
Alug 442c8e59a1 make sound precaching useful at all
so it also precaches addon sounds and all
thx indev for help <3
2024-01-20 15:44:58 +01:00
Alug ef08db8d89 fix issues with sound precaching
adds a check if sounds have been previously loaded already

also makes it useful at all by not freeing soundsfx data on each mapload when its enabled

also adds an onchange so toggling it either caches all sounds again or frees them
2024-01-20 13:58:24 +01:00
Alug 1d5c635556 Merge branch 'Saturn-Next' into morenewpalshader 2024-01-19 19:59:32 +01:00
Alug 27c8f3a8b4 change gr_shadersavailible
hopefully a little safer + remove killshader call since that function is empty and does nothing
2024-01-19 19:37:00 +01:00
Alug 9725a9d9a5 Fix blackscreen on start + some other changes
move a few things around in HWR_Startup so they only get called on startup
2024-01-19 19:23:49 +01:00
indev 89b1c316e2 Merge branch 'Saturn-Next' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2024-01-19 13:03:00 +03:00
hayaunderscore 88b51c9901 Fix dumb saturn credits crash 2024-01-19 13:02:44 +03:00
Alug a79a5db793 smol stuffs 2024-01-19 00:39:32 +01:00
Alug d0d2a3d0a1 Add toggle for horizonlines 2024-01-18 20:54:59 +01:00
Alug fc2a0846cb Add toggle for horizonlines 2024-01-18 20:54:10 +01:00
Alug 00dbd08641 remove the extra screentex and apply palshader directly to finaltex
theres basically barely any difference, even in the fades theres very little, and it just cost so freaking much performance

however, ill keep the revamped screentex setup as this it allows us to keep the better fadescreen background for menus
2024-01-18 17:03:16 +01:00
Alug e77a4d4690 readd oldpal
for performance reasons its better
2024-01-18 17:03:12 +01:00
Alug d370b59777 do this a little better 2024-01-18 17:03:05 +01:00
Alug 241108abc2 ensure consistent shader state 2024-01-18 17:03:00 +01:00
Alug d7fe3272e2 Light table support for HWR_FadeScreenMenuBack 2024-01-18 17:02:47 +01:00
Alug cc317cb28e remove gr_oldpal for now 2024-01-18 17:02:39 +01:00
Alug 2a0e2f76f1 paletterenderer screentex stuff again
this didnt really work like it shouldve
so ill keep it here for now
2024-01-18 17:02:34 +01:00
Alug 5cec34e8d9 fix lighttable batching for new batching and palshader code 2024-01-18 16:56:59 +01:00
Alug 8c1febd1b9 Merge branch 'Saturn-Next' into batching-stuff 2024-01-18 16:53:40 +01:00
Alug 1ff9bae55c use fudges from newer paletter shader 2024-01-18 16:49:44 +01:00
indev db7ffbff41 Merge pull request #92 from Indev450/planestuff2
Software Plane cleanup + support of tilted water ripple
2024-01-18 18:46:12 +03:00
indev 9e78fb88b7 Merge pull request #88 from Indev450/gammastuff
Rework of Gamma stuff + Addition of the Colour Cube and Advanced Colour Settings
2024-01-18 18:41:03 +03:00
indev fd1177b6e5 Merge branch 'Saturn-Next' into gammastuff 2024-01-18 18:40:51 +03:00
indev d14b1ee4a6 Merge pull request #86 from Indev450/newpalshader
Rework Palette Rendering
2024-01-18 18:28:19 +03:00
Alug 9a8d6efcd7 make thundershield follow player offset
this allows the to stay on the player when saltyhopping etc.
2024-01-18 15:34:19 +01:00
Alug 3dcf4f6f64 Refactor Batching code
from Hannu Hanhi
https://git.do.srb2.org/STJr/SRB2/-/commit/707687beea50a2bfcc14638e923ac516195351b1?merge_request_iid=1774
2024-01-17 18:31:36 +01:00
Alug d071f52707 fix typo 2024-01-17 18:15:54 +01:00
indev 7a0adbc30b Merge pull request #93 from Indev450/crash-log-mention
Mention the crashlog.txt on the crash window
2024-01-17 16:50:19 +03:00
indev 6d642b124a Fix typo 2024-01-17 16:48:11 +03:00
Alug 7d9510b315 Fix vibing slope planes 2024-01-17 12:37:09 +01:00
Alug c80c754f45 Plane optimization and cleanup
sned help

https://git.do.srb2.org/STJr/SRB2/-/commit/c07c80fd9e626f15b4d84d1766f8963e089d295a
2024-01-17 12:37:05 +01:00
Alug 0b1c3f2f67 Move water ripple spanfunc out of r_plane + tilted water support
idk man
2024-01-17 12:36:58 +01:00
Alug 69c1f9164b use malloc here 2024-01-17 12:36:54 +01:00
indev b7ef5e0931 Merge pull request #91 from Chearii/Saturn-Next
``v.getSpritePatch`` from 2.2
2024-01-17 14:18:22 +03:00
Alug b9115aa5f8 (hopefully) fix overflow in R_DrawRepeatMaskedColumn
well this fixes the game hanging in software renderer on Marsh´s Marble Zone
2024-01-17 12:11:42 +01:00
Chearii 83c5618cb7 Add some labeling 2024-01-16 15:01:08 -05:00
Chearii c6faf8e6a2 Player sprite support. 2024-01-16 14:47:48 -05:00
Chearii 68354baf28 Add `getSpritePatch` 2024-01-16 13:46:30 -05:00
Alug 8f6cc895a0 fix ogl shearing with flipcam 2024-01-16 16:22:40 +01:00
Alug a0eab7d5f8 Revert "invert encore remap is 12 not 15?"
This reverts commit 8e6023d850.
2024-01-16 07:17:05 +01:00
Alug 6346ac0a96 Revert "invert encore remap is 12 not 15?"
This reverts commit 8e6023d850.
2024-01-16 07:11:43 +01:00
Alug 1b7870e905 Merge branch 'Saturn-Next' into newpalshader 2024-01-15 20:23:59 +01:00
Alug e2a4fdc395 Revert "Localskins on replays"
This reverts commit e1f821e121.
2024-01-15 15:57:17 +01:00
Alug 3eb8886890 remove Shader_Load as Shader_SetUniforms literally did the same thing 2024-01-15 15:16:01 +01:00
Alug 5e0fe497f5 add stuff here too 2024-01-15 14:27:01 +01:00
Alug 35e8d54fc4 oopsie 2024-01-15 14:21:38 +01:00
Alug 08e5b4844e fix palshader 2024-01-15 13:59:43 +01:00
Alug 7edfdf9325 forgor 2024-01-15 13:47:13 +01:00
Alug d5fdd60fed replace karts batching with srb2s batching
currently palette renderer does not work
may need to try it with the reworked
2024-01-15 13:35:17 +01:00
Alug 48320b5f96 this can be static 2024-01-15 08:59:37 +01:00
Alug be3a57c8ab proper big room fix
no idea what i was doing here, pointtoangle64 does all we need, no need for a hacky 64bit pointtoangleex
2024-01-15 08:59:04 +01:00
Alug 2093bf27b9 clean up drawfill transparency 2024-01-15 08:12:40 +01:00
Alug a36e633555 Revert "Optimize HWR_RenderBatches polygon sorting"
This reverts commit 5201ccd6d2.
2024-01-14 23:49:48 +01:00
Alug 79a594f6ee tooltips greenres fixed by nepdisk c: 2024-01-14 22:57:00 +01:00
Alug d2bf2bc581 forgor 2024-01-14 22:53:20 +01:00
Alug c1223d767d remove this hacky stuff, just dont interpolate it
it barely looked any better, it was actually just faster than it shouldve been
2024-01-14 22:39:50 +01:00
Alug d10c5fef2a remove gr_vhseffect cvar
the vhs effect can be toggled off in opengl with cv_vhseffect anyways, so having cvars to do the same thing is kinda unecessary
2024-01-14 22:30:27 +01:00
Alug 2ffe7aa854 use hwr_drawpatch to fix compiler warning and casting wrong things 2024-01-14 22:13:30 +01:00
Alug d0761d0044 background for missing 4th player screen in 4 player splitscreen
just like software does c:
2024-01-14 21:29:14 +01:00
indev fe868a74d2 Merge branch 'Saturn-Next' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2024-01-14 18:04:42 +03:00
indev 76a233148b Restore old speedometer offset cvar names
Changed from "speed" to "spdm" in refactor accidently oops
2024-01-14 18:03:20 +03:00
hayaunderscore e1f821e121 Localskins on replays 2024-01-14 14:18:01 +01:00
Alug 9c6f720f11 Revert "change this"
This reverts commit 25bc55730e.
2024-01-14 14:14:54 +01:00
indev c45aec4634 Merge pull request #87 from riomccloud/patch-1
Delete org.srb2.SRB2Kart-Saturn.metainfo.xml
2024-01-13 20:04:37 +03:00
riomccloud 7e11bbb5ca Delete org.srb2.SRB2Kart-Saturn.metainfo.xml 2024-01-13 12:18:45 -03:00
Alug 2520626082 more cleanup of things i missed 2024-01-13 13:12:55 +01:00
indev 0a6a40741b Don't reload addfilelocal'd files if md5 matches 2024-01-12 14:55:40 +03:00
indev b7ffaf4243 Warn about possible crash for vanilla when failing to spawn mapthing 2024-01-11 20:13:13 +03:00
Alug 5e3b6a753e update some comments 2024-01-11 12:30:29 +01:00
Alug e03a17869e add some comments 2024-01-11 12:27:10 +01:00
Alug a1f7914c5e more cleanup 2024-01-11 09:51:58 +01:00
Alug d2a361c250 remove unecessary glActiveTexture calls 2024-01-11 09:06:23 +01:00
Alug b082f71ca7 change this back 2024-01-11 08:42:56 +01:00
Alug cdef315866 fix software more crash 2024-01-11 01:09:51 +01:00
Alug ad87f7f895 dont initialize this to 1
oopsie
2024-01-11 00:51:19 +01:00
Alug f5b4d7c314 small cleanup 2024-01-11 00:39:20 +01:00
Alug f7b8c5b3ac move this 2024-01-10 14:16:09 +01:00
Alug fc34fd708c fix lighttable batching issues
ugh
2024-01-10 14:14:46 +01:00
Alug 61897cdc4a bleh 2024-01-10 13:40:14 +01:00
Alug 1be27dc868 more smol changes 2024-01-10 13:38:30 +01:00
Alug 558963c57c Use GL_LUMINANCE8 for 3d palette lookup texture on OpenGL versions older than 3.0 2024-01-10 13:27:25 +01:00
Alug fba1c11861 fix 2d draw brightness issue + fix some other things 2024-01-10 13:26:29 +01:00
Alug 2c69f67d39 Decrease the amount of texture clearing when switching palette rendering state 2024-01-10 12:53:38 +01:00
Alug f4ded02c23 change some thing + cleanup
also changed added nearestpalettecolor
its entirely backwards compat
but works better for the pal lookup in pal rendermode
2024-01-10 12:48:13 +01:00
Alug bb24b767a6 we need this stuff but do it like new palshader 2024-01-10 10:57:29 +01:00
Alug 0ef4edc257 Fix Pal water shader
TODO: make this not half the pal shader again
2024-01-10 10:48:59 +01:00
Alug f8979ed80a forgor 2024-01-10 10:47:05 +01:00
Alug 3635d4adb1 Fix Flashpal toggle 2024-01-10 10:42:30 +01:00
Alug f3e23ad621 WIP: redo palette rendering
TODO: alot of cleanup from the old
but from quick testing this seems to actually work

tho since we dont have a preprocessor we still have to "switch out" the shaders at runtime

also didnt bother with any special toggles yet

needs alot of testing
2024-01-10 10:10:34 +01:00
Alug 4881471a6a just show text instead of miscoloured boxes 2024-01-09 14:27:13 +01:00
Alug 69ffee271d fix some things 2024-01-09 14:20:01 +01:00
Alug 088c250a19 use og values for pal 2024-01-09 14:19:50 +01:00
Alug 2321e4aa7f use og values for pal 2024-01-09 13:38:35 +01:00
Alug 25bc55730e change this 2024-01-09 12:23:43 +01:00
Alug 57cee31279 change all gamma stuff + add more options and change more things
uhhhhhhhhh
2024-01-09 12:11:42 +01:00
indev c4bb4965e1 Better check for 32 bit windows in I_ReportSignal 2024-01-08 23:35:34 +03:00
indev f1e146906a Mention crash log in crash popup 2024-01-08 23:14:22 +03:00
indev 6304a46c84 Allow setting 'none' or nil to mo.localskin and player.localskin 2024-01-08 19:06:31 +03:00
Alug 32cc37a424 update credits 2024-01-08 09:56:14 +01:00
Alug 7242c3c778 fix compiler warning
ugh
2024-01-08 08:58:55 +01:00
Alug 07481fc2aa sleepy moment 2024-01-08 08:52:20 +01:00
Alug 77577530da menu stuff 2024-01-08 08:50:08 +01:00
Alug 213718d1bd add toggle to be able to either rotate just players or everything
you can either just having Players be rotated on slopes, or every mobj

more customizable and also for performance concerns for some
also some stuff i forgor
2024-01-08 08:34:32 +01:00
Alug 9bf10bf35b make new cvar "spriteroll" for sprite rotation disable
so stuff that uses spriterotation can still be used when slope rotation is toggled off
better for some effects
2024-01-08 08:29:58 +01:00
Alug cb0c75e9a8 dont do anything if sloperoll is disabled
well it still precalcs some things, but only on gamestart which is needed since we cant reeinit sprites everytime we change sloperoll
2024-01-08 08:09:43 +01:00
Alug cf78516c77 use fudge defines + remove wall and floor doom_colormap shader
both are now consilidated ( i have no idea how to spell that) into doom_colormap shader
2024-01-06 08:13:24 +01:00
Alug 39489fc6f1 use srb2´s sky shader
also its finally a defined shader now + move default fragment shader to the top
2024-01-06 08:12:20 +01:00
indev 910e20b542 Fix flipped objects having wrong slope roll angle 2024-01-06 03:13:49 +03:00
Alug 7f78873a8a Merge branch 'Saturn-Next' of https://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2024-01-06 01:07:54 +01:00
Alug 26938c20db fix 3d model offsets when flipped 2024-01-06 01:07:48 +01:00
indev 8562c9ad7d Hide ping when showhud is set to Off 2024-01-06 01:04:46 +03:00
Alug fbe0776b43 fix inline warnings 2024-01-05 22:03:32 +01:00
indev d81640c57e Fix hud offsets for position number, also refactor offsets definition a bit 2024-01-05 19:04:13 +03:00
Alug 619fe7bdaf fix menu fade screen background using wrong things in palshader 2024-01-05 01:24:43 +01:00
Alug 05b74102c0 little changes to palshader
use gl_texture 2 in postprocess like srb2s palshader does it
also disable depthtest for screentextures in palshader mode
2024-01-05 01:24:38 +01:00
Alug 5d699d4cf3 revert this 2024-01-05 01:24:31 +01:00
Alug 17c4a35df5 change order of those 2024-01-05 01:24:23 +01:00
indev 191dfbe1bd forgor 2024-01-03 22:01:36 +03:00
indev 8b06822092 change set_text to set_boolean for cv_amigafilter onchange function 2024-01-03 21:59:55 +03:00
indev e4bef0e3f4 Fix amigafilter 2024-01-03 21:39:17 +03:00
indev d5ccf6cad0 Update org.srb2.SRB2Kart-Saturn.metainfo.xml 2024-01-03 10:43:09 +00:00
indev c755a4d8b6 Not all filenames are at least 256 characters long aaaa 2024-01-03 13:32:06 +03:00
Alug a304229511 Merge pull request #84 from Chearii/Saturn-pitch-roll
Pitch and roll, and slope equivalents
2024-01-02 00:08:59 +01:00
Chearii b55fc95ce8 Remove `camera_tilting from K_RollMobjBySlopes`, and make the divisor a static value 2024-01-01 17:11:25 -05:00
Chearii f2faa87e51 Menu changes and additions.
"Player Distortion" is now "Sprite Distortion" to reflect the additions and changes to the slope-rolling system.
All relevant option names have also been changed.
2024-01-01 14:29:32 -05:00
Chearii d79d754b15 Changes to model rendering
Standard slope rotation is now handled through secondary variables, while the primary ones are used for pitch and roll.
2024-01-01 14:28:02 -05:00
Chearii 1babed3d66 Changes to rotation rendering
Handlers for ``pitch``, ``roll``, and slope equivalents have been added.
2024-01-01 14:26:29 -05:00
Chearii 5ec64e50ef Lots of pitch and roll stuff
``pitch``, ``roll``, slope versions, interpolation, and ``P_RollPitchMobj``
2024-01-01 13:26:17 -05:00
Chearii 793e8bfdcb Add `K_RollMobjBySlopes` and spark and trail rolling 2024-01-01 13:22:56 -05:00
Chearii 7a4d5ac1c1 Add `cv_sparkroll` 2024-01-01 13:21:23 -05:00
indev 09c5baa899 Merge branch 'compilation-warnings-fix' of ssh://github.com/Indev450/SRB2Kart-Saturn into compilation-warnings-fix 2024-01-01 18:48:26 +03:00
indev ea6506f9f4 Remove attrpack from GLPatch_t so its alignment is same as for patch_t 2024-01-01 18:48:19 +03:00
Alug 5dd7e548c0 fix warning in discord.c 2024-01-01 16:22:30 +01:00
Alug b0928f3601 fix compiler error 127
seems like stuff for UPX aint even there or smth

make: upx: No such file or directory
make: [Makefile:610: ../bin/Mingw/Release/srb2kart-saturn.exe] Error 127 (ignored)
2024-01-01 04:23:50 +01:00
Alug 728cf1eca9 switches should have default i think ug 2023-12-31 03:46:07 +01:00
Alug 9a1883cd66 duh 2023-12-31 03:01:03 +01:00
Alug 78ff158cb5 fix %zu warning with PRIuPTR X)
i hope that works lul
2023-12-31 00:03:12 +01:00
indev 02b42e4dbb Revert "Attempt to fix %zu warning"
This reverts commit 82083827ff.
2023-12-31 01:47:31 +03:00
indev 82083827ff Attempt to fix %zu warning 2023-12-31 01:44:41 +03:00
indev 571ea6fbc9 Fix 'missing braces around initializer' warning 2023-12-31 01:15:02 +03:00
indev 8af4a67f5e More warning fixes 2023-12-31 01:01:03 +03:00
Alug 2bc6c77fce noone cares about c90 mixed declarations lmao 2023-12-30 21:51:02 +01:00
indev 87d9f09f72 Fix most of compilation warnings 2023-12-30 16:53:45 +03:00
indev ea49c2a557 Fix 'Add local skins...' position in pause menu for remote admins 2023-12-29 20:58:39 +03:00
indev 772bcf2125 Merge branch 'gl-noencore-effect-fix' of ssh://github.com/Indev450/SRB2Kart-Saturn into gl-noencore-effect-fix 2023-12-27 17:28:45 +03:00
indev 6748d5ad30 Remove unneeded condition for encore remap in opengl renderer (consistency with software renderer) 2023-12-27 17:28:02 +03:00
Alug 81a8fc3daa move this out of gr_backsector 2023-12-27 15:02:57 +01:00
Alug 04ba08a825 move noencore out of fof stuff
idk if this is right lmao
2023-12-27 14:23:40 +01:00
Alug 647641214a try and cleanup sector special comments a little 2023-12-27 13:30:09 +01:00
indev 9eff693d00 Fix noencore effect not working for walls in opengl renderer 2023-12-27 15:18:06 +03:00
Alug 8e6023d850 invert encore remap is 12 not 15?
is it?
2023-12-27 13:11:08 +01:00
Alug ca288b89b3 why do that twice? 2023-12-27 13:10:48 +01:00
indev 0e12ad0189 Fix HWR_DrawFill ignoring transparency levels 10-13 2023-12-24 21:40:15 +03:00
Alug c163f25319 Merge branch 'Saturn-Next' of https://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2023-12-24 18:54:16 +01:00
Alug a926cdf7c1 add translucency support to V_Drawfill
ayeyeerasyedasaedysase

i really hope the software version doesent break aaaaaaaaa
2023-12-24 18:54:10 +01:00
indev 134364eee3 Always load vanilla musicdefs 2023-12-24 20:51:16 +03:00
Alug 142d678e8c oops 2023-12-23 20:42:11 +01:00
Alug 86394e2c43 Merge branch 'Saturn-Next' of https://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2023-12-23 20:36:41 +01:00
Alug 405de4e597 remove asm leftovers - profiling stuff 2023-12-23 20:36:35 +01:00
indev 1a6893289c Remove p5prof.h from src/CMakeLists.txt 2023-12-23 22:29:02 +03:00
indev 3297a885eb Remove args.h from src/CMakeLists.txt 2023-12-23 22:24:13 +03:00
Alug 590440ff82 make palshader a little more accurate 2023-12-22 22:54:33 +01:00
Alug 37187c7753 fix pal water shader 2023-12-22 20:20:06 +01:00
indev 1b8b92925a Add files for flatpak package (by riomccloud) 2023-12-22 15:51:05 +03:00
Alug b87b55ec45 fix compiler warning 2023-12-21 13:42:05 +01:00
Alug 0a38a2fd89 forgor to add ping display stuff to menu
someone pls make a better tooltip i bed ingles
2023-12-21 13:41:52 +01:00
Alug ea3fc8f526 Kart v1.0/srb2 styled fps counter option
this was so much pain for whatever reason lmao
2023-12-21 13:41:13 +01:00
Alug bccc79fe4b Kart v1.0/srb2 ping display option
well i adjusted it a little and made it compatible with the frame ping stuff
just hope the bar stuff is right but seemed so
also changed it so the numbers are right alignent so they dont go out of screen
aaaa
2023-12-21 12:06:31 +01:00
Alug 2a6f551f7a fix compact fps counter screwing up ping counter offsets in tab rankings
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2023-12-21 10:31:45 +01:00
Alug f7f3b6497b fix palshader compiler warning + other stuff
asdfgfagregar
set a gl special state instead of using the boolean in r_opengl
also move hwr_ code out of setshaders
2023-12-21 10:08:57 +01:00
Alug 0dca9f9537 use the bool
brap
2023-12-21 09:22:19 +01:00
Alug d07e7ade4a this does absolutely nothing
leftover from porting musictest
2023-12-21 09:18:20 +01:00
Alug 8dcdbecf0c fix may be unitialized warning 2023-12-21 09:01:27 +01:00
hayaunderscore c7c645de00 Portal code cleanup 2023-12-21 08:27:38 +01:00
hayaunderscore 23c7aaeff2 Some hardware renderer cleanup
GRAH WARNINGS
2023-12-21 08:27:34 +01:00
indev cdde33843e Refactor localskin command a bit, get rid of args.c since it is unused 2023-12-20 22:34:47 +03:00
Alug ca47e2edb7 Merge branch 'Saturn-Next' into Saturn 2023-12-20 18:21:57 +01:00
Alug 54ed45f531 remove pal postprocess shader
it never worked, and isnt the right one to do things anyways
the normal GLSL_PALETTE_FRAGMENT_SHADER already does a good job as a postprocess shader, and works similar to srb2´s newer paletterenderer branch
2023-12-20 17:38:20 +01:00
Alug 6ca2087dbc better wall and floor colormap calc
values taken from based on https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1516
2023-12-20 05:53:36 +01:00
Alug 51166640f5 proper water shader for palette renderer
based on https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1516
2023-12-20 05:15:27 +01:00
Alug ed3b1ea353 use floor light for fog shader
how it should be
2023-12-20 04:02:15 +01:00
Alug 8555d38283 v5.1 2023-12-19 20:54:46 +01:00
Alug d66f7fb369 forgor to add those 2023-12-19 20:20:42 +01:00
Alug 7818f17b27 show localskin option menu in options even when youre host
this is not the pause menu one, but the options one
since some may still want to apply a localskin to a player for some reason
2023-12-19 20:09:48 +01:00
Alug dd833097b3 fix some colour hud stuff not being greyed out if its unavailable 2023-12-19 20:08:20 +01:00
Alug dddb88db92 timeout sticker uses wrong patch 2023-12-19 19:04:05 +01:00
Alug 769d93c7da dont prep shaders if theyre uneeded 2023-12-19 17:38:13 +01:00
indev 661dfde6af Don't print discord username in streamer mode at all since discriminators are not a thing anymore 2023-12-18 22:04:41 +03:00
indev 71dea0161d Only warn about custom master server when failed to connect to it 2023-12-18 14:15:01 +03:00
indev 37e9f54af9 Merge branch 'Saturn-Next' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2023-12-18 02:47:56 +03:00
Alug 5651219d2f Merge branch 'Saturn' into Saturn-Next 2023-12-18 00:47:12 +01:00
indev c544cf9a7c Fix static memory being re-tagged as purgable
Fixes crashes caused by lua-cached patches becoming invalid, may fix other crashes related to that
2023-12-18 02:45:40 +03:00
Alug 69c10365e5 menu stuff is the worst 2023-12-17 21:04:54 +01:00
indev 516f9f4941 Merge branch 'Saturn-Next-EnumLib' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next-EnumLib 2023-11-08 02:12:11 +03:00
indev 7054b8658e Fix sprite freeslots behaving differently from vanilla (same as for MT_ and S_) 2023-11-08 02:01:06 +03:00
Alug 44a4275806 Revert "Cache and reuse removed mobjs when spawning mobjs"
This reverts commit e421c1345b.

accidentally merged this lol
2023-11-07 00:40:34 +01:00
alufolie91 a872756992 Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Next-EnumLib 2023-11-07 00:28:51 +01:00
alufolie91 e421c1345b Cache and reuse removed mobjs when spawning mobjs
from https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2200
2023-11-06 19:51:16 +01:00
alufolie91 52590350fa Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Next-EnumLib 2023-11-06 11:58:25 +01:00
alufolie91 822a55a124 Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Next-EnumLib 2023-11-05 01:21:32 +01:00
Alug 4c5df81dac fixuer localskin stuff
Fixes the Apply to all players and displaying player not working (thx haya c: )

Fixes the Vibrating? player animation speeding up when uncapped in localskinmenu

Make so that the char spin speed respects the setting from saturn options (and add pain support )
2023-11-03 01:22:24 +01:00
indev 0c5a1e95b0 Fix overwriting states too 2023-11-02 21:25:42 +03:00
indev 6c7131ff80 Fix overwriting mobj slots working differently from vanilla 2023-11-02 03:19:10 +03:00
indev db30a53b23 Merge branch 'Saturn-Next-EnumLib' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next-EnumLib 2023-10-31 20:41:38 +03:00
indev 74ee1fcdd8 Fix few warnings related to lua_glib. Get rid of f32 setters/getters since floats aren't used in lua 2023-10-31 20:40:43 +03:00
alufolie91 3ea80bec60 Merge branch 'Saturn-Next' into Saturn-Next-EnumLib 2023-10-30 21:01:06 +01:00
indev 23dce9f5b6 Merge branch 'Saturn-Next-EnumLib' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next-EnumLib 2023-10-30 21:35:53 +03:00
indev 034961c6ed Fix hardcoded actions lookup not working 2023-10-30 21:24:38 +03:00
indev d96389db54 Fix looking up mobj type crashing game 2023-10-30 21:23:55 +03:00
indev 3d1e150b6f Merge pull request #53 from utkumaden/patch-enumlib-fast
[WIP] Patch enumlib to be a bit faster.
2023-10-30 15:06:20 +03:00
indev f59fbf94d3 Remove include for PC_DOS 2023-10-30 14:52:10 +03:00
indev ec897ed7e4 Merge branch 'Saturn-Next' into patch-enumlib-fast 2023-10-30 14:27:06 +03:00
indev 17629ad462 Fix lua state for LUA_EvalMath being recreated multiple times (maybe not the best solution). Also fix segfault in lua_enumlib_mobjtype_get 2023-10-30 14:23:03 +03:00
indev 81c555efd9 Fix battle playing wrong ending music sometimes 2023-10-18 01:35:32 +03:00
xyzzy 96552765c2 Include doomdef.h :') 2023-09-03 17:01:12 +03:00
xyzzy 8420b2414c Change into a look up based system instead of whatever the fuck yanderedev suggested. 2023-09-03 14:43:55 +03:00
xyzzy 49949309df Some fixes and feature additions to glib. 2023-09-02 22:17:18 +03:00
xyzzy 39312ebd4b Merge remote-tracking branch 'upstream/Saturn' into patch-enumlib-fast 2023-09-01 22:20:31 +03:00
xyzzy 511d66c8fa Merge remote-tracking branch 'upstream/Saturn' into patch-enumlib-fast 2023-08-31 23:17:37 +03:00
xyzzy 3f9d64717d Create a Lua globals library. 2023-08-31 23:16:32 +03:00
1434 changed files with 171205 additions and 366589 deletions

No files matched your search

+95 -2
View File
@@ -2,7 +2,7 @@
## mobj.localskin and player.localskin fields
Allow reading and assigning localskins to players. Local skins for other objects aren't supported currently.
Allow reading and assigning localskins.
## mobj.rollsum field
@@ -20,9 +20,102 @@ Changes vote background texture prefix (game looks for PREFIX + "W" or "C" (depe
## hud.add(fn, "vote") and hud.add(fn, "intermission")
Hud hooks for vote screen and intermission screen. They only get drawer (`v`) as argument.
To check if those hooks are available, check if globals FEATURE\_VOTEHUD and FEATURE\_INERMISSIONHUD
To check if those hooks are available, check if globals FEATURE\_VOTEHUD and FEATURE\_INTERMISSIONHUD
exist.
## x, y = hud.getOffsets(item)
Returns the values of the given HUD item's `xoffset`/`yoffset` cvars.
Available for any HUD item with offset cvars.
## x, y, flags = v.getDrawInfo(item)
Returns the X, Y and flags where the given HUD item will be drawn for the current displayplayer.
Available for `item`, `gametypeinfo` and `minimap`.
## patch, colormap = v.getColorHudPatch(item)
Returns the patch and colormap to use for the given HUD item. Colorization is based on the user's settings.
Available for `item` and `itemmul`.
Extra arguments for some items:
### item
* `small`: true for small item box, false for big item box.
* `dark`: true to darken item box. Depends on `darkitembox`.
### itemmul
* `small`: true for small sticker, false for big sticker.
## hudcolor = v.getHudColor()
Returns the displayplayer's HUD color.
## colorize = v.useColorHud()
Returns true if colorization is enabled, false otherwise.
## v.interpolate(true)
Enables HUD interpolation. Each call to a drawing function will have its coordinates interpolated
by assigning an unique ID to every call.
For example, three successive calls to `v.draw` will each have their own ID and interpolation offsets.
Pass `true` to enable interpolation, `false` to disable.
Alternatively, pass a number to enable interpolation with the specified tag.
Tags allow HUD items drawn by the same call to a drawing function to be differentiated.
Valid tags range from 0-255.
For example, when iterating players, use a unique tag for each player to avoid artifacting:
```lua
for p in players.iterate do
-- enable interpolation, using player numbers as the tag
-- every draw will have different interp offsets per player
v.interpolate(#p)
-- doesn't matter for unconditional draws like this one...
v.draw(...)
-- but it does matter if there's a condition!
-- without tags, this patch would warp between players
-- whenever their `someVar` changes
if p.someVar then v.draw(...) end
end
-- don't want interpolation anymore? then disable it
v.interpolate(false)
```
NOTE: The default tag for `true` is 0.
## v.interpLatch(true)
Enables interpolation offset latching. The next call to a drawing function will have its lerp offsets
saved and reused for all following draw calls. Disable with `false` when done.
Interpolation cannot easily "snap" between two points; latching can help overcome this by manually
setting the lerp offsets.
```lua
v.interpolate(true)
-- X coordinate for the HUD item
-- every so often, this will wrap around to zero
local x = (leveltime*4) % 256
-- draw an interpolated patch, but... when X rolls back to zero,
-- the patch will slide all the way across the screen!
v.draw(x, 100, ...)
-- this is where interpLatch comes into play
-- enable latching, then draw an invisible patch,
-- moving at the same speed as the visible patch
-- the exact coordinates don't matter, it just has to move at the right speed
v.interpLatch(true)
v.draw(leveltime*4, 0, v.cachePatch("K_TRNULL"))
-- now we can draw the patch again, and when X becomes zero,
-- it'll snap right back without sliding across the screen
v.draw(x, 150, ...)
-- don't forget to turn off latching!
v.interpLatch(false)
```
When using a custom string drawer, enable this mode to avoid interpolation artifacting when the string changes.
## mobj.spritexscale, mobj.spriteyscale, mobj.spritexoffset, mobj.spriteyoffset, mobj.rollangle, mobj.sloperoll, mobj.rollmodel fields
Same fields as in SRB2 2.2
-2
View File
@@ -1,2 +0,0 @@
/Release
/Debug
-2
View File
@@ -1,2 +0,0 @@
/Win32
/x64
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-576
View File
@@ -1,576 +0,0 @@
; Defines general parameters of the game for which wadfiles are intended.
;
; Name textual name for internal use
; IWAD standard 8.3 base name and extension of main wadfile
; NewMap default name for new map -- dictates format for all maps
; Directory directory in which main wadfile (and game files) reside
; Run command to execute (from the directory) for running a map
[WadGame]
Name=Sonic Robo Blast 2
IWAD=srb2.srb
NewMap=MAP01
Directory=C:\Documents and Settings\Ben\My Documents\srb2
Run=fd\srb2win.exe -file $_Wadfile -warp $_Wadmap
; Defines parameters of the default sector motif created when no motif
; file can be located at startup.
[Default.Sector]
Above=GFZROCK
Main=GFZROCK
Below=GFZROCK
Ceiling=F_SKY1
Floor=FLOOR0_6
CeilingHeight=4096
FloorHeight=0
Lighting=255
; Defines parameters of the default door motif created when no motif
; file can be located at startup.
[Default.Door]
Base=FLAT1
Door=BIGDOOR2
Track=DOORTRAK
Type=1
; Defines parameters of the default stair motif created when no motif
; file can be located at startup.
[Default.Stair]
FloorRunner=GFZROCK
CeilingRunner=GFZROCK
Stairwell=GFZROCK
FloorInc=8
CeilingInc=0
LightingInc=0
; ID used to classify things
; Flags supplies some additional information:
; 0x0001 - indicate thing facing angle
; Red red value for drawing things of said class
; Green green value for drawing things of said class
; Blue blue value for drawing things of said class
; Name textual description of class
[Things.Classes]
0x001 0x0001 255 255 255 Starts
0x002 0x0000 192 0 224 Emeralds
0x003 0x0001 255 0 0 Enemies
0x004 0x0000 255 192 0 Nights Things
0x005 0x0000 0 192 192 Power-Up Monitors
0x006 0x0000 192 0 224 Misc.
0x007 0x0000 192 192 192 Scenery
0x008 0x0000 255 255 0 Mario
0x009 0x0000 255 192 224 Christmas
0x00b 0x0000 0 0 255 Rings
0x00c 0x0000 0 224 0 Springs and Such
; ID used to uniquely identify things in a map
; Class classification (defined above section)
; Size approximate thing size (in map units)
; Sprite name of the sprite to use for display purposes
; Name textual description of thing
[Things.Types]
0x001 1 32 suptd0 Player 01 Start
0x002 1 32 suptd0 Player 02 Start
0x003 1 32 suptd0 Player 03 Start
0x004 1 32 suptd0 Player 04 Start
0xfa1 1 32 suptd0 Player 05 Start
0xfa2 1 32 suptd0 Player 06 Start
0xfa3 1 32 suptd0 Player 07 Start
0xfa4 1 32 suptd0 Player 08 Start
0xfa5 1 32 suptd0 Player 09 Start
0xfa6 1 32 suptd0 Player 10 Start
0xfa7 1 32 suptd0 Player 11 Start
0xfa8 1 32 suptd0 Player 12 Start
0xfa9 1 32 suptd0 Player 13 Start
0xfaa 1 32 suptd0 Player 14 Start
0xfab 1 32 suptd0 Player 15 Start
0xfac 1 32 suptd0 Player 16 Start
0xfad 1 32 suptd0 Player 17 Start
0xfae 1 32 suptd0 Player 18 Start
0xfaf 1 32 suptd0 Player 19 Start
0xfb0 1 32 suptd0 Player 20 Start
0xfb1 1 32 suptd0 Player 21 Start
0xfb2 1 32 suptd0 Player 22 Start
0xfb3 1 32 suptd0 Player 23 Start
0xfb4 1 32 suptd0 Player 24 Start
0xfb5 1 32 suptd0 Player 25 Start
0xfb6 1 32 suptd0 Player 26 Start
0xfb7 1 32 suptd0 Player 27 Start
0xfb8 1 32 suptd0 Player 28 Start
0xfb9 1 32 suptd0 Player 29 Start
0xfba 1 32 suptd0 Player 30 Start
0xfbb 1 32 suptd0 Player 31 Start
0xfbc 1 32 suptd0 Player 32 Start
0x057 1 32 suptd0 CTF Team Start (Red)
0x059 1 32 suptd0 CTF Team Start (Blue)
0x00b 1 32 suptd0 Deathmatch Start
0x1a4 2 20 cemga0 Emerald 1 (Green)
0x1a5 2 20 cemoa0 Emerald 2 (Orange)
0x1a6 2 20 cempa0 Emerald 3 (Pink)
0x1a7 2 20 cemba0 Emerald 4 (Blue)
0x1a8 2 20 cemra0 Emerald 5 (Red)
0x1a9 2 20 cemla0 Emerald 6 (Light Blue)
0x1aa 2 20 cemga0 Emerald 7 (Grey)
0x1ab 2 20 cemka0 Emerald 8 (Master)
0x009 3 40 sposa1 Crawla (Red)
0xbbc 3 40 possa1 Crawla (Blue)
0x02a 3 40 tfogi0 Pop-up Turret
0xbbd 3 40 jetba1 Jetty-Syn Bomber
0x016 3 40 jetga1 Jetty-Syn Gunner
0x03a 3 40 fisha0 Stupid Dumb Unnamed Robofish (tm)
0x047 3 40 detna1 Deton
0x038 3 40 skima0 Skim
0x7d4 3 40 treta1 THZ Turret
0x010 3 80 eggma1 Egg Mobile (Boss 1)
0x7d8 3 80 eggna1 Egg Slimer (Boss 2)
0x015 3 40 ccoma1 Crawla Commander
0x008 3 40 tfogi0 Chaos Mode Enemy Spawn
0x138d 3 40 buzza0 Gold Buzz
0x138e 3 40 rbuza0 Red Buzz
0x034 4 20 dissa0 1024 Axis
0x035 4 20 dissa0 512 Axis
0x03b 4 20 dissa0 2048 Axis
0x03e 4 20 dissa0 1024 Axis (Inverted)
0x00f 4 20 dissa0 512 Axis (Inverted)
0x02d 4 20 dissa0 2048 Axis (Inverted)
0x03d 4 20 dissa0 Axis Transfer
0x02e 4 20 dissa0 Axis Transfer Closest
0x037 4 20 dissa0 Axis Transfer LastToFirst
0x03c 4 20 ndrna1 Ideya Drone
0x039 4 20 hoopa0 Hoop
0x02f 4 20 bon1a0 Circle of Rings
0x7d7 4 20 bon1a0 Circle of Rings (Big)
0x800 4 20 nwnga0 Circle of Wing Logos
0x7da 4 20 nwnga0 Circle of Wing Logos (Big)
0x7fe 4 20 nwnga0 Circle of Rings and Wings
0x7ff 4 20 nwnga0 Circle of Rings and Wings (Big)
0x025 4 20 nwnga0 Wing Logo
0x052 4 20 dissa0 Axis Transfer Condition
0x055 4 20 dissa0 Axis Transfer Condition 2
0xbbf 4 20 npraa0 Super Loop
0xbc0 4 20 nprba0 Drill Refill
0xbc1 4 20 nprca0 Helper
0x019 5 20 shtva0 Super Sneakers
0x023 5 20 whtva0 Whirlwind Shield
0x029 5 20 prupa0 Extra Life
0x030 5 20 yltva0 Attraction Shield
0x7d2 5 20 rdtva0 Inferno Shield
0x7e2 5 20 bktva0 Armageddon Shield
0x7e6 5 20 pinva0 Invincibility
0x7ec 5 20 bltva0 Liquid Shield
0x7db 5 20 srbxa0 Super Ring (10 Rings)
0x7dc 5 20 grbxa0 Silver Ring (25 Rings)
0x04e 5 20 mixua0 Teleporter
0x7d5 5 20 eggba0 Eggman
0xbb8 5 20 quesa0 Random
0x01f 6 20 rflga0 CTF Flag (Red)
0x022 6 20 bflga0 CTF Flag (Blue)
0x7dd 6 20 tokea0 Special Stage Token
0x056 6 20 signd0 End Level Sign
0x021 6 20 bubla0 Air Bubble Patch
0x040 6 20 emera0 Emerald Hunt Location 1
0xbba 6 20 emera0 Emerald Hunt Location 2
0xbb9 6 20 emera0 Emerald Hunt Location 3
0xbbe 6 20 stpta0 Star Post
0x1389 6 20 ppsha0 Push
0x138a 6 20 pplla0 Pull
0x138b 6 20 dissa0 Teleport Destination
0x138f 6 20 dissa0 Cut-Away View
0x043 6 20 dspka0 Ceiling Spike
0x044 6 20 uspka0 Floor Spike
0x017 6 20 spika0 Spikeball (Special Stage)
0x011 6 20 dissa0 Boss Flypoint
0x012 6 20 dissa0 Zoom Tube Waypoint
0x801 6 20 dissa0 Egg Capsule Center
0x033 6 20 lasra0 Laser
0x024 7 20 fwr1b0 GFZ Flower (Normal)
0x046 7 20 fwr2a0 GFZ Sunflower
0x049 7 20 fwr3a0 GFZ Budding Flower
0x04a 7 20 bus1a0 Berry Bush
0x04b 7 20 bus2a0 Bush
0x7f3 7 20 thzpa0 THZ Flower
0x00d 7 20 xms2a0 Palm Tree
0x051 7 20 garga1 Gargoyle
;wtraa0 through wtrha0 are empty sprites, formerly used for the below
0x7ea 7 20 dumba0 Ambient Water SFX 1A (Large)
0x7e8 7 20 dumba0 Ambient Water SFX 1B (Large)
0x7e7 7 20 dumba0 Ambient Water SFX 2A (Medium)
0x7fd 7 20 dumba0 Ambient Water SFX 2B (Medium)
0x053 7 20 dumba0 Ambient Water SFX 3A (Small)
0x7e3 7 20 dumba0 Ambient Water SFX 3B (Small)
0x7e9 7 20 dumba0 Ambient Water SFX 4A (Extra Large)
0x01b 7 20 dumba0 Ambient Water SFX 4B (Extra Large)
0x00e 7 20 dumba0 Random Ambience 1
0x02b 7 20 dumba0 Random Ambience 2
0x031 7 20 chana0 Hanging Chain
0x7d6 7 20 alrma0 THZ Alarm
0x7d1 7 20 fwr4a0 CEZ Flower
0x018 7 20 flama0 CEZ Torch
0x7d3 7 20 dissa0 Light Source (MAP92)
0x2710 8 20 gooma0 Overworld Goomba
0x2711 8 20 bgoma0 Underworld Goomba
0x2712 8 20 mus1a0 Bush (Short)
0x2713 8 20 mus2a0 Bush (Tall)
0x2714 8 20 toada0 Toad
0x2715 8 20 coina0 Coin
0x013 8 20 koopa0 King Bowser
0x00a 8 20 shlla0 Koopa Shell
0x00c 8 20 maxea0 Axe
0x032 8 20 ffwra0 Fire Flower
0x01d 8 20 pumaa0 Puma (Mario Fireball)
0x005 9 20 xms1a0 Pole
0x006 9 20 xms3a0 Snowman
0x00d 9 20 xms2a0 Candy Cane
0x054 11 20 bon1a0 5 Vertical Rings (Yellow Spring)
0x02c 11 20 bon1a0 5 Vertical Rings (Red Spring)
0x04c 11 20 bon1a0 5 Diagonal Rings (Yellow Spring)
0x04d 11 20 bon1a0 10 Diagonal Rings (Red Spring)
0x7de 11 20 bon1a0 Ring
0x045 11 20 homra0 Homing Ring
0xbbb 11 20 raila0 Rail Ring
0x01a 11 20 autra0 Automatic Ring
0x036 11 20 bomra0 Explosion Ring
0x050 11 20 infra0 Infinity Ring
0x138c 12 20 sprba0 Blue Spring
0x01c 12 20 sprya0 Yellow Spring (Up)
0x04f 12 20 sprra0 Red Spring (Up)
0x7df 12 20 yspra1 Yellow Spring (Diagonal Up)
0x026 12 20 rspra1 Red Spring (Diagonal Up)
0x014 12 20 ysuda1 Yellow Spring (Diagonal Down)
0x027 12 20 rsuda1 Red Spring (Diagonal Down)
0x041 12 20 sudya0 Yellow Spring (Down)
0x042 12 20 sudra0 Red Spring (Down)
0x01e 12 20 stemd0 THZ Gas Jet
0x020 12 20 fansa0 THZ Fan
; ID used to classify linedefs
; Name textual description of class
;
; Note: When converting a sector to a door, the linedef types
; available are those in class number two.
[LineDefs.Classes]
0x001 *Important
0x002 Floor Over Floor
0x003 Linedef Executor
0x004 Plane Movement
0x005 Lighting
0x006 Scroll Effects
0x007 Pushers
0x008 Miscellaneous
; ID
; class
; codes
; n does NOT require a tag number
; W walk-over activation
; S switch (triggered by player use)
; G gunfire (pistol, shotgun, chaingun) cross or hit line
; 1 the line may be activated once only
; R potentially repeatable activation
; & affected sectors locked out from further changes
; m monster actions can activate the line's effect
; speed
; (slow=1, medium = 2, fast = 3, turbo = 4)
; time
; texture changes
; description
[LineDefs.Types]
; Commonly used types
0x019 1 - - - - Floor Over Floor: Solid, Opaque, Shadowcasting
0x02d 1 - - - - Floor Over Floor: Water, Translucent
0x010 1 - - - - Colormap
0x001 2 - - - - Crumbling (No Respawn), Floating, Bobbing
0x002 4 - - - - Continuous Floor/Ceiling Mover
0x003 4 - - - - Continuous Floor Mover
0x004 4 - - - - Continuous Ceiling Mover
0x005 5 - - - - Ceiling Lighting
0x006 4 - - - - Continuous Two-Speed Floor/Ceiling Mover
0x007 4 - - - - Continuous Two-Speed Floor Mover
0x008 4 - - - - Continuous Two-Speed Ceiling Mover
0x009 3 - - - - Trigger Linedef Executor (Race Only, Once)
0x00a 3 - - - - Trigger Linedef Executor (CTF Red Team, Continuous)
0x00b 3 - - - - Trigger Linedef Executor (CTF Red Team, Each Time)
0x00c 3 - - - - Trigger Linedef Executor (CTF Blue Team, Continuous)
0x00d 3 - - - - Trigger Linedef Executor (CTF Blue Team, Each Time)
0x00f 3 - - - - Trigger Linedef Executor (No More Enemies, Once)
0x010 5 - - - - Colormap
0x012 8 - - - - Zoom Tube Parameters
0x013 3 - - - - Trigger Linedef Executor (Character Ability, Continuous)
0x014 3 - - - - Trigger Linedef Executor (Character Ability, Each Time)
0x015 3 - - - - Trigger Linedef Executor (Character Ability, Once)
0x018 4 - - - - Instant Ceiling Raise
0x019 2 - - - - Solid, Opaque, Shadowcasting
0x01a 4 - - - - Instant Floor Lower
0x021 2 - - - - Solid, Opaque, Non-Shadowcasting
0x022 2 - - - - Floating, Bobbing
0x023 2 - - - - Crumbling (No Respawn)
0x024 2 - - - - Crumbling (Respawn)
0x025 2 - - - - Crumbling (Respawn), Floating
0x026 2 - - - - Bobbing (Air)
0x027 2 - - - - Crumbling (Respawn), Floating, Bobbing
0x028 2 - - - - Crumbling (Respawn), Bobbing (Air)
0x029 2 - - - - Mario Block
0x02a 2 - - - - Crumbling (No Respawn), Floating
0x02b 4 - - - - Crusher 1 (Ceiling to Floor)
0x02c 2 - - - - Solid, Translucent
0x02d 2 - - - - Water, Translucent
0x02e 2 - - - - Fog Block
0x02f 2 - - - - Half Light Block
0x030 2 - - - - Water, Opaque
0x031 2 - - - - Light Block
0x032 4 - - - - Crusher 2 (Floor to Ceiling)
0x033 2 - - - - Solid, No Sides
0x034 2 - - - - Intangible, Translucent
0x035 2 - - - - Laser Block
0x036 2 - - - - Thwomp Block
0x037 2 - - - - Bustable Block
0x038 2 - - - - Quicksand Block
0x039 2 - - - - Solid, Invisible
0x03a 2 - - - - Intangible, Invisible
0x03b 2 - - - - Intangible from Bottom, Opaque
0x03c 5 - - - - Adjustable Pulsating Light
0x03d 5 - - - - Adjustable Flickering Light
0x03e 2 - - - - Intangible, Opaque
0x03f 8 - - - - Camera Scanner
0x040 8 - - - - Per-Sector Gravity
0x041 8 - - - - Speed Pad
0x042 8 - - - - Flat Alignment
0x043 2 - - - - Intangible, Sides Only
0x044 2 - - - - Adjustable Bobbing (Air)
0x045 2 - - - - Solid, Sides Only
0x046 8 - - - - Ideya Time Modifier
0x047 8 - - - - Custom Exit
0x048 2 - - - - Reverse Adjustable Bobbing (Air)
0x049 8 - - - - Disable Linedef
0x04a 2 - - - - Water, Translucent, No Sides
0x04b 2 - - - - Water, Opaque, No Sides
0x04c 2 - - - - Shatter Block
0x04d 2 - - - - Intangible from Bottom, Translucent, No Sides
0x04e 2 - - - - Spin Bust Block
0x04f 2 - - - - Crumbling (Respawn)
0x050 2 - - - - Crumbling (No Respawn)
0x051 2 - - - - Intangible from Bottom, Translucent
0x052 2 - - - - Intangible from Bottom, Crumbling (Respawn), Translucent
0x053 2 - - - - Intangible from Bottom, Crumbling (No Respawn), Translucent
0x054 2 - - - - Spin Bust Block, Translucent
0x055 6 - - - - Scroll Wall First Side Opposite Direction
0x056 2 - - - - Shatter Block, Translucent
0x057 2 - - - - Custom
0x058 4 - - - - Continuously Falling Sector
0x059 2 - - - - Rising, Solid, Opaque, Shadowcasting
0x05a 2 - - - - Rising, Solid, Opaque, Non-shadowcasting
0x05b 2 - - - - Rising, Solid, Translucent
0x05c 2 - - - - Rising, Intangible from Bottom, Opaque
0x05d 2 - - - - Rising, Intangible from Bottom, Translucent
0x05e 2 - - - - Rising, Solid, Invisible
0x05f 3 - - - - Trigger Linedef Executor (Ring Count, Continuous)
0x060 3 - - - - Trigger Linedef Executor (Continuous)
0x061 3 - - - - Trigger Linedef Executor (Each Time)
0x062 3 - - - - Trigger Linedef Executor (Once)
0x063 3 - - - - Trigger Linedef Executor (Ring Count, Once)
0x064 6 - - - - Scroll Wall First Side Left
0x065 3 - - - - Set Tagged Sector's Floor Height/Pic
0x066 3 - - - - Set Tagged Sector's Ceiling Height/Pic
0x067 3 - - - - Set Tagged Sector's Light Level
0x068 3 - - - - Teleport Player to Tagged Sector
0x069 3 - - - - Change Music
0x06a 3 - - - - Move Tagged Sector's Floor
0x06b 3 - - - - Move Tagged Sector's Ceiling
0x06c 3 - - - - Lower Floor by Line
0x06d 3 - - - - Raise Floor by Line
0x06e 3 - - - - Lower Ceiling by Line
0x06f 3 - - - - Raise Ceiling by Line
0x070 3 - - - - Change Tagged Sector's Tag
0x071 3 - - - - Run Script
0x072 3 - - - - Change Front Sector's Tag
0x073 3 - - - - Play SFX
0x074 3 - - - - Stop Plane Movement
0x075 3 - - - - Fade Light Level
0x076 3 - - - - Stop Lighting Effect
0x077 3 - - - - Start Adjustable Fire Flicker
0x078 3 - - - - Start Adjustable Glowing Light
0x079 3 - - - - Cut-Away View
0x07a 3 - - - - Stop Object
0x07b 3 - - - - Change Sky
0x07c 3 - - - - Change Weather
0x07d 3 - - - - Change Object State
0x07e 3 - - - - Stop Object
0x07f 3 - - - - Award Score
0x080 3 - - - - Start Platform Movement
0x081 3 - - - - Crush Ceiling Once
0x082 3 - - - - Crush Floor Once
0x083 3 - - - - Crush Floor And Ceiling Once
0x084 3 - - - - Enable/Disable 2D Mode
0x085 3 - - - - Enable/Disable Gravity Flip
0x086 3 - - - - Award Power-Up
0x087 3 - - - - Change Plane Scroller Direction
0x088 3 - - - - Shatter FOF
0x089 3 - - - - Disable Player Control
0x08a 3 - - - - Change Object Size
0x08b 3 - - - - Change Tagged Linedef Textures
0x08c 3 - - - - Start Metal Sonic Race
0x08d 3 - - - - Unlockable Trigger
0x08e 3 - - - - Change Object Type State
0x08f 3 - - - - Call Lua Function
0x090 3 - - - - Earthquake
0x096 3 - - - - Execute Linedef Executor (from tag)
0x097 3 - - - - Execute Linedef Executor (random range)
0x0c8 6 - - - - Disp Scroll Ceiling Texture and Carry Objects
0x0c9 6 - - - - Disp Carry Objects on Ceiling
0x0ca 6 - - - - Scroll Ceiling Texture and Carry Objects
0x0cb 6 - - - - Carry Objects on Ceiling
0x0cc 6 - - - - Acc Scroll Ceiling Texture and Carry Objects
0x0cd 6 - - - - Acc Carry Objects on Ceiling
0x0d5 5 - - - - Floor Lighting
0x0d6 6 - - - - Acc Scroll Ceiling Texture
0x0d7 6 - - - - Acc Scroll Floor Texture
0x0d8 6 - - - - Acc Carry Objects on Floor
0x0d9 6 - - - - Acc Scroll Floor Texture and Carry Objects
0x0da 6 - - - - Acc Scroll Wall According to Linedef
0x0df 8 - - - - Friction
0x0e0 7 - - - - Wind
0x0e1 7 - - - - Current
0x0e2 7 - - - - Boom Push/Pull Thing
0x0e3 7 - - - - Upwards Current
0x0e4 7 - - - - Downwards Current
0x0e5 7 - - - - Upwards Wind
0x0e6 7 - - - - Downwards Wind
0x0e8 4 - - - - Activate Floating Platform
0x0e9 4 - - - - Activate Floating Platform (Adjustable Speed)
0x0f2 8 - - - - Fake Floor
0x0f5 6 - - - - Disp Scroll Ceiling Texture
0x0f6 6 - - - - Disp Scroll Floor Texture
0x0f7 6 - - - - Disp Carry Objects on Floor
0x0f8 6 - - - - Disp Scroll Floor Texture and Carry Objects
0x0f9 6 - - - - Disp Scroll Wall According to Linedef
0x0fa 6 - - - - Scroll Ceiling Texture
0x0fb 6 - - - - Scroll Floor Texture
0x0fc 6 - - - - Carry Objects on Floor
0x0fd 6 - - - - Scroll Floor Texture and Carry Objects
0x0fe 6 - - - - Scroll Wall According to Linedef
0x0ff 6 - - - - Scroll Texture by Offsets
[Sectors.Types]
0x001 Blink (random)
0x002 Blink (1/2 second)
0x003 Blink (1 second)
0x004 Spikes
0x005 Death Pit (no camera modifications)
0x006 Space Countdown
0x007 Damage (Fire)
0x008 Light oscillates
0x009 Damage (Special Stage)
0x00a Instant Kill
0x00b Damage (Non-Elemental)
0x00c Blink (1 second synch)
0x00d Blink (1/2 second synch)
0x00e Bouncy Sector (FOF Control Only)
0x010 Death Pit (camera modifications)
0x011 Light flickers like fire
0x012 Damage (Electrical)
0x021 Special Stage Goal
0x100 Ice/Sludge
0x200 Wind/Current
0x207 Damage (Fire) and Current
0x29a Egg Trap Capsule
0x2b2 Button 1 (Open Door A/700 B/701)
0x2b3 Button 2 (Open Door A/702 B/703)
0x2b4 Button 3 (Open Door A/704 B/705)
0x2b5 Button 4 (Open Door A/706 B/707)
0x2b6 Button 5 (Open Door A/708 B/709)
0x2b7 Button 6 (Open Door A/710 B/711)
0x2b8 Button 7 (Open Door A/712 B/713)
0x2b9 Button 8 (Open Door A/714 B/715)
0x2ba Button 9 (Open Door A/716 B/717)
0x2bb Button 10 (Open Door A/718 B/719)
0x2bc Button 11 (Open Door A/720 B/721)
0x2bd Button 12 (Open Door A/722 B/723)
0x2be Button 13 (Open Door A/724 B/725)
0x2bf Button 14 (Open Door A/726 B/727)
0x2c0 Button 15 (Open Door A/728 B/729)
0x2c1 Button 16 (Open Door A/730 B/731)
0x2c2 Button 17 (Open Door A/732 B/733)
0x2c3 Button 18 (Open Door A/734 B/735)
0x2c4 Button 19 (Open Door A/736 B/737)
0x2c5 Button 20 (Open Door A/738 B/739)
0x2c6 Button 21 (THZ2 A/740 B/741 D/742)
0x2c7 Close Door Blazing (Tag 743)
0x300 Ice/Sludge and Wind/Current
0x3c7 Linedef Executor (Emerald Check)
0x3c8 Linedef Executor (NiGHTS Mare)
0x3c9 Super Sonic Transform
0x3ca Check 3DFloors for Linedef Executor
0x3cb Linedef Executor (Pushable Objects)
0x3cc Linedef Executor (No Floor Touch, All Players)
0x3cd Linedef Executor (Floor Touch, All Players)
0x3ce Linedef Executor (No Floor Touch)
0x3cf Linedef Executor (Floor Touch)
0x3d0 Speed Pad (No Spin)
0x3d1 Speed Pad (Spin)
0x3d2 Ring Drainer (Floor Touch)
0x3d3 Spinner
0x3d4 Ring Drainer (No Floor Touch)
0x3d5 Raise Ceiling to Highest (Tag 744)
0x3d6 Exit Sector
0x3d7 Damage (Water)
0x3d8 Damage (Water) and Current
0x3d9 Conveyor Belt
0x3da THZ2 Slime Raise (B/712 S/713 P/714 D/715 S/716)
0x3db No Tag Zone
0x3dc CTF - Red Team Base
0x3dd CTF - Blue Team Base
0x3de Special Stage (Floor=Time) (Ceiling=Rings)
0x3df Custom Gravity
0x3e0 Ramp Sector
0x3e1 Starpost Activator
0x3e2 Finish Line
0x3e4 Non-Ramp Sector
0x3e5 Fan Sector
0x3e6 Zoom Tube Start
0x3e7 Zoom Tube End
0x5dc Bustable Block Sprite ROIA
0x5dd Bustable Block Sprite ROIB
0x5de Bustable Block Sprite ROIC
0x5df Bustable Block Sprite ROID
0x5e0 Bustable Block Sprite ROIE
0x5e1 Bustable Block Sprite ROIF
0x5e2 Bustable Block Sprite ROIG
0x5e3 Bustable Block Sprite ROIH
0x5e4 Bustable Block Sprite ROII
0x5e5 Bustable Block Sprite ROIJ
0x5e6 Bustable Block Sprite ROIK
0x5e7 Bustable Block Sprite ROIL
0x5e8 Bustable Block Sprite ROIM
0x5e9 Bustable Block Sprite ROIN
0x5ea Bustable Block Sprite ROIO
0x5eb Bustable Block Sprite ROIP
-539
View File
@@ -1,539 +0,0 @@
# Yadex game definition file version 4
#
# srb2.ygd
# Yadex Game Definitions for Sonic Robo Blast 2
# See Yadex's doc/ygd.html for the specs.
#
# File made by Alam_GBC.
# Updated by Graue, 2006-06-19
# Yadex has only a few games like "doom2", etc. hardcoded into it.
# Rather than hack the code, since I don't expect to ever edit Doom 2,
# I went into /usr/local/share/games/yadex/1.7.0/ and renamed
# doom2.ygd to doom2_real.ygd, then installed this file as srb2.ygd,
# then made a hard link from doom2.ygd to srb2.ygd; that is:
# ln srb2.ygd /usr/local/share/games/yadex/1.7.0/doom2.ygd
# If you do that, change "iwad2" in yadex.cfg to point to your copy of
# srb2.srb.
# It's not the most beautiful thing to do, but it works. Also, Doom 2
# is the default game, so this way you don't have to do anything
# special when starting Yadex.
# I claim no copyright on this file. -- Graue <graue@oceanbase.org>
level_format doom
level_name map01
picture_format normal
sky_flat sky1
texture_format normal
texture_lumps normal
#
# Definition of linedef type groups
# Format is : ldtgroup <ldtgroup> <description>
#
ldtgroup e "Linedef Executor"
ldtgroup E "3D Floors"
ldtgroup A "Water"
ldtgroup t "Scroll Effects"
ldtgroup x "Misc."
ldtgroup L "Lighting"
ldtgroup l "Pushers"
ldtgroup P "Plane Movement"
#
# Definition of linedef types
# Format is : ldt <number> <ldtgroup> <shortdesc> <longdesc>
# <shortdesc> must not exceed 16 characters.
#
# Linedef Executor
ldt 00009 e "Trigger(Race1)" "Trigger (Race, Once) (1.09)"
ldt 00010 e "Trigger(RedCont)" "Trigger (CTF Red Team, Continuous) (1.09)"
ldt 00011 e "Trigger(RedEach)" "Trigger (CTF Red Team, Once per Floor Touch) (1.09)"
ldt 00012 e "Trigger(BluCont)" "Trigger (CTF Blue Team, Continuous) (1.09)"
ldt 00013 e "Trigger(BluEach)" "Trigger (CTF Blue Team, Once per Floor Touch) (1.09)"
ldt 00015 e "Trigger(NoEnemy)" "Trigger (Once when no more enemies) (1.09)"
ldt 00019 e "Trigger(ChrCont)" "Trigger (Character Ability, Continuous) (1.09)"
ldt 00020 e "Trigger(ChrEach)" "Trigger (Character Ability, Once per Floor Touch) (1.09)"
ldt 00021 e "Trigger(Chr1)" "Trigger (Character Ability, Once) (1.09)"
ldt 00095 e "Trigger(RngCont)" "Trigger (Ring Count, Continuous) (1.09)"
ldt 00096 e "Trigger (Cont)" "Trigger (Continuous)"
ldt 00097 e "Trigger (Each)" "Trigger (Once per Floor Touch)"
ldt 00098 e "Trigger (1)" "Trigger (Once)"
ldt 00099 e "Trigger (Rng1)" "Trigger (Ring Count, Once) (1.09)"
ldt 00101 e "Set Floor" "Set Tagged Sector's Floor Height/Flat"
ldt 00102 e "Set Ceiling" "Set Tagged Sector's Ceiling Height/Flat"
ldt 00103 e "Set Light Level" "Set Tagged Sector's Light Level"
ldt 00104 e "Teleport to" "Teleport to Tagged Sector"
ldt 00105 e "Music Change" "Music Change"
ldt 00106 e "Move Floor by FS" "Move Floor by Front Sector (Length=Speed)"
ldt 00107 e "Move Ceil. by FS" "Move Ceiling by Front Sector (Length=Speed)"
ldt 00108 e "Lower Flr by Ld" "Lower Floor by Line (dx=speed, dy=amount)"
ldt 00109 e "Raise Flr by Ld" "Raise Floor by Line (dx=speed, dy=amount)"
ldt 00110 e "Lower Ceil by Ld" "Lower Ceiling by Line (dx=speed, dy=amount)"
ldt 00111 e "Raise Ceil by Ld" "Raise Ceiling by Line (dx=speed, dy=amount)"
ldt 00112 e "Change Clg/T Tag" "Change Calling Sector's Tag (Change Tagged Sector's Tag in 1.09)"
ldt 00113 e "Run Script" "Run Script"
ldt 00114 e "Change FS Tag" "Change Front Sector's Tag"
ldt 00115 e "Play SFX" "Play SFX"
ldt 00116 e "Stop Plane Move" "Stop Plane Movement"
ldt 00117 e "Fade Light to FS" "Fade Light Level to Front Sector (Length=Speed)"
ldt 00118 e "Stop Light FX" "Stop Lighting Effect"
ldt 00119 e "Start Fire Flckr" "Start Adjustable Fire Flicker"
ldt 00120 e "Start Pulsate" "Start Adjustable Pulsating Light"
ldt 00121 e "Cut-Away View" "Cut-Away View"
ldt 00122 e "Stop Object" "Stop Object"
ldt 00123 e "Change Sky" "Change Sky (1.09)"
ldt 00124 e "Change Weather" "Change Weather (1.09)"
ldt 00125 e "Change Obj State" "Change Object State (1.09)"
ldt 00126 e "Award Score" "Award Score (1.09)"
ldt 00127 e "Start Platf Mvmt" "Start Platform Movement"
# 3D Floors/Blocks
ldt 00001 E "CrumBobFlt NoRet" "Crumbling Floating Bobbing FOF (Never Reappears)"
ldt 00025 E "FOFSoliOpaquShad" "FOF (Solid, Opaque, Shadows)"
ldt 00033 E "FOFSolOpaqNShado" "FOF (Solid, Opaque, No Shadows)"
ldt 00034 E "BobbingFOFWater" "Bobbing Platform (Water)"
ldt 00035 E "CrumblingFOFNRea" "Crumbling FOF (Never Reappears)"
ldt 00036 E "CrumblingFOFReap" "Crumbling FOF (Reappears)"
ldt 00037 E "CrumblingFOFRaps" "Crumbling Floating FOF (Reappears)"
ldt 00038 E "BobbingFOF(Air)" "Bobbing FOF (Air)"
ldt 00039 E "CrumBobbFOF(Rep)" "Crumbling Floating Bobbing FOF (Reappears)"
ldt 00040 E "CrumBobbFOF(Air)" "Crumbling Bobbing FOF (Air)"
ldt 00041 E "Mario Block" "Mario Block"
ldt 00042 E "CrumblingFOF(NR)" "Crumbling Floating FOF (Never Reappears)"
ldt 00044 E "FOFSolidTransluc" "FOF (Solid, Translucent)"
ldt 00046 E "Fog Block" "Fog Block"
ldt 00047 E "Light Block" "Light Block"
ldt 00049 E "2x Light Block" "Double Light Block"
ldt 00051 E "FOFSolid,NoSides" "FOF (Solid, No Sides)"
ldt 00052 E "FOFIntangTranslu" "FOF (Intangible, Translucent)"
ldt 00053 E "Laser Block" "Laser Block"
ldt 00054 E "Thwomp Block" "Thwomp Block"
ldt 00055 E "Bustable Block" "Bustable Block"
ldt 00056 E "Quicksand Block" "Quicksand Block"
ldt 00057 E "FOFSolidInv" "FOF (Solid, Invisible)"
ldt 00058 E "FOFIntangiInvisi" "FOF (Intangible, Invisible)"
ldt 00059 E "Platform" "Platform"
ldt 00062 E "FOFIntangibOpaqu" "FOF (Intangible, Opaque)"
ldt 00067 E "FOFIntaSidesOnly" "FOF (Intangible, Sides Only)"
#removed: ldt 00068 E "AdjBobbFOF(Air)" "Adjustable Bobbing FOF (Air)"
ldt 00069 E "FOFSoliSidesOnly" "FOF (Solid, Sides Only)"
#removed: ldt 00072 E "RevAdjBobFOFAir" "Reverse Adjustable Bobbing FOF (Air)"
ldt 00076 E "Shatter Block" "Shatter Block"
ldt 00077 E "Platf (Trnsl-NS)" "Platform (Translucent, No Sides)"
ldt 00078 E "Spin Bust Block" "Spin Bust Block"
ldt 00079 E "CrumblPlatf(Rep)" "Crumbling Platform (Reappears)"
ldt 00080 E "CrumblPlat(NRep)" "Crumbling Platform (Never Reappears)"
ldt 00081 E "Platform (Trnsl)" "Platform (Translucent)"
ldt 00082 E "CrmPlt(Trns,Rep)" "Crumbling Platform (Translucent, Reappears)"
ldt 00083 E "CrmPlt(Trs,NRep)" "Crumbling Platform (Translucent, Never Reappears)"
ldt 00084 E "SpinBust (Trnsl)" "Spin Bust Block (Translucent)"
ldt 00086 E "Shatter (Trnsl.)" "Shatter Block (Translucent)"
ldt 00087 E "Custom FOF" "Custom FOF (1.09)"
ldt 00089 E "Rising FOF Shado" "Rising FOF (Solid, Opaque, Shadows) (1.09)"
ldt 00090 E "Rising FOF NShad" "Rising FOF (Solid, Opaque, No Shadows) (1.09)"
ldt 00091 E "Rising FOF Trnsl" "Rising FOF (Translucent) (1.09)"
ldt 00092 E "Rising Plat Opaq" "Rising Platform (Opaque) (1.09)"
ldt 00093 E "Rising Plat Trsl" "Rising Platform (Translucent) (1.09)"
ldt 00094 E "Rising FOF SlInv" "Rising FOF (Solid, Invisible) (1.09)"
# Water
ldt 00045 A "Water (Transl.)" "Water (Translucent)"
ldt 00048 A "Water (Opaque)" "Water (Opaque)"
ldt 00074 A "Water (Trnsl-NS)" "Water (Translucent, No Sides)"
ldt 00075 A "Water (Opaq-NS)" "Water (Opaque, No Sides)"
# Scroll Effects
ldt 00085 t "Scr Wl Front Opp" "Scroll Wall First Side Opposite Direction"
ldt 00100 t "Scr Wl FrontLeft" "Scroll Wall First Side Left"
ldt 00202 t "Scr&Carry Ceil" "Scroll&Carry Things Sector Ceiling (FOF Conveyor)"
ldt 00203 t "Carry Ceiling" "Carry Things on Sector Ceiling (FOF Conveyor)"
ldt 00214 t "AccScr Ceiling" "Accel Scroll Sector's Ceiling"
ldt 00215 t "AccScr Floor" "Accel Scroll Sector's Floor"
ldt 00216 t "AccCarry Floor" "Accel Carry Things on Floor"
ldt 00217 t "AccScr&Carry Flr" "Accel Scroll Floor & Carry Things"
ldt 00218 t "AccScr Front" "Accel Scroll 1st Side Tagged Line"
ldt 00245 t "RemScr Ceiling" "Remote Scroll Sector's Ceiling"
ldt 00246 t "RemScr Floor" "Remote Scroll Sector's Floor"
ldt 00247 t "RemCarry Floor" "Remote Carry Things on Floor"
ldt 00248 t "RemScr&Carry Flr" "Remote Scroll Floor & Carry Things"
ldt 00249 t "RemScr Front" "Remote Scroll 1st Side Tagged Line"
ldt 00250 t "Scroll Ceiling" "Scroll Sector's Ceiling"
ldt 00251 t "Scroll Floor" "Scroll Sector's Floor"
ldt 00252 t "Carry on Floor" "Carry Things On Sector Floor"
ldt 00253 t "Scroll&Carry Flr" "Scroll&Carry Things Sector Floor"
ldt 00254 t "Scroll Front" "Scroll First Side of Tagged Line"
ldt 00255 t "Scroll by Offset" "Effect Scrolling From XY Offsets"
# Misc.
ldt 00018 x "Zoom Tube Params" "Zoom Tube Parameters (1.09)"
ldt 00063 x "Camera Scanner" "Camera Scanner"
ldt 00064 x "Sector Gravity" "Per-Sector Gravity"
ldt 00065 x "Speed Pad" "Speed Pad"
ldt 00066 x "Flat Alignment" "Flat Alignment"
ldt 00070 x "IdeyaTimeModify " "Ideya Time Modifier"
ldt 00071 x "Custom Exit" "Custom Exit"
ldt 00073 x "Disable Linedef" "Disable Linedef (main game only)"
ldt 00223 x "Friction" "Friction (Ice>100, Sludge<100)"
ldt 00242 x "Fake Floor" "Fake Floor"
# Lighting
ldt 00005 L "Ceiling Lighting" "Ceiling Lighting"
ldt 00016 L "Colormap" "Colormap"
ldt 00060 L "AdjPulsLight" "Adjustable Pulsating Light"
ldt 00061 L "AdjFlickLight" "Adjustable Flickering Light"
ldt 00213 L "Floor Lighting" "Floor Lighting"
# Plane Movement
ldt 00002 P "ContMover F/C" "Continuous Floor/Ceiling Mover"
ldt 00003 P "ContMover Floor" "Continuous Floor Mover"
ldt 00004 P "ContMover Ceilng" "Continuous Ceiling Mover"
ldt 00006 P "Cont2Mover F/C" "Continuous 2-Speed Floor/Ceiling Mover"
ldt 00007 P "Cont2Mover Floor" "Continuous 2-Speed Floor Mover"
ldt 00008 P "Cont2Mover Ceilg" "Continuous 2-Speed Ceiling Mover"
ldt 00024 P "InstCeilingRaise" "Instant Ceiling Raise"
ldt 00026 P "InstFloorLower" "Instant Floor Lower"
ldt 00043 P "Crusher 1 (C2F)" "Crusher 1 (Ceiling to Floor)"
ldt 00050 P "Crusher 2 (F2C)" "Crusher 2 (Floor to Ceiling)"
ldt 00088 P "Continuous Fall" "Continuously Falling Sector (1.09)"
ldt 00232 P "FloatingPlatform" "Floating Platform"
ldt 00233 P "FloatPFAdjuSpeed" "Floating Platform Adjustable Speed"
# Pushers
ldt 00224 l "Wind Force/Dir" "Wind Force/Direction"
ldt 00225 l "Water Force/Dir" "Water Current Force/Direction"
ldt 00226 l "Boom Push/Pull" "Boom Push/Pull Thing"
ldt 00227 l "Upwards Current" "Upwards Current"
ldt 00228 l "DownwardsCurrent" "Downwards Current"
ldt 00229 l "Upwards Wind" "Upwards Wind"
ldt 00230 l "Downwards Wind" "Downwards Wind"
#
# Definition of sector types
# Format is : st <number> <shortdesc> <longdesc>
# <shortdesc> must not exceed 14 characters.
#
st 00000 "X Normal" "X Normal"
st 00001 "Blink random" "Blink (random)"
st 00002 "Blink halfsec" "Blink (1/2 second)"
st 00003 "Blink oneasec" "Blink (1 second)"
st 00004 "Spikes of Doom" "Spikes"
st 00005 "DeathPit (ncm)" "Death Pit (no camera modifications)"
st 00006 "SpaceCountdown" "Space Countdown"
st 00007 "Fire Damage" "Damage (Fire)"
st 00008 "Lightoscilates" "Light oscillates"
st 00009 "SS Damage" "Damage (Special Stage)"
st 00010 "Instant Kill" "Instant Kill"
st 00011 "Normal Damage" "Damage (Non-elemental)"
st 00012 "Blinks oneasec" "Blink (1 second synch)"
st 00013 "Blinks hafasec" "Blink (1/2 second synch)"
st 00014 "FOF Bouncy Con" "Bouncy Sector (FOF Control Only)"
st 00016 "DeathPit (wcm)" "Death Pit (camera modifications)"
st 00017 "Lightslikefire" "Light flickers like fire"
st 00018 "Elec Damage" "Damage (Electrical)"
st 00256 "Ice/Sludge" "Ice/Sludge"
st 00512 "Wind/Current" "Wind/Current"
st 00680 "EggCapsule But" "Egg Capsule (Button)"
st 00681 "EggCapsule Top" "Egg Capsule (Top)"
st 00682 "EggCapsule Bot" "Egg Capsule (Bottom)"
st 00683 "EggCapsule Cen" "Egg Capsule (Center)"
st 00690 "Button 01" "Button 1 (Open Door A/700 B/701)"
st 00691 "Button 02" "Button 2 (Open Door A/702 B/703)"
st 00692 "Button 03" "Button 3 (Open Door A/704 B/705)"
st 00693 "Button 04" "Button 4 (Open Door A/706 B/707)"
st 00694 "Button 05" "Button 5 (Open Door A/708 B/709)"
st 00695 "Button 06" "Button 6 (Open Door A/710 B/711)"
st 00696 "Button 07" "Button 7 (Open Door A/712 B/713)"
st 00697 "Button 08" "Button 8 (Open Door A/714 B/715)"
st 00698 "Button 09" "Button 9 (Open Door A/716 B/717)"
st 00699 "Button 10" "Button 10 (Open Door A/718 B/719)"
st 00700 "Button 11" "Button 11 (Open Door A/720 B/721)"
st 00701 "Button 12" "Button 12 (Open Door A/722 B/723)"
st 00702 "Button 13" "Button 13 (Open Door A/724 B/725)"
st 00703 "Button 14" "Button 14 (Open Door A/726 B/727)"
st 00704 "Button 15" "Button 15 (Open Door A/728 B/729)"
st 00705 "Button 16" "Button 16 (Open Door A/730 B/731)"
st 00706 "Button 17" "Button 17 (Open Door A/732 B/733)"
st 00707 "Button 18" "Button 18 (Open Door A/734 B/735)"
st 00708 "Button 19" "Button 19 (Open Door A/736 B/737)"
st 00709 "Button 20" "Button 20 (Open Door A/738 B/739)"
st 00710 "Button 21" "Button 21 (THZ2 A/740 B/741 D/742)"
st 00768 "IceSluWindCurr" "Ice/Sludge and Wind/Current"
st 00974 "Linedefx (NFT)" "Linedef Executor (No Floor Touch)"
st 00975 "Linedefx (WFT)" "Linedef Executor (Floor Touch)"
st 00976 "Speed Pad (NS)" "Speed Pad (No Spin)"
st 00977 "Speed Pad (WS)" "Speed Pad (Spin)"
st 00978 "Ring Drainer" "Ring Drainer"
st 00979 "Spinner" "Spinner"
st 00980 "Ring Drain NFT" "Ring Drainer (No Floor Touch)" # 1.09?
st 00981 "RaiseCeilHghst" "Raise Ceiling to Highest (tag 744) (obsolete)"
st 00982 "Exit" "Exit Sector"
st 00983 "Water Damage" "Damage (Water)"
st 00984 "WaterDm&Curent" "Damage (Water) and Current"
st 00985 "ConveyorBelt" "Conveyor Belt"
st 00986 "Slime Raise" "THZ2 Slime Raise (B/712 W/713 P/714 D/715 S/716)"
st 00987 "No Tag Zone" "No Tag Zone"
st 00988 "CTF - Red" "CTF - Red Team Base"
st 00989 "CTF - Bule" "CTF - Blue Team Base"
st 00990 "SS Control" "Special Stage (Floor=Time) (Ceiling=Rings)"
st 00991 "Custom Gravity" "Custom Gravity"
st 00992 "Ramp" "Ramp Sector (Stairs)"
st 00993 "Starpost Actor" "Starpost Activator"
st 00994 "Hockey - Red" "Hockey - Red Team Goal (Finish Line in 1.09)"
st 00995 "Hockey - Blue" "Hockey - Blue Team Goal (not in 1.09)"
st 00996 "Non-Ramp" "Non-Ramp Sector"
st 00997 "Fan Sector" "Fan Sector"
st 00998 "Zoom Tube Strt" "Zoom Tube Start (1.09)"
st 00999 "Zoom Tube End" "Zoom Tube End (1.09)"
st 01500 "BustSprt ROIA" "Bustable Block Sprite ROIA (1.09)"
st 01501 "BustSprt ROIB" "Bustable Block Sprite ROIB (1.09)"
st 01502 "BustSprt ROIC" "Bustable Block Sprite ROIC (1.09)"
st 01503 "BustSprt ROID" "Bustable Block Sprite ROID (1.09)"
st 01504 "BustSprt ROIE" "Bustable Block Sprite ROIE (1.09)"
st 01505 "BustSprt ROIF" "Bustable Block Sprite ROIF (1.09)"
st 01506 "BustSprt ROIG" "Bustable Block Sprite ROIG (1.09)"
st 01507 "BustSprt ROIH" "Bustable Block Sprite ROIH (1.09)"
st 01508 "BustSprt ROII" "Bustable Block Sprite ROII (1.09)"
st 01509 "BustSprt ROIJ" "Bustable Block Sprite ROIJ (1.09)"
st 01510 "BustSprt ROIK" "Bustable Block Sprite ROIK (1.09)"
st 01511 "BustSprt ROIL" "Bustable Block Sprite ROIL (1.09)"
st 01512 "BustSprt ROIM" "Bustable Block Sprite ROIM (1.09)"
st 01513 "BustSprt ROIN" "Bustable Block Sprite ROIN (1.09)"
st 01514 "BustSprt ROIO" "Bustable Block Sprite ROIO (1.09)"
st 01515 "BustSprt ROIP" "Bustable Block Sprite ROIP (1.09)"
#
# Definition of thing groups
# Format is : thinggroup <thinggroup> <colour> <description>
#
thinggroup b rgb:f/f/f "Starts"
thinggroup e rgb:f/0/0 "Enemies"
thinggroup n rgb:f/b/0 "Nights Things"
thinggroup p rgb:0/b/b "Power-Up Monitors"
thinggroup o rgb:b/0/c "Misc."
thinggroup d rgb:b/b/b "Scenery"
thinggroup m rgb:f/f/0 "Mario"
thinggroup c rgb:f/b/c "Christmas"
thinggroup r rgb:0/0/f "Rings"
thinggroup s rgb:0/c/0 "Springs and Such"
#
# Definition of things
# Format is :
# thing <number> <thinggroup> <flags> <radius> <desc> [<sprite>]
# <desc> must not exceed 19 characters. <flags> s for see-thur
#
# FIXME: replace dissa0 and dumba0 with sprites that are really there
# FIXME: replace start images of ndrna1 with something better.
# ndrna1 is really the nights drone
#thig 00000 g s ## " " ?????#
thing 00001 b - 32 "Player 01 Start" ndrna1
thing 00002 b - 32 "Player 02 Start" ndrna1
thing 00003 b - 32 "Player 03 Start" ndrna1
thing 00004 b - 32 "Player 04 Start" ndrna1
thing 04001 b - 32 "Player 05 Start" ndrna1
thing 04002 b - 32 "Player 06 Start" ndrna1
thing 04003 b - 32 "Player 07 Start" ndrna1
thing 04004 b - 32 "Player 08 Start" ndrna1
thing 04005 b - 32 "Player 09 Start" ndrna1
thing 04006 b - 32 "Player 10 Start" ndrna1
thing 04007 b - 32 "Player 11 Start" ndrna1
thing 04008 b - 32 "Player 12 Start" ndrna1
thing 04009 b - 32 "Player 13 Start" ndrna1
thing 04010 b - 32 "Player 14 Start" ndrna1
thing 04011 b - 32 "Player 15 Start" ndrna1
thing 04012 b - 32 "Player 16 Start" ndrna1
thing 04013 b - 32 "Player 17 Start" ndrna1
thing 04014 b - 32 "Player 18 Start" ndrna1
thing 04015 b - 32 "Player 19 Start" ndrna1
thing 04016 b - 32 "Player 20 Start" ndrna1
thing 04017 b - 32 "Player 21 Start" ndrna1
thing 04018 b - 32 "Player 22 Start" ndrna1
thing 04019 b - 32 "Player 23 Start" ndrna1
thing 04020 b - 32 "Player 24 Start" ndrna1
thing 04021 b - 32 "Player 25 Start" ndrna1
thing 04022 b - 32 "Player 26 Start" ndrna1
thing 04023 b - 32 "Player 27 Start" ndrna1
thing 04024 b - 32 "Player 28 Start" ndrna1
thing 04025 b - 32 "Player 29 Start" ndrna1
thing 04026 b - 32 "Player 30 Start" ndrna1
thing 04027 b - 32 "Player 31 Start" ndrna1
thing 04028 b - 32 "Player 32 Start" ndrna1
thing 00087 b - 32 "CTF Red Team Start" ndrna1
thing 00089 b - 32 "CTF Blue Team Start" ndrna1
thing 00011 b - 32 "Deathmatch Start" ndrna1
#thig 00000 g s ## " " ?????#
#thig 00000 g s ## " " ?????#
thing 00009 e - 40 "Crawla (Red)" sposa1
thing 03004 e - 40 "Crawla (Blue)" possa1
thing 03005 e - 40 "Jetty-Syn Bomber" jetba1
thing 00022 e - 40 "Jetty-Syn Gunner" jetga1
thing 00058 e - 40 "Robofish (tm)" fisha0
thing 00071 e - 40 "Deton" detna1
thing 00056 e - 40 "Skim" skima0
thing 05005 e - 40 "Buzz (Yellow)" buzza0
thing 05006 e - 40 "Buzz (Red)" rbuza0
thing 02004 e - 40 "THZ Turret" treta1
thing 00042 e - 40 "Popup Turret" turre1
thing 00016 e - 80 "Egg Mobile (Boss 1)" eggma1
thing 01008 e - 80 "Egg Slimer (Boss 2)" eggna1
thing 00021 e - 40 "Crawla Commander" ccoma1
thing 00008 e s 20 "ChaosModeEnemySpawn" tfogi0
#thig 00000 g s ## " " ?????#
#thig 00000 g s ## " " ?????#
thing 00052 n s 20 "1024 Axis" dissa0
thing 00053 n s 20 "512 Axis" dissa0
thing 00059 n s 20 "2048 Axis" dissa0
thing 00062 n s 20 "1024 Axis(Inverted)" dissa0
thing 00015 n s 20 "512 Axis (Inverted)" dissa0
thing 00045 n s 20 "2048 Axis(Inverted)" dissa0
thing 00061 n s 20 "Axis Transfer" dissa0
thing 00046 n s 20 "Axis Transfer Closest" dissa0
thing 00055 n s 20 "Axis Transfer LastToFirst" dissa0
thing 00060 n - 20 "Ideya Drone" ndrna1
thing 00057 n - 20 "Hoop" hoopa0
thing 00047 n - 20 "Circle of Rings" bon1a0
thing 02007 n - 20 "Circle ofRings(Big)" bon1a0
thing 02048 n - 20 "Circle ofWing Logos" nwnga0
thing 02010 n - 20 "CircleofWingLogos-B" nwnga0
thing 02046 n - 20 "CircleofRings&Wings" nwnga0
thing 02047 n - 20 "CirleofRngs&Wings-B" nwnga0
thing 00037 n - 20 "Wing Logo" nwnga0
thing 00082 n s 20 "AxisTrnsferCodtion" dissa0
thing 00085 n s 20 "AxisTrnsferCodtion2" dissa0
thing 03007 n - 20 "Super Loop" npraa0
thing 03008 n - 20 "Drill Refill" nprba0
thing 03009 n - 20 "Helper" nprca0
#thig 00000 g s ## " " ?????#
#thig 00000 g s ## " " ?????#
thing 00025 p - 20 "Super Sneakers" shtva0
thing 00035 p - 20 "Basic/WhirlShield" bltva0
thing 00041 p - 20 "Extra Life" prupa0
thing 00048 p - 20 "Attraction Shield" yltva0
thing 02002 p - 20 "Inferno Shield" rdtva0
thing 02018 p - 20 "Armageddon Shield" bktva0
thing 02022 p - 20 "Invincibility" pinva0
thing 02028 p - 20 "Liquid Shield" grtva0
thing 02011 p - 20 "SuperRing(10 Rings)" srbxa0
thing 02012 p - 20 "SilverRing(25Rings)" grbxa0
thing 00078 p - 20 "Teleporter" mixua0
thing 02005 p - 20 "Eggman" eggba0
thing 03000 p - 20 "Random" quesa0
#thig 00000 g s ## " " ?????#
#thig 00000 g s ## " " ?????#
thing 00031 o - 20 "CTF Flag (Red)" rflga0
thing 00034 o - 20 "CTF Flag (Blue)" bflga0
thing 02013 o - 20 "Special Stage Token" tokea0
thing 00086 o - 20 "End Level Sign" signd0
thing 00033 o - 20 "Air Bubble Patch" bubla0
thing 00064 o - 20 "Emerald Hunt Place1" emera0
thing 03002 o - 20 "Emerald Hunt Place2" emera0
thing 03001 o - 20 "Emerald Hunt Place3" emera0
thing 03006 o - 20 "Star Post" stpta0
thing 05001 o s 20 "Push" ppsha0
thing 05002 o s 20 "Pull" pplla0
thing 05003 o s 20 "TeleportDestination" dissa0
thing 05007 o s 20 "Cut-Away View Thing" dissa0
thing 00067 o - 20 "Ceiling Spike" dspka0
thing 00068 o - 20 "Floor Spike" uspka0
thing 00023 o - 20 "Spikeball" spika0
thing 00017 o s 20 "Boss Flypoint" dissa0
thing 02049 o s 20 "Egg Capsule Center" dissa0
thing 00051 o - 20 "Laser" lasra0
thing 00018 o - 20 "ZoomTubeWaypoint109" dissa0
thing 00420 o - 20 "Emerald 1 (Green)" emmya0
thing 00421 o - 20 "Emerald 2 (Orange)" emmyb0
thing 00422 o - 20 "Emerald 3 (Pink)" emmyc0
thing 00423 o - 20 "Emerald 4 (Blue)" emmyd0
thing 00424 o - 20 "Emerald 5 (Red)" emmye0
thing 00425 o - 20 "Emerald 6 (LtBlue)" emmyf0
thing 00426 o - 20 "Emerald 7 (Gray)" emmyg0
# FIXME: add correct sprite for this emerald
thing 00427 o - 20 "Emerald 8 (Master)" dissa0
#thig 00000 g s ## " " ?????#
thing 00036 d - 20 "GFZ Flower (Normal)" fwr1b0
thing 00070 d - 20 "GFZ Sunflower" fwr2a0
thing 00073 d - 20 "GFZ Budding Flower" fwr3a0
thing 00074 d - 20 "Berry Bush" bus1a0
thing 00075 d - 20 "Bush" bus2a0
thing 02035 d - 20 "THZ Flower" thzpa0
thing 00081 d - 20 "Gargoyle" garga1
thing 02026 d s 20 "AmbientWaterSFX1A-L" dumba0
thing 02024 d s 20 "AmbientWaterSFX1B-L" dumba0
thing 02025 d s 20 "AmbientWaterSFX2A-M" dumba0
thing 02045 d s 20 "AmbientWaterSFX2B-M" dumba0
thing 00083 d s 20 "AmbientWaterSFX3A-S" dumba0
thing 02019 d s 20 "AmbientWaterSFX3B-S" dumba0
thing 02025 d s 20 "AmbientWaterSFX4A-E" dumba0
thing 00027 d s 20 "AmbientWaterSFX4B-E" dumba0
thing 00014 d s 20 "Random Ambience 1" dumba0
thing 00043 d s 20 "Random Ambience 2" dumba0
thing 00049 d - 20 "Hanging Chain" chana0
thing 02006 d - 20 "THZ Alarm" alrma0
thing 02001 d - 20 "CEZ Flower" fwr4a0
thing 00024 d - 20 "CEZ Torch" flama0
thing 02003 d s 20 "LightSource (MAP92)" dissa0
#thig 00000 g s ## " " ?????#
#thig 00000 g s ## " " ?????#
thing 100000 m - 20 "Overworld Goomba" gooma0
thing 100001 m - 20 "Underworld Goomba" bgoma0
thing 100002 m - 20 "Bush (Short)" mus1a0
thing 100003 m - 20 "Bush (Tall)" mus2a0
thing 100004 m - 20 "Toad" toada0
thing 100005 m - 20 "Coin" coina0
thing 00019 m - 20 "King Bowser" koopa0
thing 00010 m - 20 "Koopa Shell" shlla0
thing 00012 m - 20 "Axe" maxea0
thing 00050 m - 20 "Fire Flower" ffwra0
thing 00029 m - 20 "Puma(MarioFireball)" pumaa0
#thig 00000 g s ## " " ?????#
#thig 00000 g s ## " " ?????#
thing 00005 c - 20 "Pole" xms1a0
thing 00006 c - 20 "Snowman" xms3a0
thing 00013 c - 20 "Candy Cane" xms2a0
thing 00084 r - 20 "5VerticalRings-YwSg" bon1a0
thing 00044 r - 20 "5VerticalRings-RdSg" bon1a0
thing 00076 r - 20 "5DiagonalRings-YwSg" bon1a0
thing 00077 r - 20 "10DiagonalRings-RSg" bon1a0
thing 02014 r - 20 "Ring" bon1a0
thing 00069 r - 20 "Homing Ring" homra0
thing 03003 r - 20 "Rail Ring" raila0
thing 00026 r - 20 "Automatic Ring" autra0
thing 00054 r - 20 "Explosion Ring" bomra0
thing 00080 r - 20 "Infinity Ring" infra0
thing 00028 s - 20 "Yellow Spring (Up)" sprya0
thing 00079 s - 20 "Red Spring (Up)" sprra0
thing 02015 s - 20 "Yellow Spring (DU)" yspra1
thing 00038 s - 20 "Red Spring (DU)" rspra1
thing 00020 s - 20 "Yellow Spring (DD)" ysuda1
thing 00039 s - 20 "Red Spring (DD)" rsuda1
thing 00065 s - 20 "Yellow Spring (Dn)" sudya0
thing 00066 s - 20 "Red Spring (Dn)" sudra0
thing 05004 s - 20 "Blue Spring" sprba0
thing 00030 s - 20 "THZ Gas Jet" stemd0
thing 00032 s - 20 "THZ Fan" fansa0
#thig 00000 g s ## " " ?????#
File diff suppressed because it is too large. Load diff
-58
View File
@@ -1,58 +0,0 @@
# wminput configuration for SRB2Wii by Alam Arias
# based on Callum Dickinson's version
#Wiimote.Up = KEY_RESERVED
#Wiimote.Down = KEY_RESERVED
#Wiimote.Left = KEY_RESERVED
#Wiimote.Right = KEY_RESERVED
Wiimote.A = BTN_THUMB
Wiimote.B = BTN_TRIGGER
Wiimote.Minus = BTN_THUMBL
Wiimote.Plus = BTN_THUMBR
Wiimote.Home = BTN_MODE
Wiimote.1 = BTN_1
Wiimote.2 = BTN_2
Wiimote.Dpad.X = -ABS_HAT0Y
Wiimote.Dpad.Y = -ABS_HAT0X
Nunchuk.C = BTN_C
Nunchuk.Z = BTN_Z
Nunchuk.Stick.X = ABS_THROTTLE
Nunchuk.Stick.Y = -ABS_RUDDER
#Classic.Up = KEY_RESERVED
#Classic.Down = KEY_RESERVED
#Classic.Left = KEY_RESERVED
#Classic.Right = KEY_RESERVED
Classic.Minus = BTN_SELECT
Classic.Plus = BTN_START
Classic.Home = BTN_MODE
Classic.A = BTN_A
Classic.B = BTN_B
Classic.X = BTN_X
Classic.Y = BTN_Y
Classic.ZL = BTN_TL2
Classic.ZR = BTN_TR2
Classic.L = BTN_TL
Classic.R = BTN_TR
Classic.Dpad.X = ABS_HAT1X
Classic.Dpad.Y = -ABS_HAT1Y
Classic.LStick.X = ABS_X
Classic.LStick.Y = -ABS_Y
Classic.RStick.X = ABS_RX
Classic.RStick.Y = -ABS_RY
Classic.LAnalog = ABS_GAS
Classic.RAnalog = ABS_BRAKE
# Nunchuk Stick buttons
Plugin.nunchuk_stick2btn.Up = BTN_BASE
Plugin.nunchuk_stick2btn.Down = BTN_BASE2
Plugin.nunchuk_stick2btn.Left = BTN_BASE3
Plugin.nunchuk_stick2btn.Right = BTN_BASE4
# Mouse Control
#Plugin.ir_ptr.X = REL_X
#Plugin.ir_ptr.Y = REL_Y
+5 -1
View File
@@ -27,4 +27,8 @@ and don't forget to build r_opengl.dll for srb2dd.
* libs\dll-binaries\x86_64\discord-rpc.dll
* libs\SDL2\x86_64-w64-mingw32\bin\SDL2.dll
* libs\SDL2_mixer\x86_64-w64-mingw32\bin\*.dll (get everything)
* libs\libopenmpt\x86_64\bin\mingw\libopenmpt.dll
* libs\libopenmpt\x86_64\bin\mingw\libopenmpt.dll
Updated 2/17/2024 (v1.6 Saturn)
No i threw everthing into dll-binaries
theres no reason at all to have stuff spread across multiple directories
+16 -16
View File
@@ -1,16 +1,16 @@
Bugs are now managed in the SDL issue tracker, here:
https://github.com/libsdl-org/SDL/issues
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL forums/mailing list:
https://discourse.libsdl.org/
Bug reports are welcome here, but we really appreciate if you use the issue
tracker, as bugs discussed on the mailing list may be forgotten or missed.
Bugs are now managed in the SDL issue tracker, here:
https://github.com/libsdl-org/SDL/issues
You may report bugs there, and search to see if a given issue has already
been reported, discussed, and maybe even fixed.
You may also find help at the SDL forums/mailing list:
https://discourse.libsdl.org/
Bug reports are welcome here, but we really appreciate if you use the issue
tracker, as bugs discussed on the mailing list may be forgotten or missed.
+20 -20
View File
@@ -1,20 +1,20 @@
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Simple DirectMedia Layer
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
+53 -53
View File
@@ -1,53 +1,53 @@
Simple DirectMedia Layer CREDITS
Thanks to everyone who made this possible, including:
* Cliff Matthews, for giving me a reason to start this project. :)
-- Executor rocks! *grin*
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
* Alfred Reynolds for the game controller API and general (in)sanity
* Jørgen Tjernø for numerous magical Mac OS X fixes.
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
* Julian Winter for the SDL 2.0 website.
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
* Jim Grandpre for his work on multi-touch and gesture recognition during
the Google Summer of Code 2010.
* Edgar "bobbens" Simo for his force feedback API development during the
Google Summer of Code 2008.
* Aaron Wishnick for his work on audio resampling and pitch shifting during
the Google Summer of Code 2008.
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
Google Summer of Code 2008.
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
* Everybody at Loki Software, Inc. for their great contributions!
And a big hand to everyone else who has contributed over the years.
THANKS! :)
-- Sam Lantinga <slouken@libsdl.org>
Simple DirectMedia Layer CREDITS
Thanks to everyone who made this possible, including:
* Cliff Matthews, for giving me a reason to start this project. :)
-- Executor rocks! *grin*
* Ryan Gordon for helping everybody out and keeping the dream alive. :)
* Gabriel Jacobo for his work on the Android port and generally helping out all around.
* Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches.
* Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code.
* Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve.
* Alfred Reynolds for the game controller API and general (in)sanity
* Jørgen Tjernø for numerous magical Mac OS X fixes.
* Pierre-Loup Griffais for his deep knowledge of OpenGL drivers.
* Julian Winter for the SDL 2.0 website.
* Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides.
* Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010.
* Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010.
* Jim Grandpre for his work on multi-touch and gesture recognition during
the Google Summer of Code 2010.
* Edgar "bobbens" Simo for his force feedback API development during the
Google Summer of Code 2008.
* Aaron Wishnick for his work on audio resampling and pitch shifting during
the Google Summer of Code 2008.
* Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the
Google Summer of Code 2008.
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation.
* Everybody at Loki Software, Inc. for their great contributions!
And a big hand to everyone else who has contributed over the years.
THANKS! :)
-- Sam Lantinga <slouken@libsdl.org>
+18 -18
View File
@@ -1,18 +1,18 @@
The 32-bit files are in i686-w64-mingw32
The 64-bit files are in x86_64-w64-mingw32
To install SDL for native development:
make native
To install SDL for cross-compiling development:
make cross
Look at the example programs in ./test, and check out online documentation:
http://wiki.libsdl.org/
Join the SDL developer mailing list if you want to join the community:
http://www.libsdl.org/mailing-list.php
That's it!
Sam Lantinga <slouken@libsdl.org>
The 32-bit files are in i686-w64-mingw32
The 64-bit files are in x86_64-w64-mingw32
To install SDL for native development:
make native
To install SDL for cross-compiling development:
make cross
Look at the example programs in ./test, and check out online documentation:
http://wiki.libsdl.org/
Join the SDL developer mailing list if you want to join the community:
http://www.libsdl.org/mailing-list.php
That's it!
Sam Lantinga <slouken@libsdl.org>
-30
View File
@@ -1,30 +0,0 @@
#
# Makefile for installing the mingw32 version of the SDL library
CROSS_PATH := /usr/local
ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32
all install:
@echo "Type \"make native\" to install 32-bit to /usr"
@echo "Type \"make cross\" to install 32-bit and 64-bit to $(CROSS_PATH)"
native:
make install-package arch=i686-w64-mingw32 prefix=/usr
cross:
for arch in $(ARCHITECTURES); do \
make install-package arch=$$arch prefix=$(CROSS_PATH)/$$arch; \
done
install-package:
@if test -d $(arch) && test -d $(prefix); then \
(cd $(arch) && cp -rv bin include lib share $(prefix)/); \
sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/bin/sdl2-config >$(prefix)/bin/sdl2-config; \
chmod 755 $(prefix)/bin/sdl2-config; \
sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2.la >$(prefix)/lib/libSDL2.la; \
sed "s|^libdir=.*|libdir=\'$(prefix)/lib\'|" <$(arch)/lib/libSDL2main.la >$(prefix)/lib/libSDL2main.la; \
sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/lib/pkgconfig/sdl2.pc >$(prefix)/lib/pkgconfig/sdl2.pc; \
else \
echo "*** ERROR: $(arch) or $(prefix) does not exist!"; \
exit 1; \
fi
+13 -13
View File
@@ -1,13 +1,13 @@
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games
and emulators.
The Simple DirectMedia Layer library source code is available from:
https://www.libsdl.org/
This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html
Please distribute this file with the SDL runtime environment:
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
designed to make it easy to write multi-media software, such as games
and emulators.
The Simple DirectMedia Layer library source code is available from:
https://www.libsdl.org/
This library is distributed under the terms of the zlib license:
http://www.zlib.net/zlib_license.html
+21 -21
View File
@@ -1,21 +1,21 @@
Simple DirectMedia Layer
(SDL)
Version 2.0
---
https://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting
with README.md
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Simple DirectMedia Layer
(SDL)
Version 2.0
---
https://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting
with README.md
Enjoy!
Sam Lantinga (slouken@libsdl.org)
+15 -15
View File
@@ -1,15 +1,15 @@
# SDL Development Libaries
Download both the VC and MinGW packages and extract them here.
https://www.libsdl.org/download-2.0.php
## VC Package
* include
* lib
## MinGW Package
* i686-w64-mingw32
* x86_64-w64-mingw32
# SDL Development Libaries
Download both the VC and MinGW packages and extract them here.
https://www.libsdl.org/download-2.0.php
## VC Package
* include
* lib
## MinGW Package
* i686-w64-mingw32
* x86_64-w64-mingw32
+870 -745
View File
File diff suppressed because it is too large. Load diff
+97
View File
@@ -0,0 +1,97 @@
# Contributing to SDL
We appreciate your interest in contributing to SDL, this document will describe how to report bugs, contribute code or ideas or edit documentation.
**Table Of Contents**
- [Filing a GitHub issue](#filing-a-github-issue)
- [Reporting a bug](#reporting-a-bug)
- [Suggesting enhancements](#suggesting-enhancements)
- [Contributing code](#contributing-code)
- [Forking the project](#forking-the-project)
- [Following the style guide](#following-the-style-guide)
- [Running the tests](#running-the-tests)
- [Opening a pull request](#opening-a-pull-request)
- [Contributing to the documentation](#contributing-to-the-documentation)
- [Editing a function documentation](#editing-a-function-documentation)
- [Editing the wiki](#editing-the-wiki)
## Filing a GitHub issue
### Reporting a bug
If you think you have found a bug and would like to report it, here are the steps you should take:
- Before opening a new issue, ensure your bug has not already been reported on the [GitHub Issues page](https://github.com/libsdl-org/SDL/issues).
- On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
- Include details about your environment, such as your Operating System and SDL version.
- If possible, provide a small example that reproduces your bug.
### Suggesting enhancements
If you want to suggest changes for the project, here are the steps you should take:
- Check if the suggestion has already been made on:
- the [issue tracker](https://github.com/libsdl-org/SDL/issues);
- the [discourse forum](https://discourse.libsdl.org/);
- or if a [pull request](https://github.com/libsdl-org/SDL/pulls) already exists.
- On the issue tracker, click on [New Issue](https://github.com/libsdl-org/SDL/issues/new).
- Describe what change you would like to happen.
## Contributing code
This section will cover how the process of forking the project, making a change and opening a pull request.
### Forking the project
The first step consists in making a fork of the project, this is only necessary for the first contribution.
Head over to https://github.com/libsdl-org/SDL and click on the `Fork` button in the top right corner of your screen, you may leave the fields unchanged and click `Create Fork`.
You will be redirected to your fork of the repository, click the green `Code` button and copy the git clone link.
If you had already forked the repository, you may update it from the web page using the `Fetch upstream` button.
### Following the style guide
Code formatting is done using a custom `.clang-format` file, you can learn more about how to run it [here](https://clang.llvm.org/docs/ClangFormat.html).
Some legacy code may not be formatted, as such avoid formatting the whole file at once and only format around your changes.
For your commit message to be properly displayed on GitHub, it should contain:
- A short description of the commit of 50 characters or less on the first line.
- If necessary, add a blank line followed by a long description, each line should be 72 characters or less.
For example:
```
Fix crash in SDL_FooBar.
This addresses the issue #123456 by making sure Foo was successful
before calling Bar.
```
### Running the tests
Tests allow you to verify if your changes did not break any behaviour, here are the steps to follow:
- Before pushing, run the `testautomation` suite on your machine, there should be no more failing tests after your change than before.
- After pushing to your fork, Continuous Integration (GitHub Actions) will ensure compilation and tests still pass on other systems.
### Opening a pull request
- Head over to your fork's GitHub page.
- Click on the `Contribute` button and `Open Pull Request`.
- Fill out the pull request template.
- If any changes are requested, you can add new commits to your fork and they will be automatically added to the pull request.
## Contributing to the documentation
### Editing a function documentation
The wiki documentation for API functions is synchronised from the headers' doxygen comments. As such, all modifications to syntax; function parameters; return value; version; related functions should be done in the header directly.
### Editing the wiki
Other changes to the wiki should done directly from https://wiki.libsdl.org/
+483 -475
View File
@@ -1,475 +1,483 @@
Android
================================================================================
Matt Styles wrote a tutorial on building SDL for Android with Visual Studio:
http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html
The rest of this README covers the Android gradle style build process.
If you are using the older ant build process, it is no longer officially
supported, but you can use the "android-project-ant" directory as a template.
Requirements
================================================================================
Android SDK (version 26 or later)
https://developer.android.com/sdk/index.html
Android NDK r15c or later
https://developer.android.com/tools/sdk/ndk/index.html
Minimum API level supported by SDL: 16 (Android 4.1)
How the port works
================================================================================
- Android applications are Java-based, optionally with parts written in C
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to
the SDL library
- This means that your application C code must be placed inside an Android
Java project, along with some C support code that communicates with Java
- This eventually produces a standard Android .apk package
The Android Java code implements an "Activity" and can be found in:
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
The Java code loads your game code, the SDL shared library, and
dispatches to native functions implemented in the SDL library:
src/core/android/SDL_android.c
Building an app
================================================================================
For simple projects you can use the script located at build-scripts/androidbuild.sh
There's two ways of using it:
androidbuild.sh com.yourcompany.yourapp < sources.list
androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
sources.list should be a text file with a source file name in each line
Filenames should be specified relative to the current directory, for example if
you are in the build-scripts directory and want to create the testgles.c test, you'll
run:
./androidbuild.sh org.libsdl.testgles ../test/testgles.c
One limitation of this script is that all sources provided will be aggregated into
a single directory, thus all your source files should have a unique name.
Once the project is complete the script will tell you where the debug APK is located.
If you want to create a signed release APK, you can use the project created by this
utility to generate it.
Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
done in the build directory for the app!
For more complex projects, follow these instructions:
1. Copy the android-project directory wherever you want to keep your projects
and rename it to the name of your project.
2. Move or symlink this SDL directory into the "<project>/app/jni" directory
3. Edit "<project>/app/jni/src/Android.mk" to include your source files
4a. If you want to use Android Studio, simply open your <project> directory and start building.
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
If you already have a project that uses CMake, the instructions change somewhat:
1. Do points 1 and 2 from the instruction above.
2. Edit "<project>/app/build.gradle" to comment out or remove sections containing ndk-build
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
3. Edit "<project>/app/jni/CMakeLists.txt" to include your project (it defaults to
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
add_executable() for the target containing your "main" function.
If you wish to use Android Studio, you can skip the last step.
4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any
connected Android device
Here's an explanation of the files in the Android project, so you can customize them:
android-project/app
build.gradle - build info including the application version and SDK
src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application.
jni/ - directory holding native code
jni/Application.mk - Application JNI settings, including target platform and STL library
jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories
jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject
jni/SDL/ - (symlink to) directory holding the SDL library files
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
jni/src/ - directory holding your C/C++ source
jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references
jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references
src/main/assets/ - directory holding asset files for your application
src/main/res/ - directory holding resources for your application
src/main/res/mipmap-* - directories holding icons for different phone hardware
src/main/res/values/strings.xml - strings used in your application, including the application name
src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application.
Customizing your application name
================================================================================
To customize your application name, edit AndroidManifest.xml and replace
"org.libsdl.app" with an identifier for your product package.
Then create a Java class extending SDLActivity and place it in a directory
under src matching your package, e.g.
src/com/gamemaker/game/MyGame.java
Here's an example of a minimal class file:
--- MyGame.java --------------------------
package com.gamemaker.game;
import org.libsdl.app.SDLActivity;
/**
* A sample wrapper class that just calls SDLActivity
*/
public class MyGame extends SDLActivity { }
------------------------------------------
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
class, .e.g. "MyGame"
Customizing your application icon
================================================================================
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
the drawable directories under the res directory. There are several directories
for different screen sizes.
Loading assets
================================================================================
Any files you put in the "app/src/main/assets" directory of your project
directory will get bundled into the application package and you can load
them using the standard functions in SDL_rwops.h.
There are also a few Android specific functions that allow you to get other
useful paths for saving and loading data:
* SDL_AndroidGetInternalStoragePath()
* SDL_AndroidGetExternalStorageState()
* SDL_AndroidGetExternalStoragePath()
See SDL_system.h for more details on these functions.
The asset packaging system will, by default, compress certain file extensions.
SDL includes two asset file access mechanisms, the preferred one is the so
called "File Descriptor" method, which is faster and doesn't involve the Dalvik
GC, but given this method does not work on compressed assets, there is also the
"Input Stream" method, which is automatically used as a fall back by SDL. You
may want to keep this fact in mind when building your APK, specially when large
files are involved.
For more information on which extensions get compressed by default and how to
disable this behaviour, see for example:
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
Pause / Resume behaviour
================================================================================
If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default),
the event loop will block itself when the app is paused (ie, when the user
returns to the main Android dashboard). Blocking is better in terms of battery
use, and it allows your app to spring back to life instantaneously after resume
(versus polling for a resume message).
Upon resume, SDL will attempt to restore the GL context automatically.
In modern devices (Android 3.0 and up) this will most likely succeed and your
app can continue to operate as it was.
However, there's a chance (on older hardware, or on systems under heavy load),
where the GL context can not be restored. In that case you have to listen for
a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures
manually or quit the app.
You should not use the SDL renderer API while the app going in background:
- SDL_APP_WILLENTERBACKGROUND:
after you read this message, GL context gets backed-up and you should not
use the SDL renderer API.
When this event is received, you have to set the render target to NULL, if you're using it.
(eg call SDL_SetRenderTarget(renderer, NULL))
- SDL_APP_DIDENTERFOREGROUND:
GL context is restored, and the SDL renderer API is available (unless you
receive SDL_RENDER_DEVICE_RESET).
Mouse / Touch events
================================================================================
In some case, SDL generates synthetic mouse (resp. touch) events for touch
(resp. mouse) devices.
To enable/disable this behavior, see SDL_hints.h:
- SDL_HINT_TOUCH_MOUSE_EVENTS
- SDL_HINT_MOUSE_TOUCH_EVENTS
Misc
================================================================================
For some device, it appears to works better setting explicitly GL attributes
before creating a window:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
Threads and the Java VM
================================================================================
For a quick tour on how Linux native threads interoperate with the Java VM, take
a look here: https://developer.android.com/guide/practices/jni.html
If you want to use threads in your SDL app, it's strongly recommended that you
do so by creating them using SDL functions. This way, the required attach/detach
handling is managed by SDL automagically. If you have threads created by other
means and they make calls to SDL functions, make sure that you call
Android_JNI_SetupThread() before doing anything else otherwise SDL will attach
your thread automatically anyway (when you make an SDL call), but it'll never
detach it.
If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"),
it won't be able to find your java class and method because of the java class loader
which is different for native threads, than for java threads (eg your "main()").
the work-around is to find class/method, in you "main()" thread, and to use them
in your native thread.
see:
https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
Using STL
================================================================================
You can use STL in your project by creating an Application.mk file in the jni
folder and adding the following line:
APP_STL := c++_shared
For more information go here:
https://developer.android.com/ndk/guides/cpp-support
Using the emulator
================================================================================
There are some good tips and tricks for getting the most out of the
emulator here: https://developer.android.com/tools/devices/emulator.html
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
Notice that this software emulator is incredibly slow and needs a lot of disk space.
Using a real device works better.
Troubleshooting
================================================================================
You can see if adb can see any devices with the following command:
adb devices
You can see the output of log messages on the default device with:
adb logcat
You can push files to the device with:
adb push local_file remote_path_and_file
You can push files to the SD Card at /sdcard, for example:
adb push moose.dat /sdcard/moose.dat
You can see the files on the SD card with a shell command:
adb shell ls /sdcard/
You can start a command shell on the default device with:
adb shell
You can remove the library files of your project (and not the SDL lib files) with:
ndk-build clean
You can do a build with the following command:
ndk-build
You can see the complete command line that ndk-build is using by passing V=1 on the command line:
ndk-build V=1
If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace:
https://developer.android.com/ndk/guides/ndk-stack
If you want to go through the process manually, you can use addr2line to convert the
addresses in the stack trace to lines in your code.
For example, if your crash looks like this:
I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4
I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c
I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c
I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030
I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so
I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so
I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so
I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so
You can see that there's a crash in the C library being called from the main code.
I run addr2line with the debug version of my code:
arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
and then paste in the number after "pc" in the call stack, from the line that I care about:
000014bc
I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
You can add logging to your code to help show what's happening:
#include <android/log.h>
__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
If you need to build without optimization turned on, you can create a file called
"Application.mk" in the jni directory, with the following line in it:
APP_OPTIM := debug
Memory debugging
================================================================================
The best (and slowest) way to debug memory issues on Android is valgrind.
Valgrind has support for Android out of the box, just grab code using:
svn co svn://svn.valgrind.org/valgrind/trunk valgrind
... and follow the instructions in the file README.android to build it.
One thing I needed to do on Mac OS X was change the path to the toolchain,
and add ranlib to the environment variables:
export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
Once valgrind is built, you can create a wrapper script to launch your
application with it, changing org.libsdl.app to your package identifier:
--- start_valgrind_app -------------------
#!/system/bin/sh
export TMPDIR=/data/data/org.libsdl.app
exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
------------------------------------------
Then push it to the device:
adb push start_valgrind_app /data/local
and make it executable:
adb shell chmod 755 /data/local/start_valgrind_app
and tell Android to use the script to launch your application:
adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
If the setprop command says "could not set property", it's likely that
your package name is too long and you should make it shorter by changing
AndroidManifest.xml and the path to your class file in android-project/src
You can then launch your application normally and waaaaaaaiiittt for it.
You can monitor the startup process with the logcat command above, and
when it's done (or even while it's running) you can grab the valgrind
output file:
adb pull /sdcard/valgrind.log
When you're done instrumenting with valgrind, you can disable the wrapper:
adb shell setprop wrap.org.libsdl.app ""
Graphics debugging
================================================================================
If you are developing on a compatible Tegra-based tablet, NVidia provides
Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL
and GLES libraries, you must follow their instructions for installing the
interposer library on a rooted device. The non-rooted instructions are not
compatible with applications that use SDL2 for video.
The Tegra Graphics Debugger is available from NVidia here:
https://developer.nvidia.com/tegra-graphics-debugger
Why is API level 16 the minimum required?
================================================================================
The latest NDK toolchain doesn't support targeting earlier than API level 16.
As of this writing, according to https://developer.android.com/about/dashboards/index.html
about 99% of the Android devices accessing Google Play support API level 16 or
higher (January 2018).
A note regarding the use of the "dirty rectangles" rendering technique
================================================================================
If your app uses a variation of the "dirty rectangles" rendering technique,
where you only update a portion of the screen on each frame, you may notice a
variety of visual glitches on Android, that are not present on other platforms.
This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
contexts, in particular the use of the eglSwapBuffers function. As stated in the
documentation for the function "The contents of ancillary buffers are always
undefined after calling eglSwapBuffers".
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
is not possible for SDL as it requires EGL 1.4, available only on the API level
17+, so the only workaround available on this platform is to redraw the entire
screen each frame.
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
Ending your application
================================================================================
Two legitimate ways:
- return from your main() function. Java side will automatically terminate the
Activity by calling Activity.finish().
- Android OS can decide to terminate your application by calling onDestroy()
(see Activity life cycle). Your application will receive a SDL_QUIT event you
can handle to save things and quit.
Don't call exit() as it stops the activity badly.
NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
SDLK_AC_BACK, for any purpose.
Known issues
================================================================================
- The number of buttons reported for each joystick is hardcoded to be 36, which
is the current maximum number of buttons Android can report.
Android
================================================================================
Matt Styles wrote a tutorial on building SDL for Android with Visual Studio:
http://trederia.blogspot.de/2017/03/building-sdl2-for-android-with-visual.html
The rest of this README covers the Android gradle style build process.
If you are using the older ant build process, it is no longer officially
supported, but you can use the "android-project-ant" directory as a template.
Requirements
================================================================================
Android SDK (version 34 or later)
https://developer.android.com/sdk/index.html
Android NDK r15c or later
https://developer.android.com/tools/sdk/ndk/index.html
Minimum API level supported by SDL: 19 (Android 4.4)
How the port works
================================================================================
- Android applications are Java-based, optionally with parts written in C
- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to
the SDL library
- This means that your application C code must be placed inside an Android
Java project, along with some C support code that communicates with Java
- This eventually produces a standard Android .apk package
The Android Java code implements an "Activity" and can be found in:
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
The Java code loads your game code, the SDL shared library, and
dispatches to native functions implemented in the SDL library:
src/core/android/SDL_android.c
Building an app
================================================================================
For simple projects you can use the script located at build-scripts/androidbuild.sh
There's two ways of using it:
androidbuild.sh com.yourcompany.yourapp < sources.list
androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c
sources.list should be a text file with a source file name in each line
Filenames should be specified relative to the current directory, for example if
you are in the build-scripts directory and want to create the testgles.c test, you'll
run:
./androidbuild.sh org.libsdl.testgles ../test/testgles.c
One limitation of this script is that all sources provided will be aggregated into
a single directory, thus all your source files should have a unique name.
Once the project is complete the script will tell you where the debug APK is located.
If you want to create a signed release APK, you can use the project created by this
utility to generate it.
Finally, a word of caution: re running androidbuild.sh wipes any changes you may have
done in the build directory for the app!
For more complex projects, follow these instructions:
1. Get the source code for SDL and copy the 'android-project' directory located at SDL/android-project to a suitable location. Also make sure to rename it to your project name (In these examples: YOURPROJECT).
(The 'android-project' directory can basically be seen as a sort of starting point for the android-port of your project. It contains the glue code between the Android Java 'frontend' and the SDL code 'backend'. It also contains some standard behaviour, like how events should be handled, which you will be able to change.)
2. Move or [symlink](https://en.wikipedia.org/wiki/Symbolic_link) the SDL directory into the "YOURPROJECT/app/jni" directory
(This is needed as the source of SDL has to be compiled by the Android compiler)
3. Edit "YOURPROJECT/app/jni/src/Android.mk" to include your source files.
(They should be separated by spaces after the "LOCAL_SRC_FILES := " declaration)
4a. If you want to use Android Studio, simply open your 'YOURPROJECT' directory and start building.
4b. If you want to build manually, run './gradlew installDebug' in the project directory. This compiles the .java, creates an .apk with the native code embedded, and installs it on any connected Android device
If you already have a project that uses CMake, the instructions change somewhat:
1. Do points 1 and 2 from the instruction above.
2. Edit "YOURPROJECT/app/build.gradle" to comment out or remove sections containing ndk-build
and uncomment the cmake sections. Add arguments to the CMake invocation as needed.
3. Edit "YOURPROJECT/app/jni/CMakeLists.txt" to include your project (it defaults to
adding the "src" subdirectory). Note that you'll have SDL2, SDL2main and SDL2-static
as targets in your project, so you should have "target_link_libraries(yourgame SDL2 SDL2main)"
in your CMakeLists.txt file. Also be aware that you should use add_library() instead of
add_executable() for the target containing your "main" function.
If you wish to use Android Studio, you can skip the last step.
4. Run './gradlew installDebug' or './gradlew installRelease' in the project directory. It will build and install your .apk on any
connected Android device
Here's an explanation of the files in the Android project, so you can customize them:
android-project/app
build.gradle - build info including the application version and SDK
src/main/AndroidManifest.xml - package manifest. Among others, it contains the class name of the main Activity and the package name of the application.
jni/ - directory holding native code
jni/Application.mk - Application JNI settings, including target platform and STL library
jni/Android.mk - Android makefile that can call recursively the Android.mk files in all subdirectories
jni/CMakeLists.txt - Top-level CMake project that adds SDL as a subproject
jni/SDL/ - (symlink to) directory holding the SDL library files
jni/SDL/Android.mk - Android makefile for creating the SDL shared library
jni/src/ - directory holding your C/C++ source
jni/src/Android.mk - Android makefile that you should customize to include your source code and any library references
jni/src/CMakeLists.txt - CMake file that you may customize to include your source code and any library references
src/main/assets/ - directory holding asset files for your application
src/main/res/ - directory holding resources for your application
src/main/res/mipmap-* - directories holding icons for different phone hardware
src/main/res/values/strings.xml - strings used in your application, including the application name
src/main/java/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding to SDL. Be very careful changing this, as the SDL library relies on this implementation. You should instead subclass this for your application.
Customizing your application name
================================================================================
To customize your application name, edit AndroidManifest.xml and replace
"org.libsdl.app" with an identifier for your product package.
Then create a Java class extending SDLActivity and place it in a directory
under src matching your package, e.g.
src/com/gamemaker/game/MyGame.java
Here's an example of a minimal class file:
--- MyGame.java --------------------------
package com.gamemaker.game;
import org.libsdl.app.SDLActivity;
/**
* A sample wrapper class that just calls SDLActivity
*/
public class MyGame extends SDLActivity { }
------------------------------------------
Then replace "SDLActivity" in AndroidManifest.xml with the name of your
class, .e.g. "MyGame"
Customizing your application icon
================================================================================
Conceptually changing your icon is just replacing the "ic_launcher.png" files in
the drawable directories under the res directory. There are several directories
for different screen sizes.
Loading assets
================================================================================
Any files you put in the "app/src/main/assets" directory of your project
directory will get bundled into the application package and you can load
them using the standard functions in SDL_rwops.h.
There are also a few Android specific functions that allow you to get other
useful paths for saving and loading data:
* SDL_AndroidGetInternalStoragePath()
* SDL_AndroidGetExternalStorageState()
* SDL_AndroidGetExternalStoragePath()
See SDL_system.h for more details on these functions.
The asset packaging system will, by default, compress certain file extensions.
SDL includes two asset file access mechanisms, the preferred one is the so
called "File Descriptor" method, which is faster and doesn't involve the Dalvik
GC, but given this method does not work on compressed assets, there is also the
"Input Stream" method, which is automatically used as a fall back by SDL. You
may want to keep this fact in mind when building your APK, specially when large
files are involved.
For more information on which extensions get compressed by default and how to
disable this behaviour, see for example:
http://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/
Pause / Resume behaviour
================================================================================
If SDL_HINT_ANDROID_BLOCK_ON_PAUSE hint is set (the default),
the event loop will block itself when the app is paused (ie, when the user
returns to the main Android dashboard). Blocking is better in terms of battery
use, and it allows your app to spring back to life instantaneously after resume
(versus polling for a resume message).
Upon resume, SDL will attempt to restore the GL context automatically.
In modern devices (Android 3.0 and up) this will most likely succeed and your
app can continue to operate as it was.
However, there's a chance (on older hardware, or on systems under heavy load),
where the GL context can not be restored. In that case you have to listen for
a specific message (SDL_RENDER_DEVICE_RESET) and restore your textures
manually or quit the app.
You should not use the SDL renderer API while the app going in background:
- SDL_APP_WILLENTERBACKGROUND:
after you read this message, GL context gets backed-up and you should not
use the SDL renderer API.
When this event is received, you have to set the render target to NULL, if you're using it.
(eg call SDL_SetRenderTarget(renderer, NULL))
- SDL_APP_DIDENTERFOREGROUND:
GL context is restored, and the SDL renderer API is available (unless you
receive SDL_RENDER_DEVICE_RESET).
Mouse / Touch events
================================================================================
In some case, SDL generates synthetic mouse (resp. touch) events for touch
(resp. mouse) devices.
To enable/disable this behavior, see SDL_hints.h:
- SDL_HINT_TOUCH_MOUSE_EVENTS
- SDL_HINT_MOUSE_TOUCH_EVENTS
Misc
================================================================================
For some device, it appears to works better setting explicitly GL attributes
before creating a window:
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
Threads and the Java VM
================================================================================
For a quick tour on how Linux native threads interoperate with the Java VM, take
a look here: https://developer.android.com/guide/practices/jni.html
If you want to use threads in your SDL app, it's strongly recommended that you
do so by creating them using SDL functions. This way, the required attach/detach
handling is managed by SDL automagically. If you have threads created by other
means and they make calls to SDL functions, make sure that you call
Android_JNI_SetupThread() before doing anything else otherwise SDL will attach
your thread automatically anyway (when you make an SDL call), but it'll never
detach it.
If you ever want to use JNI in a native thread (created by "SDL_CreateThread()"),
it won't be able to find your java class and method because of the java class loader
which is different for native threads, than for java threads (eg your "main()").
the work-around is to find class/method, in you "main()" thread, and to use them
in your native thread.
see:
https://developer.android.com/training/articles/perf-jni#faq:-why-didnt-findclass-find-my-class
Using STL
================================================================================
You can use STL in your project by creating an Application.mk file in the jni
folder and adding the following line:
APP_STL := c++_shared
For more information go here:
https://developer.android.com/ndk/guides/cpp-support
Using the emulator
================================================================================
There are some good tips and tricks for getting the most out of the
emulator here: https://developer.android.com/tools/devices/emulator.html
Especially useful is the info on setting up OpenGL ES 2.0 emulation.
Notice that this software emulator is incredibly slow and needs a lot of disk space.
Using a real device works better.
Troubleshooting
================================================================================
You can see if adb can see any devices with the following command:
adb devices
You can see the output of log messages on the default device with:
adb logcat
You can push files to the device with:
adb push local_file remote_path_and_file
You can push files to the SD Card at /sdcard, for example:
adb push moose.dat /sdcard/moose.dat
You can see the files on the SD card with a shell command:
adb shell ls /sdcard/
You can start a command shell on the default device with:
adb shell
You can remove the library files of your project (and not the SDL lib files) with:
ndk-build clean
You can do a build with the following command:
ndk-build
You can see the complete command line that ndk-build is using by passing V=1 on the command line:
ndk-build V=1
If your application crashes in native code, you can use ndk-stack to get a symbolic stack trace:
https://developer.android.com/ndk/guides/ndk-stack
If you want to go through the process manually, you can use addr2line to convert the
addresses in the stack trace to lines in your code.
For example, if your crash looks like this:
I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4
I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c
I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c
I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030
I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so
I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so
I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so
I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so
You can see that there's a crash in the C library being called from the main code.
I run addr2line with the debug version of my code:
arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so
and then paste in the number after "pc" in the call stack, from the line that I care about:
000014bc
I get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.
You can add logging to your code to help show what's happening:
#include <android/log.h>
__android_log_print(ANDROID_LOG_INFO, "foo", "Something happened! x = %d", x);
If you need to build without optimization turned on, you can create a file called
"Application.mk" in the jni directory, with the following line in it:
APP_OPTIM := debug
Memory debugging
================================================================================
The best (and slowest) way to debug memory issues on Android is valgrind.
Valgrind has support for Android out of the box, just grab code using:
svn co svn://svn.valgrind.org/valgrind/trunk valgrind
... and follow the instructions in the file README.android to build it.
One thing I needed to do on Mac OS X was change the path to the toolchain,
and add ranlib to the environment variables:
export RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib
Once valgrind is built, you can create a wrapper script to launch your
application with it, changing org.libsdl.app to your package identifier:
--- start_valgrind_app -------------------
#!/system/bin/sh
export TMPDIR=/data/data/org.libsdl.app
exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
------------------------------------------
Then push it to the device:
adb push start_valgrind_app /data/local
and make it executable:
adb shell chmod 755 /data/local/start_valgrind_app
and tell Android to use the script to launch your application:
adb shell setprop wrap.org.libsdl.app "logwrapper /data/local/start_valgrind_app"
If the setprop command says "could not set property", it's likely that
your package name is too long and you should make it shorter by changing
AndroidManifest.xml and the path to your class file in android-project/src
You can then launch your application normally and waaaaaaaiiittt for it.
You can monitor the startup process with the logcat command above, and
when it's done (or even while it's running) you can grab the valgrind
output file:
adb pull /sdcard/valgrind.log
When you're done instrumenting with valgrind, you can disable the wrapper:
adb shell setprop wrap.org.libsdl.app ""
Graphics debugging
================================================================================
If you are developing on a compatible Tegra-based tablet, NVidia provides
Tegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL
and GLES libraries, you must follow their instructions for installing the
interposer library on a rooted device. The non-rooted instructions are not
compatible with applications that use SDL2 for video.
The Tegra Graphics Debugger is available from NVidia here:
https://developer.nvidia.com/tegra-graphics-debugger
Why is API level 19 the minimum required?
================================================================================
The latest NDK toolchain doesn't support targeting earlier than API level 19.
As of this writing, according to https://www.composables.com/tools/distribution-chart
about 99.7% of the Android devices accessing Google Play support API level 19 or
higher (August 2023).
A note regarding the use of the "dirty rectangles" rendering technique
================================================================================
If your app uses a variation of the "dirty rectangles" rendering technique,
where you only update a portion of the screen on each frame, you may notice a
variety of visual glitches on Android, that are not present on other platforms.
This is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2
contexts, in particular the use of the eglSwapBuffers function. As stated in the
documentation for the function "The contents of ancillary buffers are always
undefined after calling eglSwapBuffers".
Setting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED
is not possible for SDL as it requires EGL 1.4, available only on the API level
17+, so the only workaround available on this platform is to redraw the entire
screen each frame.
Reference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html
Ending your application
================================================================================
Two legitimate ways:
- return from your main() function. Java side will automatically terminate the
Activity by calling Activity.finish().
- Android OS can decide to terminate your application by calling onDestroy()
(see Activity life cycle). Your application will receive a SDL_QUIT event you
can handle to save things and quit.
Don't call exit() as it stops the activity badly.
NB: "Back button" can be handled as a SDL_KEYDOWN/UP events, with Keycode
SDLK_AC_BACK, for any purpose.
Known issues
================================================================================
- The number of buttons reported for each joystick is hardcoded to be 36, which
is the current maximum number of buttons Android can report.
+163 -84
View File
@@ -1,84 +1,163 @@
CMake
================================================================================
(www.cmake.org)
SDL's build system was traditionally based on autotools. Over time, this
approach has suffered from several issues across the different supported
platforms.
To solve these problems, a new build system based on CMake is under development.
It works in parallel to the legacy system, so users can experiment with it
without complication.
While still experimental, the build system should be usable on the following
platforms:
* FreeBSD
* Linux
* VS.NET 2010
* MinGW and Msys
* macOS, iOS, and tvOS, with support for XCode
================================================================================
Usage
================================================================================
Assuming the source for SDL is located at ~/sdl
cd ~
mkdir build
cd build
cmake ../sdl
This will build the static and dynamic versions of SDL in the ~/build directory.
================================================================================
Usage, iOS/tvOS
================================================================================
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
using Xcode or Make, possibly among other build-systems.
When using a recent version of CMake (3.14+), it should be possible to:
- build SDL for iOS, both static and dynamic
- build SDL test apps (as iOS/tvOS .app bundles)
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
To use, set the following CMake variables when running CMake's configuration stage:
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
### Examples (for iOS/tvOS):
- for iOS-Simulator, using the latest, installed SDK:
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
- for iOS-Device, using the latest, installed SDK, 64-bit only
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64`
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"`
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64`
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
`cmake ~/sdl -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
- for tvOS-Simulator, using the latest, installed SDK:
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
- for tvOS-Device, using the latest, installed SDK:
`cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`
# CMake
(www.cmake.org)
SDL's build system was traditionally based on autotools. Over time, this
approach has suffered from several issues across the different supported
platforms.
To solve these problems, a new build system based on CMake was introduced.
It is developed in parallel to the legacy autotools build system, so users
can experiment with it without complication.
The CMake build system is supported on the following platforms:
* FreeBSD
* Linux
* Microsoft Visual C
* MinGW and Msys
* macOS, iOS, and tvOS, with support for XCode
* Android
* Emscripten
* RiscOS
* Playstation Vita
## Building SDL
Assuming the source for SDL is located at `~/sdl`
```sh
cd ~
mkdir build
cd build
cmake ~/sdl
cmake --build .
```
This will build the static and dynamic versions of SDL in the `~/build` directory.
Installation can be done using:
```sh
cmake --install . # '--install' requires CMake 3.15, or newer
```
## Including SDL in your project
SDL can be included in your project in 2 major ways:
- using a system SDL library, provided by your (*nix) distribution or a package manager
- using a vendored SDL library: this is SDL copied or symlinked in a subfolder.
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
```cmake
cmake_minimum_required(VERSION 3.5)
project(mygame)
# Create an option to switch between a system sdl library and a vendored sdl library
option(MYGAME_VENDORED "Use vendored libraries" OFF)
if(MYGAME_VENDORED)
add_subdirectory(vendored/sdl EXCLUDE_FROM_ALL)
else()
# 1. Look for a SDL2 package, 2. look for the SDL2 component and 3. fail if none can be found
find_package(SDL2 REQUIRED CONFIG REQUIRED COMPONENTS SDL2)
# 1. Look for a SDL2 package, 2. Look for the SDL2maincomponent and 3. DO NOT fail when SDL2main is not available
find_package(SDL2 REQUIRED CONFIG COMPONENTS SDL2main)
endif()
# Create your game executable target as usual
add_executable(mygame WIN32 mygame.c)
# SDL2::SDL2main may or may not be available. It is e.g. required by Windows GUI applications
if(TARGET SDL2::SDL2main)
# It has an implicit dependency on SDL2 functions, so it MUST be added before SDL2::SDL2 (or SDL2::SDL2-static)
target_link_libraries(mygame PRIVATE SDL2::SDL2main)
endif()
# Link to the actual SDL2 library. SDL2::SDL2 is the shared SDL library, SDL2::SDL2-static is the static SDL libarary.
target_link_libraries(mygame PRIVATE SDL2::SDL2)
```
### A system SDL library
For CMake to find SDL, it must be installed in [a default location CMake is looking for](https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure).
The following components are available, to be used as an argument of `find_package`.
| Component name | Description |
|----------------|--------------------------------------------------------------------------------------------|
| SDL2 | The SDL2 shared library, available through the `SDL2::SDL2` target [^SDL_TARGET_EXCEPTION] |
| SDL2-static | The SDL2 static library, available through the `SDL2::SDL2-static` target |
| SDL2main | The SDL2main static library, available through the `SDL2::SDL2main` target |
| SDL2test | The SDL2test static library, available through the `SDL2::SDL2test` target |
### Using a vendored SDL
This only requires a copy of SDL in a subdirectory.
## CMake configuration options for platforms
### iOS/tvOS
CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
using Xcode or Make, possibly among other build-systems.
When using a recent version of CMake (3.14+), it should be possible to:
- build SDL for iOS, both static and dynamic
- build SDL test apps (as iOS/tvOS .app bundles)
- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
To use, set the following CMake variables when running CMake's configuration stage:
- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
`appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
#### Examples
- for iOS-Simulator, using the latest, installed SDK:
```bash
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
```
- for iOS-Device, using the latest, installed SDK, 64-bit only
```bash
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64
```
- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
```cmake
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"
```
- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
```cmake
cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64
```
- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
```cmake
cmake ~/sdl -DSDL_TESTS=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
```
- for tvOS-Simulator, using the latest, installed SDK:
```cmake
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64
```
- for tvOS-Device, using the latest, installed SDK:
```cmake
cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`
```
[^SDL_TARGET_EXCEPTION]: `SDL2::SDL2` can be an ALIAS to a static `SDL2::SDL2-static` target for multiple reasons.
+123 -123
View File
@@ -1,123 +1,123 @@
DirectFB
========
Supports:
- Hardware YUV overlays
- OpenGL - software only
- 2D/3D accelerations (depends on directfb driver)
- multiple displays
- windows
What you need:
* DirectFB 1.0.1, 1.2.x, 1.3.0
* Kernel-Framebuffer support: required: vesafb, radeonfb ....
* Mesa 7.0.x - optional for OpenGL
The `/etc/directfbrc` file should contain the following lines to make
your joystick work and avoid crashes:
```
disable-module=joystick
disable-module=cle266
disable-module=cyber5k
no-linux-input-grab
```
To disable to use x11 backend when DISPLAY variable is found use
```
export SDL_DIRECTFB_X11_CHECK=0
```
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
use
```
export SDL_DIRECTFB_LINUX_INPUT=0
```
To use hardware accelerated YUV-overlays for YUV-textures, use:
```
export SDL_DIRECTFB_YUV_DIRECT=1
```
This is disabled by default. It will only support one
YUV texture, namely the first. Every other YUV texture will be
rendered in software.
In addition, you may use (directfb-1.2.x)
```
export SDL_DIRECTFB_YUV_UNDERLAY=1
```
to make the YUV texture an underlay. This will make the cursor to
be shown.
Simple Window Manager
=====================
The driver has support for a very, very basic window manager you may
want to use when running with `wm=default`. Use
```
export SDL_DIRECTFB_WM=1
```
to enable basic window borders. In order to have the window title rendered,
you need to have the following font installed:
```
/usr/share/fonts/truetype/freefont/FreeSans.ttf
```
OpenGL Support
==============
The following instructions will give you *software* OpenGL. However this
works at least on all directfb supported platforms.
As of this writing 20100802 you need to pull Mesa from git and do the following:
```
git clone git://anongit.freedesktop.org/git/mesa/mesa
cd mesa
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
```
Edit `configs/linux-directfb` so that the Directories-section looks like this:
```
# Directories
SRC_DIRS = mesa glu
GLU_DIRS = sgi
DRIVER_DIRS = directfb
PROGRAM_DIRS =
```
Then do the following:
```
make linux-directfb
make
echo Installing - please enter sudo pw.
sudo make install INSTALL_DIR=/usr/local/dfb_GL
cd src/mesa/drivers/directfb
make
sudo make install INSTALL_DIR=/usr/local/dfb_GL
```
To run the SDL - testprograms:
```
export SDL_VIDEODRIVER=directfb
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
./testgl
```
DirectFB
========
Supports:
- Hardware YUV overlays
- OpenGL - software only
- 2D/3D accelerations (depends on directfb driver)
- multiple displays
- windows
What you need:
* DirectFB 1.0.1, 1.2.x, 1.3.0
* Kernel-Framebuffer support: required: vesafb, radeonfb ....
* Mesa 7.0.x - optional for OpenGL
The `/etc/directfbrc` file should contain the following lines to make
your joystick work and avoid crashes:
```
disable-module=joystick
disable-module=cle266
disable-module=cyber5k
no-linux-input-grab
```
To disable to use x11 backend when DISPLAY variable is found use
```
export SDL_DIRECTFB_X11_CHECK=0
```
To disable the use of linux input devices, i.e. multimice/multikeyboard support,
use
```
export SDL_DIRECTFB_LINUX_INPUT=0
```
To use hardware accelerated YUV-overlays for YUV-textures, use:
```
export SDL_DIRECTFB_YUV_DIRECT=1
```
This is disabled by default. It will only support one
YUV texture, namely the first. Every other YUV texture will be
rendered in software.
In addition, you may use (directfb-1.2.x)
```
export SDL_DIRECTFB_YUV_UNDERLAY=1
```
to make the YUV texture an underlay. This will make the cursor to
be shown.
Simple Window Manager
=====================
The driver has support for a very, very basic window manager you may
want to use when running with `wm=default`. Use
```
export SDL_DIRECTFB_WM=1
```
to enable basic window borders. In order to have the window title rendered,
you need to have the following font installed:
```
/usr/share/fonts/truetype/freefont/FreeSans.ttf
```
OpenGL Support
==============
The following instructions will give you *software* OpenGL. However this
works at least on all directfb supported platforms.
As of this writing 20100802 you need to pull Mesa from git and do the following:
```
git clone git://anongit.freedesktop.org/git/mesa/mesa
cd mesa
git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a
```
Edit `configs/linux-directfb` so that the Directories-section looks like this:
```
# Directories
SRC_DIRS = mesa glu
GLU_DIRS = sgi
DRIVER_DIRS = directfb
PROGRAM_DIRS =
```
Then do the following:
```
make linux-directfb
make
echo Installing - please enter sudo pw.
sudo make install INSTALL_DIR=/usr/local/dfb_GL
cd src/mesa/drivers/directfb
make
sudo make install INSTALL_DIR=/usr/local/dfb_GL
```
To run the SDL - testprograms:
```
export SDL_VIDEODRIVER=directfb
export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib
export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7
./testgl
```
+138 -138
View File
@@ -1,138 +1,138 @@
# Dynamic API
Originally posted on Ryan's Google+ account.
Background:
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
but developers are shipping their own SDL2 with individual Steam games.
These games might stop getting updates, but a newer SDL2 might be needed later.
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
ever needed, and these fixes won't make it to a game shipping its own SDL.
- Even if we replace the SDL2 in those games with a compatible one, that is to
say, edit a developer's Steam depot (yuck!), there are developers that are
statically linking SDL2 that we can't do this for. We can't even force the
dynamic loader to ignore their SDL2 in this case, of course.
- If you don't ship an SDL2 with the game in some form, people that disabled the
Steam Runtime, or just tried to run the game from the command line instead of
Steam might find themselves unable to run the game, due to a missing dependency.
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
generic Linux boxes that may or may not have SDL2 installed, you have to ship
the library or risk a total failure to launch. So now, you might have to have
a non-Steam build plus a Steam build (that is, one with and one without SDL2
included), which is inconvenient if you could have had one universal build
that works everywhere.
- We like the zlib license, but the biggest complaint from the open source
community about the license change is the static linking. The LGPL forced this
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
concerned about the GNU freedoms found themselves solving the same problems:
swapping in a newer SDL to an older game often times can save the day.
Static linking stops this dead.
So here's what we did:
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
now looks like:
```c
UInt32 SDL_Init(Uint32 flags)
{
return jump_table.SDL_Init(flags);
}
```
Except that is all done with a bunch of macro magic so we don't have to maintain
every one of these.
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
SDL_Init() that you've been calling all this time. But at startup, it looks more
like this:
```c
Uint32 SDL_Init_DEFAULT(Uint32 flags)
{
SDL_InitDynamicAPI();
return jump_table.SDL_Init(flags);
}
```
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
pointers, which means that this `_DEFAULT` function never gets called again.
First call to any SDL function sets the whole thing up.
So you might be asking, what was the value in that? Isn't this what the operating
system's dynamic loader was supposed to do for us? Yes, but now we've got this
level of indirection, we can do things like this:
```bash
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
./MyGameThatIsStaticallyLinkedToSDL2
```
And now, this game that is statically linked to SDL, can still be overridden
with a newer, or better, SDL. The statically linked one will only be used as
far as calling into the jump table in this case. But in cases where no override
is desired, the statically linked version will provide its own jump table,
and everyone is happy.
So now:
- Developers can statically link SDL, and users can still replace it.
(We'd still rather you ship a shared library, though!)
- Developers can ship an SDL with their game, Valve can override it for, say,
new features on SteamOS, or distros can override it for their own needs,
but it'll also just work in the default case.
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
and it'll do the right thing.
- End users (and Valve) can update a game's SDL in almost any case,
to keep abandoned games running on newer platforms.
- Everyone develops with SDL exactly as they have been doing all along.
Same headers, same ABI. Just get the latest version to enable this magic.
A little more about SDL_InitDynamicAPI():
Internally, InitAPI does some locking to make sure everything waits until a
single thread initializes everything (although even SDL_CreateThread() goes
through here before spinning a thread, too), and then decides if it should use
an external SDL library. If not, it sets up the jump table using the current
SDL's function pointers (which might be statically linked into a program, or in
a shared library of its own). If so, it loads that library and looks for and
calls a single function:
```c
SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
```
That function takes a version number (more on that in a moment), the address of
the jump table, and the size, in bytes, of the table.
Now, we've got policy here: this table's layout never changes; new stuff gets
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
if it's smaller, we know we can provide the entire API that the caller needs.
The version variable is a failsafe switch.
Right now it's always 1. This number changes when there are major API changes
(so we know if the tablesize might be smaller, or entries in it have changed).
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
inconceivable to have a small dispatch library that only supplies this one
function and loads different, otherwise-incompatible SDL libraries and has the
right one initialize the jump table based on the version. For something that
must generically catch lots of different versions of SDL over time, like the
Steam Client, this isn't a bad option.
Finally, I'm sure some people are reading this and thinking,
"I don't want that overhead in my project!"
To which I would point out that the extra function call through the jump table
probably wouldn't even show up in a profile, but lucky you: this can all be
disabled. You can build SDL without this if you absolutely must, but we would
encourage you not to do that. However, on heavily locked down platforms like
iOS, or maybe when debugging, it makes sense to disable it. The way this is
designed in SDL, you just have to change one #define, and the entire system
vaporizes out, and SDL functions exactly like it always did. Most of it is
macro magic, so the system is contained to one C file and a few headers.
However, this is on by default and you have to edit a header file to turn it
off. Our hopes is that if we make it easy to disable, but not too easy,
everyone will ultimately be able to get what they want, but we've gently
nudged everyone towards what we think is the best solution.
# Dynamic API
Originally posted on Ryan's Google+ account.
Background:
- The Steam Runtime has (at least in theory) a really kick-ass build of SDL2,
but developers are shipping their own SDL2 with individual Steam games.
These games might stop getting updates, but a newer SDL2 might be needed later.
Certainly we'll always be fixing bugs in SDL, even if a new video target isn't
ever needed, and these fixes won't make it to a game shipping its own SDL.
- Even if we replace the SDL2 in those games with a compatible one, that is to
say, edit a developer's Steam depot (yuck!), there are developers that are
statically linking SDL2 that we can't do this for. We can't even force the
dynamic loader to ignore their SDL2 in this case, of course.
- If you don't ship an SDL2 with the game in some form, people that disabled the
Steam Runtime, or just tried to run the game from the command line instead of
Steam might find themselves unable to run the game, due to a missing dependency.
- If you want to ship on non-Steam platforms like GOG or Humble Bundle, or target
generic Linux boxes that may or may not have SDL2 installed, you have to ship
the library or risk a total failure to launch. So now, you might have to have
a non-Steam build plus a Steam build (that is, one with and one without SDL2
included), which is inconvenient if you could have had one universal build
that works everywhere.
- We like the zlib license, but the biggest complaint from the open source
community about the license change is the static linking. The LGPL forced this
as a legal, not technical issue, but zlib doesn't care. Even those that aren't
concerned about the GNU freedoms found themselves solving the same problems:
swapping in a newer SDL to an older game often times can save the day.
Static linking stops this dead.
So here's what we did:
SDL now has, internally, a table of function pointers. So, this is what SDL_Init
now looks like:
```c
UInt32 SDL_Init(Uint32 flags)
{
return jump_table.SDL_Init(flags);
}
```
Except that is all done with a bunch of macro magic so we don't have to maintain
every one of these.
What is jump_table.SDL_init()? Eventually, that's a function pointer of the real
SDL_Init() that you've been calling all this time. But at startup, it looks more
like this:
```c
Uint32 SDL_Init_DEFAULT(Uint32 flags)
{
SDL_InitDynamicAPI();
return jump_table.SDL_Init(flags);
}
```
SDL_InitDynamicAPI() fills in jump_table with all the actual SDL function
pointers, which means that this `_DEFAULT` function never gets called again.
First call to any SDL function sets the whole thing up.
So you might be asking, what was the value in that? Isn't this what the operating
system's dynamic loader was supposed to do for us? Yes, but now we've got this
level of indirection, we can do things like this:
```bash
export SDL_DYNAMIC_API=/my/actual/libSDL-2.0.so.0
./MyGameThatIsStaticallyLinkedToSDL2
```
And now, this game that is statically linked to SDL, can still be overridden
with a newer, or better, SDL. The statically linked one will only be used as
far as calling into the jump table in this case. But in cases where no override
is desired, the statically linked version will provide its own jump table,
and everyone is happy.
So now:
- Developers can statically link SDL, and users can still replace it.
(We'd still rather you ship a shared library, though!)
- Developers can ship an SDL with their game, Valve can override it for, say,
new features on SteamOS, or distros can override it for their own needs,
but it'll also just work in the default case.
- Developers can ship the same package to everyone (Humble Bundle, GOG, etc),
and it'll do the right thing.
- End users (and Valve) can update a game's SDL in almost any case,
to keep abandoned games running on newer platforms.
- Everyone develops with SDL exactly as they have been doing all along.
Same headers, same ABI. Just get the latest version to enable this magic.
A little more about SDL_InitDynamicAPI():
Internally, InitAPI does some locking to make sure everything waits until a
single thread initializes everything (although even SDL_CreateThread() goes
through here before spinning a thread, too), and then decides if it should use
an external SDL library. If not, it sets up the jump table using the current
SDL's function pointers (which might be statically linked into a program, or in
a shared library of its own). If so, it loads that library and looks for and
calls a single function:
```c
SInt32 SDL_DYNAPI_entry(Uint32 version, void *table, Uint32 tablesize);
```
That function takes a version number (more on that in a moment), the address of
the jump table, and the size, in bytes, of the table.
Now, we've got policy here: this table's layout never changes; new stuff gets
added to the end. Therefore SDL_DYNAPI_entry() knows that it can provide all
the needed functions if tablesize <= sizeof its own jump table. If tablesize is
bigger (say, SDL 2.0.4 is trying to load SDL 2.0.3), then we know to abort, but
if it's smaller, we know we can provide the entire API that the caller needs.
The version variable is a failsafe switch.
Right now it's always 1. This number changes when there are major API changes
(so we know if the tablesize might be smaller, or entries in it have changed).
Right now SDL_DYNAPI_entry gives up if the version doesn't match, but it's not
inconceivable to have a small dispatch library that only supplies this one
function and loads different, otherwise-incompatible SDL libraries and has the
right one initialize the jump table based on the version. For something that
must generically catch lots of different versions of SDL over time, like the
Steam Client, this isn't a bad option.
Finally, I'm sure some people are reading this and thinking,
"I don't want that overhead in my project!"
To which I would point out that the extra function call through the jump table
probably wouldn't even show up in a profile, but lucky you: this can all be
disabled. You can build SDL without this if you absolutely must, but we would
encourage you not to do that. However, on heavily locked down platforms like
iOS, or maybe when debugging, it makes sense to disable it. The way this is
designed in SDL, you just have to change one #define, and the entire system
vaporizes out, and SDL functions exactly like it always did. Most of it is
macro magic, so the system is contained to one C file and a few headers.
However, this is on by default and you have to edit a header file to turn it
off. Our hopes is that if we make it easy to disable, but not too easy,
everyone will ultimately be able to get what they want, but we've gently
nudged everyone towards what we think is the best solution.
+76 -35
View File
@@ -1,35 +1,76 @@
Emscripten
================================================================================
Build:
$ mkdir build
$ cd build
$ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2"
$ emmake make
Or with cmake:
$ mkdir build
$ cd build
$ emcmake cmake ..
$ emmake make
To build one of the tests:
$ cd test/
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
Uses GLES2 renderer or software
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
$ EMCONFIGURE_JS=1 emconfigure ../configure
build as usual...
SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
$ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
build as usual...
# Emscripten
(This documentation is not very robust; we will update and expand this later.)
## A quick note about audio
Modern web browsers will not permit web pages to produce sound before the
user has interacted with them; this is for several reasons, not the least
of which being that no one likes when a random browser tab suddenly starts
making noise and the user has to scramble to figure out which and silence
it.
To solve this, most browsers will refuse to let a web app use the audio
subsystem at all before the user has interacted with (clicked on) the page
in a meaningful way. SDL-based apps also have to deal with this problem; if
the user hasn't interacted with the page, SDL_OpenAudioDevice will fail.
There are two reasonable ways to deal with this: if you are writing some
sort of media player thing, where the user expects there to be a volume
control when you mouseover the canvas, just default that control to a muted
state; if the user clicks on the control to unmute it, on this first click,
open the audio device. This allows the media to play at start, the user can
reasonably opt-in to listening, and you never get access denied to the audio
device.
Many games do not have this sort of UI, and are more rigid about starting
audio along with everything else at the start of the process. For these, your
best bet is to write a little Javascript that puts up a "Click here to play!"
UI, and upon the user clicking, remove that UI and then call the Emscripten
app's main() function. As far as the application knows, the audio device was
available to be opened as soon as the program started, and since this magic
happens in a little Javascript, you don't have to change your C/C++ code at
all to make it happen.
Please see the discussion at https://github.com/libsdl-org/SDL/issues/6385
for some Javascript code to steal for this approach.
## Building SDL/emscripten
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
are likely to work, as well.
Build:
$ mkdir build
$ cd build
$ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2"
$ emmake make
Or with cmake:
$ mkdir build
$ cd build
$ emcmake cmake ..
$ emmake make
To build one of the tests:
$ cd test/
$ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
Uses GLES2 renderer or software
Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere):
SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/):
$ EMCONFIGURE_JS=1 emconfigure ../configure
build as usual...
SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx):
$ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx
build as usual...
+155
View File
@@ -0,0 +1,155 @@
GDK
=====
This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
Windows (GDK) and Xbox One/Xbox Series (GDKX) are supported. Although most of the Xbox code is included in the public SDL source code, NDA access is required for a small number of source files. If you have access to GDKX, these required Xbox files are posted on the GDK forums [here](https://forums.xboxlive.com/questions/130003/).
Requirements
------------
* Microsoft Visual Studio 2022 (in theory, it should also work in 2017 or 2019, but this has not been tested)
* Microsoft GDK June 2022 or newer (public release [here](https://github.com/microsoft/GDK/releases/tag/June_2022))
* To publish a package or successfully authenticate a user, you will need to create an app id/configure services in Partner Center. However, for local testing purposes (without authenticating on Xbox Live), the identifiers used by the GDK test programs in the included solution will work.
Windows GDK Status
------
The Windows GDK port supports the full set of Win32 APIs, renderers, controllers, input devices, etc., as the normal Windows x64 build of SDL.
* Additionally, the GDK port adds the following:
* Compile-time platform detection for SDL programs. The `__GDK__` is `#define`d on every GDK platform, and the `__WINGDK__` is `#define`d on Windows GDK, specifically. (This distinction exists because other GDK platforms support a smaller subset of functionality. This allows you to mark code for "any" GDK separate from Windows GDK.)
* GDK-specific setup:
* Initializing/uninitializing the game runtime, and initializing Xbox Live services
* Creating a global task queue and setting it as the default for the process. When running any async operations, passing in `NULL` as the task queue will make the task get added to the global task queue.
* An implementation on `WinMain` that performs the above GDK setup (you should link against SDL2main.lib, as in Windows x64). If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
* Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`).
* You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak).
* What doesn't work:
* Compilation with anything other than through the included Visual C++ solution file
## VisualC-GDK Solution
The included `VisualC-GDK/SDL.sln` solution includes the following targets for the Gaming.Desktop.x64 configuration:
* SDL2 (DLL) - This is the typical SDL2.dll, but for Gaming.Desktop.x64.
* SDL2main (lib) - This contains a drop-in implementation of `WinMain` that is used as the entry point for GDK programs.
* tests/testgamecontroller - Standard SDL test program demonstrating controller functionality.
* tests/testgdk - GDK-specific test program that demonstrates using the global task queue to login a user into Xbox Live.
*NOTE*: As of the June 2022 GDK, you cannot test user logins without a valid Title ID and MSAAppId. You will need to manually change the identifiers in the `MicrosoftGame.config` to your valid IDs from Partner Center if you wish to test this.
* tests/testsprite2 - Standard SDL test program demonstrating sprite drawing functionality.
If you set one of the test programs as a startup project, you can run it directly from Visual Studio.
Windows GDK Setup, Detailed Steps
---------------------
These steps assume you already have a game using SDL that runs on Windows x64 along with a corresponding Visual Studio solution file for the x64 version. If you don't have this, it's easiest to use one of the test program vcxproj files in the `VisualC-GDK` directory as a starting point, though you will still need to do most of the steps below.
### 1. Add a Gaming.Desktop.x64 Configuration ###
In your game's existing Visual Studio Solution, go to Build > Configuration Manager. From the "Active solution platform" drop-down select "New...". From the drop-down list, select Gaming.Desktop.x64 and copy the settings from the x64 configuration.
### 2. Build SDL2 and SDL2main for GDK ###
Open `VisualC-GDK/SDL.sln` in Visual Studio, you need to build the SDL2 and SDL2main targets for the Gaming.Desktop.x64 platform (Release is recommended). You will need to copy/keep track of the `SDL2.dll`, `XCurl.dll` (which is output by Gaming.Desktop.x64), `SDL2.lib`, and `SDL2main.lib` output files for your game project.
*Alternatively*, you could setup your solution file to instead reference the SDL2/SDL2main project file targets from the SDL source, and add those projects as a dependency. This would mean that SDL2 and SDL2main would both be built when your game is built.
### 3. Configuring Project Settings ###
While the Gaming.Desktop.x64 configuration sets most of the required settings, there are some additional items to configure for your game project under the Gaming.Desktop.x64 Configuration:
* Under C/C++ > General > Additional Include Directories, make sure the `SDL/include` path is referenced
* Under Linker > General > Additional Library Directories, make sure to reference the path where the newly-built SDL2.lib and SDL2main.lib are
* Under Linker > Input > Additional Dependencies, you need the following:
* `SDL2.lib`
* `SDL2main.lib` (unless not using)
* `xgameruntime.lib`
* `../Microsoft.Xbox.Services.141.GDK.C.Thunks.lib`
* Note that in general, the GDK libraries depend on the MSVC C/C++ runtime, so there is no way to remove this dependency from a GDK program that links against GDK.
### 4. Setting up SDL_main ###
Rather than using your own implementation of `WinMain`, it's recommended that you instead `#include "SDL_main.h"` and declare a standard main function. If you are unable to do this, you can instead manually call `SDL_GDKRunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters.
### 5. Required DLLs ###
The game will not launch in the debugger unless required DLLs are included in the directory that contains the game's .exe file. You need to make sure that the following files are copied into the directory:
* Your SDL2.dll
* "$(Console_GRDKExtLibRoot)Xbox.Services.API.C\DesignTime\CommonConfiguration\Neutral\Lib\Release\Microsoft.Xbox.Services.141.GDK.C.Thunks.dll"
* XCurl.dll
You can either copy these in a post-build step, or you can add the dlls into the project and set its Configuration Properties > General > Item type to "Copy file," which will also copy them into the output directory.
### 6. Setting up MicrosoftGame.config ###
You can copy `VisualC-GDK/tests/testgdk/MicrosoftGame.config` and use that as a starting point in your project. Minimally, you will want to change the Executable Name attribute, the DefaultDisplayName, and the Description.
This file must be copied into the same directory as the game's .exe file. As with the DLLs, you can either use a post-build step or the "Copy file" item type.
For basic testing, you do not need to change anything else in `MicrosoftGame.config`. However, if you want to test any Xbox Live services (such as logging in users) _or_ publish a package, you will need to setup a Game app on Partner Center.
Then, you need to set the following values to the values from Partner Center:
* Identity tag - Name and Publisher attributes
* TitleId
* MSAAppId
### 7. Adding Required Logos
Several logo PNG files are required to be able to launch the game, even from the debugger. You can use the sample logos provided in `VisualC-GDK/logos`. As with the other files, they must be copied into the same directory as the game's .exe file.
### 8. Copying any Data Files ###
When debugging GDK games, there is no way to specify a working directory. Therefore, any required game data must also be copied into the output directory, likely in a post-build step.
### 9. Build and Run from Visual Studio ###
At this point, you should be able to build and run your game from the Visual Studio Debugger. If you get any linker errors, make sure you double-check that you referenced all the required libs.
If you are testing Xbox Live functionality, it's likely you will need to change to the Sandbox for your title. To do this:
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
2. Switch the sandbox name with:
`XblPCSandbox SANDBOX.#`
3. (To switch back to the retail sandbox):
`XblPCSandbox RETAIL`
### 10. Packaging and Installing Locally
You can use one of the test program's `PackageLayout.xml` as a starting point. Minimally, you will need to change the exe to the correct name and also reference any required game data. As with the other data files, it's easiest if you have this copy to the output directory, although it's not a requirement as you can specify relative paths to files.
To create the package:
1. Run "Desktop VS 2022 Gaming Command Prompt" from the Start Menu
2. `cd` to the directory containing the `PackageLayout.xml` with the correct paths (if you use the local path as in the sample package layout, this would be from your .exe output directory)
3. `mkdir Package` to create an output directory
4. To package the file into the `Package` directory, use:
`makepkg pack /f PackageLayout.xml /lt /d . /nogameos /pc /pd Package`
5. To install the package, use:
`wdapp install PACKAGENAME.msixvc`
6. Once the package is installed, you can run it from the start menu.
7. As with when running from Visual Studio, if you need to test any Xbox Live functionality you must switch to the correct sandbox.
Troubleshooting
---------------
#### Xbox Live Login does not work
As of June 2022 GDK, you must have a valid Title Id and MSAAppId in order to test Xbox Live functionality such as user login. Make sure these are set correctly in the `MicrosoftGame.config`. This means that even testgdk will not let you login without setting these properties to valid values.
Furthermore, confirm that your PC is set to the correct sandbox.
#### "The current user has already installed an unpackaged version of this app. A packaged version cannot replace this." error when installing
Prior to June 2022 GDK, running from the Visual Studio debugger would still locally register the app (and it would appear on the start menu). To fix this, you have to uninstall it (it's simplest to right click on it from the start menu to uninstall it).
+71 -71
View File
@@ -1,71 +1,71 @@
Dollar Gestures
===========================================================================
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
Recording:
----------
To begin recording on a touch device call:
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
A SDL_DOLLARRECORD event is a dgesture with the following fields:
* event.dgesture.touchId - the Id of the touch used to record the gesture.
* event.dgesture.gestureId - the unique id of the recorded gesture.
Performing:
-----------
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
* event.dgesture.touchId - the Id of the touch which performed the gesture.
* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
* event.dgesture.numFingers - the number of fingers used to draw the stroke.
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
Saving:
-------
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
Both functions return the number of gestures successfully saved.
Loading:
--------
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
===========================================================================
Multi Gestures
===========================================================================
SDL provides simple support for pinch/rotate/swipe gestures.
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
* event.mgesture.touchId - the Id of the touch on which the gesture was performed.
* event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
* event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
* event.mgesture.dTheta - the amount that the fingers rotated during this motion.
* event.mgesture.dDist - the amount that the fingers pinched during this motion.
* event.mgesture.numFingers - the number of fingers used in the gesture.
===========================================================================
Notes
===========================================================================
For a complete example see test/testgesture.c
Please direct questions/comments to:
jim.tla+sdl_touch@gmail.com
Dollar Gestures
===========================================================================
SDL provides an implementation of the $1 gesture recognition system. This allows for recording, saving, loading, and performing single stroke gestures.
Gestures can be performed with any number of fingers (the centroid of the fingers must follow the path of the gesture), but the number of fingers must be constant (a finger cannot go down in the middle of a gesture). The path of a gesture is considered the path from the time when the final finger went down, to the first time any finger comes up.
Dollar gestures are assigned an Id based on a hash function. This is guaranteed to remain constant for a given gesture. There is a (small) chance that two different gestures will be assigned the same ID. In this case, simply re-recording one of the gestures should result in a different ID.
Recording:
----------
To begin recording on a touch device call:
SDL_RecordGesture(SDL_TouchID touchId), where touchId is the id of the touch device you wish to record on, or -1 to record on all connected devices.
Recording terminates as soon as a finger comes up. Recording is acknowledged by an SDL_DOLLARRECORD event.
A SDL_DOLLARRECORD event is a dgesture with the following fields:
* event.dgesture.touchId - the Id of the touch used to record the gesture.
* event.dgesture.gestureId - the unique id of the recorded gesture.
Performing:
-----------
As long as there is a dollar gesture assigned to a touch, every finger-up event will also cause an SDL_DOLLARGESTURE event with the following fields:
* event.dgesture.touchId - the Id of the touch which performed the gesture.
* event.dgesture.gestureId - the unique id of the closest gesture to the performed stroke.
* event.dgesture.error - the difference between the gesture template and the actual performed gesture. Lower error is a better match.
* event.dgesture.numFingers - the number of fingers used to draw the stroke.
Most programs will want to define an appropriate error threshold and check to be sure that the error of a gesture is not abnormally high (an indicator that no gesture was performed).
Saving:
-------
To save a template, call SDL_SaveDollarTemplate(gestureId, dst) where gestureId is the id of the gesture you want to save, and dst is an SDL_RWops pointer to the file where the gesture will be stored.
To save all currently loaded templates, call SDL_SaveAllDollarTemplates(dst) where dst is an SDL_RWops pointer to the file where the gesture will be stored.
Both functions return the number of gestures successfully saved.
Loading:
--------
To load templates from a file, call SDL_LoadDollarTemplates(touchId,src) where touchId is the id of the touch to load to (or -1 to load to all touch devices), and src is an SDL_RWops pointer to a gesture save file.
SDL_LoadDollarTemplates returns the number of templates successfully loaded.
===========================================================================
Multi Gestures
===========================================================================
SDL provides simple support for pinch/rotate/swipe gestures.
Every time a finger is moved an SDL_MULTIGESTURE event is sent with the following fields:
* event.mgesture.touchId - the Id of the touch on which the gesture was performed.
* event.mgesture.x - the normalized x coordinate of the gesture. (0..1)
* event.mgesture.y - the normalized y coordinate of the gesture. (0..1)
* event.mgesture.dTheta - the amount that the fingers rotated during this motion.
* event.mgesture.dDist - the amount that the fingers pinched during this motion.
* event.mgesture.numFingers - the number of fingers used in the gesture.
===========================================================================
Notes
===========================================================================
For a complete example see test/testgesture.c
Please direct questions/comments to:
jim.tla+sdl_touch@gmail.com
+19 -19
View File
@@ -1,19 +1,19 @@
git
=========
The latest development version of SDL is available via git.
Git allows you to get up-to-the-minute fixes and enhancements;
as a developer works on a source tree, you can use "git" to mirror that
source tree instead of waiting for an official release. Please look
at the Git website ( https://git-scm.com/ ) for more
information on using git, where you can also download software for
macOS, Windows, and Unix systems.
git clone https://github.com/libsdl-org/SDL
If you are building SDL via configure, you will need to run autogen.sh
before running configure.
There is a web interface to the Git repository at:
http://github.com/libsdl-org/SDL/
git
=========
The latest development version of SDL is available via git.
Git allows you to get up-to-the-minute fixes and enhancements;
as a developer works on a source tree, you can use "git" to mirror that
source tree instead of waiting for an official release. Please look
at the Git website ( https://git-scm.com/ ) for more
information on using git, where you can also download software for
macOS, Windows, and Unix systems.
git clone https://github.com/libsdl-org/SDL
If you are building SDL via configure, you will need to run autogen.sh
before running configure.
There is a web interface to the Git repository at:
http://github.com/libsdl-org/SDL/
+4 -4
View File
@@ -1,4 +1,4 @@
We are no longer hosted in Mercurial. Please see README-git.md for details.
Thanks!
We are no longer hosted in Mercurial. Please see README-git.md for details.
Thanks!
+307 -275
View File
@@ -1,275 +1,307 @@
iOS
======
Building the Simple DirectMedia Layer for iOS 5.1+
==============================================================================
Requirements: Mac OS X 10.8 or later and the iOS 7+ SDK.
Instructions:
1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode.
2. Select your desired target, and hit build.
Using the Simple DirectMedia Layer for iOS
==============================================================================
1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology.
2. In the main view, delete all files except for Assets and LaunchScreen
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS"
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files
9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
10. Add any assets that your application needs.
11. Enjoy!
TODO: Add information regarding App Store requirements such as icons, etc.
Notes -- Retina / High-DPI and window sizes
==============================================================================
Window and display mode sizes in SDL are in "screen coordinates" (or "points",
in Apple's terminology) rather than in pixels. On iOS this means that a window
created on an iPhone 6 will have a size in screen coordinates of 375 x 667,
rather than a size in pixels of 750 x 1334. All iOS apps are expected to
size their content based on screen coordinates / points rather than pixels,
as this allows different iOS devices to have different pixel densities
(Retina versus non-Retina screens, etc.) without apps caring too much.
By default SDL will not use the full pixel density of the screen on
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
creating your window to enable high-dpi support.
When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes
will still be in "screen coordinates" rather than pixels, but the window will
have a much greater pixel density when the device supports it, and the
SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
the size in pixels of the drawable screen framebuffer.
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
orthographic projection matrix using the size in screen coordinates
(SDL_GetWindowSize()) can be used in order to display content at the same scale
no matter whether a Retina device is used or not.
Notes -- Application events
==============================================================================
On iOS the application goes through a fixed life cycle and you will get
notifications of state changes via application events. When these events
are delivered you must handle them in an event callback because the OS may
not give you any processing time after the events are delivered.
e.g.
int HandleAppEvents(void *userdata, SDL_Event *event)
{
switch (event->type)
{
case SDL_APP_TERMINATING:
/* Terminate the app.
Shut everything down before returning from this function.
*/
return 0;
case SDL_APP_LOWMEMORY:
/* You will get this when your app is paused and iOS wants more memory.
Release as much memory as possible.
*/
return 0;
case SDL_APP_WILLENTERBACKGROUND:
/* Prepare your app to go into the background. Stop loops, etc.
This gets called when the user hits the home button, or gets a call.
*/
return 0;
case SDL_APP_DIDENTERBACKGROUND:
/* This will get called if the user accepted whatever sent your app to the background.
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
When you get this, you have 5 seconds to save all your state or the app will be terminated.
Your app is NOT active at this point.
*/
return 0;
case SDL_APP_WILLENTERFOREGROUND:
/* This call happens when your app is coming back to the foreground.
Restore all your state here.
*/
return 0;
case SDL_APP_DIDENTERFOREGROUND:
/* Restart your loops here.
Your app is interactive and getting CPU again.
*/
return 0;
default:
/* No special processing, add it to the event queue */
return 1;
}
}
int main(int argc, char *argv[])
{
SDL_SetEventFilter(HandleAppEvents, NULL);
... run your main loop
return 0;
}
Notes -- Accelerometer as Joystick
==============================================================================
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
Notes -- OpenGL ES
==============================================================================
Your SDL application for iOS uses OpenGL ES for video by default.
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute().
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0.
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called.
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called.
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h).
Notes -- Keyboard
==============================================================================
The SDL keyboard API has been extended to support on-screen keyboards:
void SDL_StartTextInput()
-- enables text events and reveals the onscreen keyboard.
void SDL_StopTextInput()
-- disables text events and hides the onscreen keyboard.
SDL_bool SDL_IsTextInputActive()
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
Notes -- Mouse
==============================================================================
iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist
Notes -- Reading and Writing files
==============================================================================
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
Once your application is installed its directory tree looks like:
MySDLApp Home/
MySDLApp.app
Documents/
Library/
Preferences/
tmp/
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
More information on this subject is available here:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
Notes -- iPhone SDL limitations
==============================================================================
Windows:
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
Textures:
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
Loading Shared Objects:
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h.
Notes -- CoreBluetooth.framework
==============================================================================
SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot
more game controller devices, but it requires permission from the user before
your app will be able to talk to the Bluetooth hardware. "Made For iOS"
branded controllers do not need this as we don't have to speak to them
directly with raw bluetooth, so many apps can live without this.
You'll need to link with CoreBluetooth.framework and add something like this
to your Info.plist:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
Game Center
==============================================================================
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
e.g.
extern "C"
void ShowFrame(void*)
{
... do event handling, frame logic and rendering ...
}
int main(int argc, char *argv[])
{
... initialize game ...
#if __IPHONEOS__
// Initialize the Game Center for scoring and matchmaking
InitGameCenter();
// Set up the game to run in the window animation callback on iOS
// so that Game Center and so forth works correctly.
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
#else
while ( running ) {
ShowFrame(0);
DelayFrame();
}
#endif
return 0;
}
Deploying to older versions of iOS
==============================================================================
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 6.1
In order to do that you need to download an older version of Xcode:
https://developer.apple.com/download/more/?name=Xcode
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
Open your project and set your deployment target to the desired version of iOS
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
iOS
======
Building the Simple DirectMedia Layer for iOS 9.0+
==============================================================================
Requirements: Mac OS X 10.9 or later and the iOS 9.0 or newer SDK.
Instructions:
1. Open SDL.xcodeproj (located in Xcode/SDL) in Xcode.
2. Select your desired target, and hit build.
Using the Simple DirectMedia Layer for iOS
==============================================================================
1. Run Xcode and create a new project using the iOS Game template, selecting the Objective C language and Metal game technology.
2. In the main view, delete all files except for Assets and LaunchScreen
3. Right click the project in the main view, select "Add Files...", and add the SDL project, Xcode/SDL/SDL.xcodeproj
4. Select the project in the main view, go to the "Info" tab and under "Custom iOS Target Properties" remove the line "Main storyboard file base name"
5. Select the project in the main view, go to the "Build Settings" tab, select "All", and edit "Header Search Path" and drag over the SDL "Public Headers" folder from the left
6. Select the project in the main view, go to the "Build Phases" tab, select "Link Binary With Libraries", and add SDL2.framework from "Framework-iOS"
7. Select the project in the main view, go to the "General" tab, scroll down to "Frameworks, Libraries, and Embedded Content", and select "Embed & Sign" for the SDL library.
8. In the main view, expand SDL -> Library Source -> main -> uikit and drag SDL_uikit_main.c into your game files
9. Add the source files that you would normally have for an SDL program, making sure to have #include "SDL.h" at the top of the file containing your main() function.
10. Add any assets that your application needs.
11. Enjoy!
TODO: Add information regarding App Store requirements such as icons, etc.
Notes -- Retina / High-DPI and window sizes
==============================================================================
Window and display mode sizes in SDL are in "screen coordinates" (or "points",
in Apple's terminology) rather than in pixels. On iOS this means that a window
created on an iPhone 6 will have a size in screen coordinates of 375 x 667,
rather than a size in pixels of 750 x 1334. All iOS apps are expected to
size their content based on screen coordinates / points rather than pixels,
as this allows different iOS devices to have different pixel densities
(Retina versus non-Retina screens, etc.) without apps caring too much.
By default SDL will not use the full pixel density of the screen on
Retina/high-dpi capable devices. Use the SDL_WINDOW_ALLOW_HIGHDPI flag when
creating your window to enable high-dpi support.
When high-dpi support is enabled, SDL_GetWindowSize() and display mode sizes
will still be in "screen coordinates" rather than pixels, but the window will
have a much greater pixel density when the device supports it, and the
SDL_GL_GetDrawableSize() or SDL_GetRendererOutputSize() functions (depending on
whether raw OpenGL or the SDL_Render API is used) can be queried to determine
the size in pixels of the drawable screen framebuffer.
Some OpenGL ES functions such as glViewport expect sizes in pixels rather than
sizes in screen coordinates. When doing 2D rendering with OpenGL ES, an
orthographic projection matrix using the size in screen coordinates
(SDL_GetWindowSize()) can be used in order to display content at the same scale
no matter whether a Retina device is used or not.
Notes -- Application events
==============================================================================
On iOS the application goes through a fixed life cycle and you will get
notifications of state changes via application events. When these events
are delivered you must handle them in an event callback because the OS may
not give you any processing time after the events are delivered.
e.g.
int HandleAppEvents(void *userdata, SDL_Event *event)
{
switch (event->type)
{
case SDL_APP_TERMINATING:
/* Terminate the app.
Shut everything down before returning from this function.
*/
return 0;
case SDL_APP_LOWMEMORY:
/* You will get this when your app is paused and iOS wants more memory.
Release as much memory as possible.
*/
return 0;
case SDL_APP_WILLENTERBACKGROUND:
/* Prepare your app to go into the background. Stop loops, etc.
This gets called when the user hits the home button, or gets a call.
*/
return 0;
case SDL_APP_DIDENTERBACKGROUND:
/* This will get called if the user accepted whatever sent your app to the background.
If the user got a phone call and canceled it, you'll instead get an SDL_APP_DIDENTERFOREGROUND event and restart your loops.
When you get this, you have 5 seconds to save all your state or the app will be terminated.
Your app is NOT active at this point.
*/
return 0;
case SDL_APP_WILLENTERFOREGROUND:
/* This call happens when your app is coming back to the foreground.
Restore all your state here.
*/
return 0;
case SDL_APP_DIDENTERFOREGROUND:
/* Restart your loops here.
Your app is interactive and getting CPU again.
*/
return 0;
default:
/* No special processing, add it to the event queue */
return 1;
}
}
int main(int argc, char *argv[])
{
SDL_SetEventFilter(HandleAppEvents, NULL);
... run your main loop
return 0;
}
Notes -- Accelerometer as Joystick
==============================================================================
SDL for iPhone supports polling the built in accelerometer as a joystick device. For an example on how to do this, see the accelerometer.c in the demos directory.
The main thing to note when using the accelerometer with SDL is that while the iPhone natively reports accelerometer as floating point values in units of g-force, SDL_JoystickGetAxis() reports joystick values as signed integers. Hence, in order to convert between the two, some clamping and scaling is necessary on the part of the iPhone SDL joystick driver. To convert SDL_JoystickGetAxis() reported values BACK to units of g-force, simply multiply the values by SDL_IPHONE_MAX_GFORCE / 0x7FFF.
Notes -- OpenGL ES
==============================================================================
Your SDL application for iOS uses OpenGL ES for video by default.
OpenGL ES for iOS supports several display pixel formats, such as RGBA8 and RGB565, which provide a 32 bit and 16 bit color buffer respectively. By default, the implementation uses RGB565, but you may use RGBA8 by setting each color component to 8 bits in SDL_GL_SetAttribute().
If your application doesn't use OpenGL's depth buffer, you may find significant performance improvement by setting SDL_GL_DEPTH_SIZE to 0.
Finally, if your application completely redraws the screen each frame, you may find significant performance improvement by setting the attribute SDL_GL_RETAINED_BACKING to 0.
OpenGL ES on iOS doesn't use the traditional system-framebuffer setup provided in other operating systems. Special care must be taken because of this:
- The drawable Renderbuffer must be bound to the GL_RENDERBUFFER binding point when SDL_GL_SwapWindow() is called.
- The drawable Framebuffer Object must be bound while rendering to the screen and when SDL_GL_SwapWindow() is called.
- If multisample antialiasing (MSAA) is used and glReadPixels is used on the screen, the drawable framebuffer must be resolved to the MSAA resolve framebuffer (via glBlitFramebuffer or glResolveMultisampleFramebufferAPPLE), and the MSAA resolve framebuffer must be bound to the GL_READ_FRAMEBUFFER binding point, before glReadPixels is called.
The above objects can be obtained via SDL_GetWindowWMInfo() (in SDL_syswm.h).
Notes -- Keyboard
==============================================================================
The SDL keyboard API has been extended to support on-screen keyboards:
void SDL_StartTextInput()
-- enables text events and reveals the onscreen keyboard.
void SDL_StopTextInput()
-- disables text events and hides the onscreen keyboard.
SDL_bool SDL_IsTextInputActive()
-- returns whether or not text events are enabled (and the onscreen keyboard is visible)
Notes -- Mouse
==============================================================================
iOS now supports Bluetooth mice on iPad, but by default will provide the mouse input as touch. In order for SDL to see the real mouse events, you should set the key UIApplicationSupportsIndirectInputEvents to true in your Info.plist
Notes -- Reading and Writing files
==============================================================================
Each application installed on iPhone resides in a sandbox which includes its own Application Home directory. Your application may not access files outside this directory.
Once your application is installed its directory tree looks like:
MySDLApp Home/
MySDLApp.app
Documents/
Library/
Preferences/
tmp/
When your SDL based iPhone application starts up, it sets the working directory to the main bundle (MySDLApp Home/MySDLApp.app), where your application resources are stored. You cannot write to this directory. Instead, I advise you to write document files to "../Documents/" and preferences to "../Library/Preferences".
More information on this subject is available here:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/Introduction/Introduction.html
Notes -- xcFramework
==============================================================================
The SDL.xcodeproj file now includes a target to build SDL2.xcframework. An xcframework is a new (Xcode 11) uber-framework which can handle any combination of processor type and target OS platform.
In the past, iOS devices were always an ARM variant processor, and the simulator was always i386 or x86_64, and thus libraries could be combined into a single framework for both simulator and device. With the introduction of the Apple Silicon ARM-based machines, regular frameworks would collide as CPU type was no longer sufficient to differentiate the platform. So Apple created the new xcframework library package.
The xcframework target builds into a Products directory alongside the SDL.xcodeproj file, as SDL2.xcframework. This can be brought in to any iOS project and will function properly for both simulator and device, no matter their CPUs. Note that Intel Macs cannot cross-compile for Apple Silicon Macs. If you need AS compatibility, perform this build on an Apple Silicon Mac.
This target requires Xcode 11 or later. The target will simply fail to build if attempted on older Xcodes.
In addition, on Apple platforms, main() cannot be in a dynamically loaded library. This means that iOS apps which used the statically-linked libSDL2.lib and now link with the xcframwork will need to define their own main() to call SDL_UIKitRunApp(), like this:
#ifndef SDL_MAIN_HANDLED
#ifdef main
#undef main
#endif
int
main(int argc, char *argv[])
{
return SDL_UIKitRunApp(argc, argv, SDL_main);
}
#endif /* !SDL_MAIN_HANDLED */
Using an xcFramework is similar to using a regular framework. However, issues have been seen with the build system not seeing the headers in the xcFramework. To remedy this, add the path to the xcFramework in your app's target ==> Build Settings ==> Framework Search Paths and mark it recursive (this is critical). Also critical is to remove "*.framework" from Build Settings ==> Sub-Directories to Exclude in Recursive Searches. Clean the build folder, and on your next build the build system should be able to see any of these in your code, as expected:
#include "SDL_main.h"
#include <SDL.h>
#include <SDL_main.h>
Notes -- iPhone SDL limitations
==============================================================================
Windows:
Full-size, single window applications only. You cannot create multi-window SDL applications for iPhone OS. The application window will fill the display, though you have the option of turning on or off the menu-bar (pass SDL_CreateWindow() the flag SDL_WINDOW_BORDERLESS).
Textures:
The optimal texture formats on iOS are SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, and SDL_PIXELFORMAT_RGB24 pixel formats.
Loading Shared Objects:
This is disabled by default since it seems to break the terms of the iOS SDK agreement for iOS versions prior to iOS 8. It can be re-enabled in SDL_config_iphoneos.h.
Notes -- CoreBluetooth.framework
==============================================================================
SDL_JOYSTICK_HIDAPI is disabled by default. It can give you access to a lot
more game controller devices, but it requires permission from the user before
your app will be able to talk to the Bluetooth hardware. "Made For iOS"
branded controllers do not need this as we don't have to speak to them
directly with raw bluetooth, so many apps can live without this.
You'll need to link with CoreBluetooth.framework and add something like this
to your Info.plist:
<key>NSBluetoothPeripheralUsageDescription</key>
<string>MyApp would like to remain connected to nearby bluetooth Game Controllers and Game Pads even when you're not using the app.</string>
Game Center
==============================================================================
Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using:
int SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam);
This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run.
e.g.
extern "C"
void ShowFrame(void*)
{
... do event handling, frame logic and rendering ...
}
int main(int argc, char *argv[])
{
... initialize game ...
#if __IPHONEOS__
// Initialize the Game Center for scoring and matchmaking
InitGameCenter();
// Set up the game to run in the window animation callback on iOS
// so that Game Center and so forth works correctly.
SDL_iPhoneSetAnimationCallback(window, 1, ShowFrame, NULL);
#else
while ( running ) {
ShowFrame(0);
DelayFrame();
}
#endif
return 0;
}
Deploying to older versions of iOS
==============================================================================
SDL supports deploying to older versions of iOS than are supported by the latest version of Xcode, all the way back to iOS 8.0
In order to do that you need to download an older version of Xcode:
https://developer.apple.com/download/more/?name=Xcode
Open the package contents of the older Xcode and your newer version of Xcode and copy over the folders in Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Then open the file Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist and add the versions of iOS you want to deploy to the key Root/DefaultProperties/DEPLOYMENT_TARGET_SUGGESTED_VALUES
Open your project and set your deployment target to the desired version of iOS
Finally, remove GameController from the list of frameworks linked by your application and edit the build settings for "Other Linker Flags" and add -weak_framework GameController
+27 -27
View File
@@ -1,27 +1,27 @@
KMSDRM on *BSD
==================================================
KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen.
WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance.
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
SDL2 WSCONS input backend features
===================================================
1. It is keymap-aware; it will work properly with different keymaps.
2. It has mouse support.
3. Accent input is supported.
4. Compose keys are supported.
5. AltGr and Meta Shift keys work as intended.
Partially working or no input on OpenBSD/NetBSD.
==================================================
The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work.
Partially working or no input on FreeBSD.
==================================================
The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices.
KMSDRM on *BSD
==================================================
KMSDRM is supported on FreeBSD and OpenBSD. DragonFlyBSD works but requires being a root user. NetBSD isn't supported yet because the application will crash when creating the KMSDRM screen.
WSCONS support has been brought back, but only as an input backend. It will not be brought back as a video backend to ease maintenance.
OpenBSD note: Note that the video backend assumes that the user has read/write permissions to the /dev/drm* devices.
SDL2 WSCONS input backend features
===================================================
1. It is keymap-aware; it will work properly with different keymaps.
2. It has mouse support.
3. Accent input is supported.
4. Compose keys are supported.
5. AltGr and Meta Shift keys work as intended.
Partially working or no input on OpenBSD/NetBSD.
==================================================
The WSCONS input backend needs read/write access to the /dev/wskbd* devices, without which it will not work properly. /dev/wsmouse must also be read/write accessible, otherwise mouse input will not work.
Partially working or no input on FreeBSD.
==================================================
The evdev devices are only accessible to the root user by default. Edit devfs rules to allow access to such devices. The /dev/kbd* devices are also only accessible to the root user by default. Edit devfs rules to allow access to such devices.
+96 -96
View File
@@ -1,96 +1,96 @@
Linux
================================================================================
By default SDL will only link against glibc, the rest of the features will be
enabled dynamically at runtime depending on the available features on the target
system. So, for example if you built SDL with Xinerama support and the target
system does not have the Xinerama libraries installed, it will be disabled
at runtime, and you won't get a missing library error, at least with the
default configuration parameters.
Build Dependencies
--------------------------------------------------------------------------------
Ubuntu 20.04, all available features enabled:
sudo apt-get install build-essential git make cmake autoconf automake \
libtool pkg-config libasound2-dev libpulse-dev libaudio-dev libjack-dev \
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libdbus-1-dev \
libudev-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev
Fedora 35, all available features enabled:
sudo yum install gcc git-core make cmake autoconf automake libtool \
alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
libXi-devel libXinerama-devel libXxf86vm-devel libXScrnSaver-devel \
dbus-devel ibus-devel fcitx-devel systemd-devel mesa-libGL-devel \
libxkbcommon-devel mesa-libGLES-devel mesa-libEGL-devel vulkan-devel \
wayland-devel wayland-protocols-devel libdrm-devel mesa-libgbm-devel \
libusb-devel pipewire-jack-audio-connection-kit-devel libdecor-devel \
libsamplerate-devel
NOTES:
- This includes all the audio targets except arts and esd, because Ubuntu
(and/or Debian) pulled their packages, but in theory SDL still supports them.
The sndio audio target is also unavailable on Fedora.
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
for higher-quality audio resampling. SDL will work without it if the library
is missing, so it's safe to build in support even if the end user doesn't
have this library installed.
- DirectFB isn't included because the configure script (currently) fails to find
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
configure script to include DirectFB support. Send patches. :)
Joystick does not work
--------------------------------------------------------------------------------
If you compiled or are using a version of SDL with udev support (and you should!)
there's a few issues that may cause SDL to fail to detect your joystick. To
debug this, start by installing the evtest utility. On Ubuntu/Debian:
sudo apt-get install evtest
Then run:
sudo evtest
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
Now run:
cat /dev/input/event/XX
If you get a permission error, you need to set a udev rule to change the mode of
your device (see below)
Also, try:
sudo udevadm info --query=all --name=input/eventXX
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
you need to set up an udev rule to force this variable.
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
like:
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
You can set up similar rules for your device by changing the values listed in
idProduct and idVendor. To obtain these values, try:
sudo udevadm info -a --name=input/eventXX | grep idVendor
sudo udevadm info -a --name=input/eventXX | grep idProduct
If multiple values come up for each of these, the one you want is the first one of each.
On other systems which ship with an older udev (such as CentOS), you may need
to set up a rule such as:
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
Linux
================================================================================
By default SDL will only link against glibc, the rest of the features will be
enabled dynamically at runtime depending on the available features on the target
system. So, for example if you built SDL with XRandR support and the target
system does not have the XRandR libraries installed, it will be disabled
at runtime, and you won't get a missing library error, at least with the
default configuration parameters.
Build Dependencies
--------------------------------------------------------------------------------
Ubuntu 18.04, all available features enabled:
sudo apt-get install build-essential git make autoconf automake libtool \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libjack-dev libsndio-dev libsamplerate0-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
Ubuntu 22.04+ can also add `libpipewire-0.3-dev libdecor-0-dev` to that command line.
Fedora 35, all available features enabled:
sudo yum install gcc git-core make cmake autoconf automake libtool \
alsa-lib-devel pulseaudio-libs-devel nas-devel pipewire-devel \
libX11-devel libXext-devel libXrandr-devel libXcursor-devel libXfixes-devel \
libXi-devel libXScrnSaver-devel dbus-devel ibus-devel fcitx-devel \
systemd-devel mesa-libGL-devel libxkbcommon-devel mesa-libGLES-devel \
mesa-libEGL-devel vulkan-devel wayland-devel wayland-protocols-devel \
libdrm-devel mesa-libgbm-devel libusb-devel libdecor-devel \
libsamplerate-devel pipewire-jack-audio-connection-kit-devel \
NOTES:
- This includes all the audio targets except arts and esd, because Ubuntu
(and/or Debian) pulled their packages, but in theory SDL still supports them.
The sndio audio target is also unavailable on Fedora.
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
for higher-quality audio resampling. SDL will work without it if the library
is missing, so it's safe to build in support even if the end user doesn't
have this library installed.
- DirectFB isn't included because the configure script (currently) fails to find
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
configure script to include DirectFB support. Send patches. :)
Joystick does not work
--------------------------------------------------------------------------------
If you compiled or are using a version of SDL with udev support (and you should!)
there's a few issues that may cause SDL to fail to detect your joystick. To
debug this, start by installing the evtest utility. On Ubuntu/Debian:
sudo apt-get install evtest
Then run:
sudo evtest
You'll hopefully see your joystick listed along with a name like "/dev/input/eventXX"
Now run:
cat /dev/input/event/XX
If you get a permission error, you need to set a udev rule to change the mode of
your device (see below)
Also, try:
sudo udevadm info --query=all --name=input/eventXX
If you see a line stating ID_INPUT_JOYSTICK=1, great, if you don't see it,
you need to set up an udev rule to force this variable.
A combined rule for the Saitek Pro Flight Rudder Pedals to fix both issues looks
like:
SUBSYSTEM=="input", ATTRS{idProduct}=="0763", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
SUBSYSTEM=="input", ATTRS{idProduct}=="0764", ATTRS{idVendor}=="06a3", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"
You can set up similar rules for your device by changing the values listed in
idProduct and idVendor. To obtain these values, try:
sudo udevadm info -a --name=input/eventXX | grep idVendor
sudo udevadm info -a --name=input/eventXX | grep idProduct
If multiple values come up for each of these, the one you want is the first one of each.
On other systems which ship with an older udev (such as CentOS), you may need
to set up a rule such as:
SUBSYSTEM=="input", ENV{ID_CLASS}=="joystick", ENV{ID_INPUT_JOYSTICK}="1"
+285 -286
View File
@@ -1,286 +1,285 @@
# Mac OS X (aka macOS).
These instructions are for people using Apple's Mac OS X (pronounced
"ten"), which in newer versions is just referred to as "macOS".
From the developer's point of view, macOS is a sort of hybrid Mac and
Unix system, and you have the option of using either traditional
command line tools or Apple's IDE Xcode.
# Command Line Build
To build SDL using the command line, use the standard configure and make
process:
```bash
mkdir build
cd build
../configure
make
sudo make install
```
CMake is also known to work, although it continues to be a work in progress:
```bash
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
```
You can also build SDL as a Universal library (a single binary for both
64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh
script.
```bash
mkdir build
cd build
CC=$PWD/../build-scripts/clang-fat.sh ../configure
make
sudo make install
```
This script builds SDL with 10.6 ABI compatibility on 64-bit Intel and 11.0
ABI compatibility on ARM64 architectures. For best compatibility you
should compile your application the same way.
Please note that building SDL requires at least Xcode 4.6 and the 10.7 SDK
(even if you target back to 10.6 systems). PowerPC support for Mac OS X has
been officially dropped as of SDL 2.0.2. 32-bit Intel, using an older Xcode
release, is still supported at the time of this writing, but current Xcode
releases no longer support it, and eventually neither will SDL.
To use the library once it's built, you essential have two possibilities:
use the traditional autoconf/automake/make method, or use Xcode.
# Caveats for using SDL with Mac OS X
If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
SDL will not register its own. This means that SDL will not terminate using
SDL_Quit if it receives a termination request, it will terminate like a
normal app, and it will not send a SDL_DROPFILE when you request to open a
file with the app. To solve these issues, put the following code in your
NSApplicationDelegate implementation:
```objc
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
return NSTerminateCancel;
}
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_DROPFILE;
event.drop.file = SDL_strdup([filename UTF8String]);
return (SDL_PushEvent(&event) > 0);
}
return NO;
}
```
# Using the Simple DirectMedia Layer with a traditional Makefile
An existing autoconf/automake build system for your SDL app has good chances
to work almost unchanged on macOS. However, to produce a "real" Mac binary
that you can distribute to users, you need to put the generated binary into a
so called "bundle", which is basically a fancy folder with a name like
"MyCoolGame.app".
To get this build automatically, add something like the following rule to
your Makefile.am:
```make
bundle_contents = APP_NAME.app/Contents
APP_NAME_bundle: EXE_NAME
mkdir -p $(bundle_contents)/MacOS
mkdir -p $(bundle_contents)/Resources
echo "APPL????" > $(bundle_contents)/PkgInfo
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
```
You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is
what will be visible to the user in the Finder. Usually it will be the same
as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME`
usually is "TestGame". You might also want to use `@PACKAGE@` to use the
package name as specified in your configure.ac file.
If your project builds more than one application, you will have to do a bit
more. For each of your target applications, you need a separate rule.
If you want the created bundles to be installed, you may want to add this
rule to your Makefile.am:
```make
install-exec-hook: APP_NAME_bundle
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
mkdir -p $(DESTDIR)$(prefix)/Applications/
cp -r $< /$(DESTDIR)$(prefix)Applications/
```
This rule takes the Bundle created by the rule from step 3 and installs them
into "$(DESTDIR)$(prefix)/Applications/".
Again, if you want to install multiple applications, you will have to augment
the make rule accordingly.
But beware! That is only part of the story! With the above, you end up with
a barebones .app bundle, which is double-clickable from the Finder. But
there are some more things you should do before shipping your product...
1. The bundle right now probably is dynamically linked against SDL. That
means that when you copy it to another computer, *it will not run*,
unless you also install SDL on that other computer. A good solution
for this dilemma is to static link against SDL. On OS X, you can
achieve that by linking against the libraries listed by
```bash
sdl-config --static-libs
```
instead of those listed by
```bash
sdl-config --libs
```
Depending on how exactly SDL is integrated into your build systems, the
way to achieve that varies, so I won't describe it here in detail
2. Add an 'Info.plist' to your application. That is a special XML file which
contains some meta-information about your application (like some copyright
information, the version of your app, the name of an optional icon file,
and other things). Part of that information is displayed by the Finder
when you click on the .app, or if you look at the "Get Info" window.
More information about Info.plist files can be found on Apple's homepage.
As a final remark, let me add that I use some of the techniques (and some
variations of them) in [Exult](https://github.com/exult/exult) and
[ScummVM](https://github.com/scummvm/scummvm); both are available in source on
the net, so feel free to take a peek at them for inspiration!
# Using the Simple DirectMedia Layer with Xcode
These instructions are for using Apple's Xcode IDE to build SDL applications.
## First steps
The first thing to do is to unpack the Xcode.tar.gz archive in the
top level SDL directory (where the Xcode.tar.gz archive resides).
Because Stuffit Expander will unpack the archive into a subdirectory,
you should unpack the archive manually from the command line:
```bash
cd [path_to_SDL_source]
tar zxf Xcode.tar.gz
```
This will create a new folder called Xcode, which you can browse
normally from the Finder.
## Building the Framework
The SDL Library is packaged as a framework bundle, an organized
relocatable folder hierarchy of executable code, interface headers,
and additional resources. For practical purposes, you can think of a
framework as a more user and system-friendly shared library, whose library
file behaves more or less like a standard UNIX shared library.
To build the framework, simply open the framework project and build it.
By default, the framework bundle "SDL.framework" is installed in
/Library/Frameworks. Therefore, the testers and project stationary expect
it to be located there. However, it will function the same in any of the
following locations:
* ~/Library/Frameworks
* /Local/Library/Frameworks
* /System/Library/Frameworks
## Build Options
There are two "Build Styles" (See the "Targets" tab) for SDL.
"Deployment" should be used if you aren't tweaking the SDL library.
"Development" should be used to debug SDL apps or the library itself.
## Building the Testers
Open the SDLTest project and build away!
## Using the Project Stationary
Copy the stationary to the indicated folders to access it from
the "New Project" and "Add target" menus. What could be easier?
## Setting up a new project by hand
Some of you won't want to use the Stationary so I'll give some tips:
(this is accurate as of Xcode 12.5.)
* Click "File" -> "New" -> "Project...
* Choose "macOS" and then "App" from the "Application" section.
* Fill out the options in the next window. User interface is "XIB" and
Language is "Objective-C".
* Remove "main.m" from your project
* Remove "MainMenu.xib" from your project
* Remove "AppDelegates.*" from your project
* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
* Add "\$(HOME)/Library/Frameworks" to the frameworks search path
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
* Add your files
* Clean and build
## Building from command line
Use `xcode-build` in the same directory as your .pbxproj file
## Running your app
You can send command line args to your app by either invoking it from
the command line (in *.app/Contents/MacOS) or by entering them in the
Executables" panel of the target settings.
# Implementation Notes
Some things that may be of interest about how it all works...
## Working directory
In SDL 1.2, the working directory of your SDL app is by default set to its
parent, but this is no longer the case in SDL 2.0. SDL2 does change the
working directory, which means it'll be whatever the command line prompt
that launched the program was using, or if launched by double-clicking in
the finger, it will be "/", the _root of the filesystem_. Plan accordingly!
You can use SDL_GetBasePath() to find where the program is running from and
chdir() there directly.
## You have a Cocoa App!
Your SDL app is essentially a Cocoa application. When your app
starts up and the libraries finish loading, a Cocoa procedure is called,
which sets up the working directory and calls your main() method.
You are free to modify your Cocoa app with generally no consequence
to SDL. You cannot, however, easily change the SDL window itself.
Functionality may be added in the future to help this.
# Bug reports
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).
Please feel free to report bugs there!
# Mac OS X (aka macOS).
These instructions are for people using Apple's Mac OS X (pronounced
"ten"), which in newer versions is just referred to as "macOS".
From the developer's point of view, macOS is a sort of hybrid Mac and
Unix system, and you have the option of using either traditional
command line tools or Apple's IDE Xcode.
# Command Line Build
To build SDL using the command line, use the standard configure and make
process:
```bash
mkdir build
cd build
../configure
make
sudo make install
```
CMake is also known to work, although it continues to be a work in progress:
```bash
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
```
You can also build SDL as a Universal library (a single binary for both
64-bit Intel and ARM architectures), by using the build-scripts/clang-fat.sh
script.
```bash
mkdir build
cd build
CC=$PWD/../build-scripts/clang-fat.sh ../configure
make
sudo make install
```
This script builds SDL with 10.9 ABI compatibility on 64-bit Intel and 11.0
ABI compatibility on ARM64 architectures. For best compatibility you
should compile your application the same way.
Please note that building SDL requires at least Xcode 6 and the 10.9 SDK.
PowerPC support for macOS has been officially dropped as of SDL 2.0.2.
32-bit Intel and macOS 10.8 runtime support has been officially dropped as
of SDL 2.24.0.
To use the library once it's built, you essential have two possibilities:
use the traditional autoconf/automake/make method, or use Xcode.
# Caveats for using SDL with Mac OS X
If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
SDL will not register its own. This means that SDL will not terminate using
SDL_Quit if it receives a termination request, it will terminate like a
normal app, and it will not send a SDL_DROPFILE when you request to open a
file with the app. To solve these issues, put the following code in your
NSApplicationDelegate implementation:
```objc
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
return NSTerminateCancel;
}
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_DROPFILE;
event.drop.file = SDL_strdup([filename UTF8String]);
return (SDL_PushEvent(&event) > 0);
}
return NO;
}
```
# Using the Simple DirectMedia Layer with a traditional Makefile
An existing autoconf/automake build system for your SDL app has good chances
to work almost unchanged on macOS. However, to produce a "real" Mac binary
that you can distribute to users, you need to put the generated binary into a
so called "bundle", which is basically a fancy folder with a name like
"MyCoolGame.app".
To get this build automatically, add something like the following rule to
your Makefile.am:
```make
bundle_contents = APP_NAME.app/Contents
APP_NAME_bundle: EXE_NAME
mkdir -p $(bundle_contents)/MacOS
mkdir -p $(bundle_contents)/Resources
echo "APPL????" > $(bundle_contents)/PkgInfo
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
```
You should replace `EXE_NAME` with the name of the executable. `APP_NAME` is
what will be visible to the user in the Finder. Usually it will be the same
as `EXE_NAME` but capitalized. E.g. if `EXE_NAME` is "testgame" then `APP_NAME`
usually is "TestGame". You might also want to use `@PACKAGE@` to use the
package name as specified in your configure.ac file.
If your project builds more than one application, you will have to do a bit
more. For each of your target applications, you need a separate rule.
If you want the created bundles to be installed, you may want to add this
rule to your Makefile.am:
```make
install-exec-hook: APP_NAME_bundle
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
mkdir -p $(DESTDIR)$(prefix)/Applications/
cp -r $< /$(DESTDIR)$(prefix)Applications/
```
This rule takes the Bundle created by the rule from step 3 and installs them
into "$(DESTDIR)$(prefix)/Applications/".
Again, if you want to install multiple applications, you will have to augment
the make rule accordingly.
But beware! That is only part of the story! With the above, you end up with
a barebones .app bundle, which is double-clickable from the Finder. But
there are some more things you should do before shipping your product...
1. The bundle right now probably is dynamically linked against SDL. That
means that when you copy it to another computer, *it will not run*,
unless you also install SDL on that other computer. A good solution
for this dilemma is to static link against SDL. On OS X, you can
achieve that by linking against the libraries listed by
```bash
sdl-config --static-libs
```
instead of those listed by
```bash
sdl-config --libs
```
Depending on how exactly SDL is integrated into your build systems, the
way to achieve that varies, so I won't describe it here in detail
2. Add an 'Info.plist' to your application. That is a special XML file which
contains some meta-information about your application (like some copyright
information, the version of your app, the name of an optional icon file,
and other things). Part of that information is displayed by the Finder
when you click on the .app, or if you look at the "Get Info" window.
More information about Info.plist files can be found on Apple's homepage.
As a final remark, let me add that I use some of the techniques (and some
variations of them) in [Exult](https://github.com/exult/exult) and
[ScummVM](https://github.com/scummvm/scummvm); both are available in source on
the net, so feel free to take a peek at them for inspiration!
# Using the Simple DirectMedia Layer with Xcode
These instructions are for using Apple's Xcode IDE to build SDL applications.
## First steps
The first thing to do is to unpack the Xcode.tar.gz archive in the
top level SDL directory (where the Xcode.tar.gz archive resides).
Because Stuffit Expander will unpack the archive into a subdirectory,
you should unpack the archive manually from the command line:
```bash
cd [path_to_SDL_source]
tar zxf Xcode.tar.gz
```
This will create a new folder called Xcode, which you can browse
normally from the Finder.
## Building the Framework
The SDL Library is packaged as a framework bundle, an organized
relocatable folder hierarchy of executable code, interface headers,
and additional resources. For practical purposes, you can think of a
framework as a more user and system-friendly shared library, whose library
file behaves more or less like a standard UNIX shared library.
To build the framework, simply open the framework project and build it.
By default, the framework bundle "SDL.framework" is installed in
/Library/Frameworks. Therefore, the testers and project stationary expect
it to be located there. However, it will function the same in any of the
following locations:
* ~/Library/Frameworks
* /Local/Library/Frameworks
* /System/Library/Frameworks
## Build Options
There are two "Build Styles" (See the "Targets" tab) for SDL.
"Deployment" should be used if you aren't tweaking the SDL library.
"Development" should be used to debug SDL apps or the library itself.
## Building the Testers
Open the SDLTest project and build away!
## Using the Project Stationary
Copy the stationary to the indicated folders to access it from
the "New Project" and "Add target" menus. What could be easier?
## Setting up a new project by hand
Some of you won't want to use the Stationary so I'll give some tips:
(this is accurate as of Xcode 12.5.)
* Click "File" -> "New" -> "Project...
* Choose "macOS" and then "App" from the "Application" section.
* Fill out the options in the next window. User interface is "XIB" and
Language is "Objective-C".
* Remove "main.m" from your project
* Remove "MainMenu.xib" from your project
* Remove "AppDelegates.*" from your project
* Add "\$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
* Add "\$(HOME)/Library/Frameworks" to the frameworks search path
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
* Add your files
* Clean and build
## Building from command line
Use `xcode-build` in the same directory as your .pbxproj file
## Running your app
You can send command line args to your app by either invoking it from
the command line (in *.app/Contents/MacOS) or by entering them in the
Executables" panel of the target settings.
# Implementation Notes
Some things that may be of interest about how it all works...
## Working directory
In SDL 1.2, the working directory of your SDL app is by default set to its
parent, but this is no longer the case in SDL 2.0. SDL2 does change the
working directory, which means it'll be whatever the command line prompt
that launched the program was using, or if launched by double-clicking in
the finger, it will be "/", the _root of the filesystem_. Plan accordingly!
You can use SDL_GetBasePath() to find where the program is running from and
chdir() there directly.
## You have a Cocoa App!
Your SDL app is essentially a Cocoa application. When your app
starts up and the libraries finish loading, a Cocoa procedure is called,
which sets up the working directory and calls your main() method.
You are free to modify your Cocoa app with generally no consequence
to SDL. You cannot, however, easily change the SDL window itself.
Functionality may be added in the future to help this.
# Bug reports
Bugs are tracked at [the GitHub issue tracker](https://github.com/libsdl-org/SDL/issues/).
Please feel free to report bugs there!
-240
View File
@@ -1,240 +0,0 @@
Mac OS X
==============================================================================
These instructions are for people using Apple's Mac OS X (pronounced
"ten").
From the developer's point of view, OS X is a sort of hybrid Mac and
Unix system, and you have the option of using either traditional
command line tools or Apple's IDE Xcode.
Command Line Build
==================
To build SDL using the command line, use the standard configure and make
process:
./configure
make
sudo make install
You can also build SDL as a Universal library (a single binary for both
32-bit and 64-bit Intel architectures), on Mac OS X 10.7 and newer, by using
the gcc-fat.sh script in build-scripts:
mkdir mybuild
cd mybuild
CC=$PWD/../build-scripts/gcc-fat.sh CXX=$PWD/../build-scripts/g++-fat.sh ../configure
make
sudo make install
This script builds SDL with 10.5 ABI compatibility on i386 and 10.6
ABI compatibility on x86_64 architectures. For best compatibility you
should compile your application the same way.
Please note that building SDL requires at least Xcode 4.6 and the 10.7 SDK
(even if you target back to 10.5 systems). PowerPC support for Mac OS X has
been officially dropped as of SDL 2.0.2.
To use the library once it's built, you essential have two possibilities:
use the traditional autoconf/automake/make method, or use Xcode.
==============================================================================
Caveats for using SDL with Mac OS X
==============================================================================
Some things you have to be aware of when using SDL on Mac OS X:
- If you register your own NSApplicationDelegate (using [NSApp setDelegate:]),
SDL will not register its own. This means that SDL will not terminate using
SDL_Quit if it receives a termination request, it will terminate like a
normal app, and it will not send a SDL_DROPFILE when you request to open a
file with the app. To solve these issues, put the following code in your
NSApplicationDelegate implementation:
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
{
if (SDL_GetEventState(SDL_QUIT) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
return NSTerminateCancel;
}
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) {
SDL_Event event;
event.type = SDL_DROPFILE;
event.drop.file = SDL_strdup([filename UTF8String]);
return (SDL_PushEvent(&event) > 0);
}
return NO;
}
==============================================================================
Using the Simple DirectMedia Layer with a traditional Makefile
==============================================================================
An existing autoconf/automake build system for your SDL app has good chances
to work almost unchanged on OS X. However, to produce a "real" Mac OS X binary
that you can distribute to users, you need to put the generated binary into a
so called "bundle", which basically is a fancy folder with a name like
"MyCoolGame.app".
To get this build automatically, add something like the following rule to
your Makefile.am:
bundle_contents = APP_NAME.app/Contents
APP_NAME_bundle: EXE_NAME
mkdir -p $(bundle_contents)/MacOS
mkdir -p $(bundle_contents)/Resources
echo "APPL????" > $(bundle_contents)/PkgInfo
$(INSTALL_PROGRAM) $< $(bundle_contents)/MacOS/
You should replace EXE_NAME with the name of the executable. APP_NAME is what
will be visible to the user in the Finder. Usually it will be the same
as EXE_NAME but capitalized. E.g. if EXE_NAME is "testgame" then APP_NAME
usually is "TestGame". You might also want to use `@PACKAGE@` to use the package
name as specified in your configure.in file.
If your project builds more than one application, you will have to do a bit
more. For each of your target applications, you need a separate rule.
If you want the created bundles to be installed, you may want to add this
rule to your Makefile.am:
install-exec-hook: APP_NAME_bundle
rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app
mkdir -p $(DESTDIR)$(prefix)/Applications/
cp -r $< /$(DESTDIR)$(prefix)Applications/
This rule takes the Bundle created by the rule from step 3 and installs them
into "$(DESTDIR)$(prefix)/Applications/".
Again, if you want to install multiple applications, you will have to augment
the make rule accordingly.
But beware! That is only part of the story! With the above, you end up with
a bare bone .app bundle, which is double clickable from the Finder. But
there are some more things you should do before shipping your product...
1) The bundle right now probably is dynamically linked against SDL. That
means that when you copy it to another computer, *it will not run*,
unless you also install SDL on that other computer. A good solution
for this dilemma is to static link against SDL. On OS X, you can
achieve that by linking against the libraries listed by
sdl-config --static-libs
instead of those listed by
sdl-config --libs
Depending on how exactly SDL is integrated into your build systems, the
way to achieve that varies, so I won't describe it here in detail
2) Add an 'Info.plist' to your application. That is a special XML file which
contains some meta-information about your application (like some copyright
information, the version of your app, the name of an optional icon file,
and other things). Part of that information is displayed by the Finder
when you click on the .app, or if you look at the "Get Info" window.
More information about Info.plist files can be found on Apple's homepage.
As a final remark, let me add that I use some of the techniques (and some
variations of them) in Exult and ScummVM; both are available in source on
the net, so feel free to take a peek at them for inspiration!
==============================================================================
Using the Simple DirectMedia Layer with Xcode
==============================================================================
These instructions are for using Apple's Xcode IDE to build SDL applications.
- First steps
The first thing to do is to unpack the Xcode.tar.gz archive in the
top level SDL directory (where the Xcode.tar.gz archive resides).
Because Stuffit Expander will unpack the archive into a subdirectory,
you should unpack the archive manually from the command line:
cd [path_to_SDL_source]
tar zxf Xcode.tar.gz
This will create a new folder called Xcode, which you can browse
normally from the Finder.
- Building the Framework
The SDL Library is packaged as a framework bundle, an organized
relocatable folder hierarchy of executable code, interface headers,
and additional resources. For practical purposes, you can think of a
framework as a more user and system-friendly shared library, whose library
file behaves more or less like a standard UNIX shared library.
To build the framework, simply open the framework project and build it.
By default, the framework bundle "SDL.framework" is installed in
/Library/Frameworks. Therefore, the testers and project stationary expect
it to be located there. However, it will function the same in any of the
following locations:
~/Library/Frameworks
/Local/Library/Frameworks
/System/Library/Frameworks
- Build Options
There are two "Build Styles" (See the "Targets" tab) for SDL.
"Deployment" should be used if you aren't tweaking the SDL library.
"Development" should be used to debug SDL apps or the library itself.
- Building the Testers
Open the SDLTest project and build away!
- Using the Project Stationary
Copy the stationary to the indicated folders to access it from
the "New Project" and "Add target" menus. What could be easier?
- Setting up a new project by hand
Some of you won't want to use the Stationary so I'll give some tips:
* Create a new "Cocoa Application"
* Add src/main/macosx/SDLMain.m , .h and .nib to your project
* Remove "main.c" from your project
* Remove "MainMenu.nib" from your project
* Add "$(HOME)/Library/Frameworks/SDL.framework/Headers" to include path
* Add "$(HOME)/Library/Frameworks" to the frameworks search path
* Add "-framework SDL -framework Foundation -framework AppKit" to "OTHER_LDFLAGS"
* Set the "Main Nib File" under "Application Settings" to "SDLMain.nib"
* Add your files
* Clean and build
- Building from command line
Use pbxbuild in the same directory as your .pbproj file
- Running your app
You can send command line args to your app by either invoking it from
the command line (in *.app/Contents/MacOS) or by entering them in the
"Executables" panel of the target settings.
- Implementation Notes
Some things that may be of interest about how it all works...
* Working directory
As defined in the SDL_main.m file, the working directory of your SDL app
is by default set to its parent. You may wish to change this to better
suit your needs.
* You have a Cocoa App!
Your SDL app is essentially a Cocoa application. When your app
starts up and the libraries finish loading, a Cocoa procedure is called,
which sets up the working directory and calls your main() method.
You are free to modify your Cocoa app with generally no consequence
to SDL. You cannot, however, easily change the SDL window itself.
Functionality may be added in the future to help this.
Known bugs are listed in the file "BUGS.txt".
+28
View File
@@ -0,0 +1,28 @@
# Nintendo 3DS
SDL port for the Nintendo 3DS [Homebrew toolchain](https://devkitpro.org/) contributed by:
- [Pierre Wendling](https://github.com/FtZPetruska)
Credits to:
- The awesome people who ported SDL to other homebrew platforms.
- The Devkitpro team for making all the tools necessary to achieve this.
## Building
To build for the Nintendo 3DS, make sure you have devkitARM and cmake installed and run:
```bash
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE="$DEVKITPRO/cmake/3DS.cmake" -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
```
## Notes
- Currently only software rendering is supported.
- SDL2main should be used to ensure ROMFS is enabled.
- By default, the extra L2 cache and higher clock speeds of the New 2/3DS lineup are enabled. If you wish to turn it off, use `osSetSpeedupEnable(false)` in your main function.
- `SDL_GetBasePath` returns the romfs root instead of the executable's directory.
- The Nintendo 3DS uses a cooperative threading model on a single core, meaning a thread will never yield unless done manually through the `SDL_Delay` functions, or blocking waits (`SDL_LockMutex`, `SDL_SemWait`, `SDL_CondWait`, `SDL_WaitThread`). To avoid starving other threads, `SDL_SemTryWait` and `SDL_SemWaitTimeout` will yield if they fail to acquire the semaphore, see https://github.com/libsdl-org/SDL/pull/6776 for more information.
+103 -103
View File
@@ -1,103 +1,103 @@
Native Client
================================================================================
Requirements:
* Native Client SDK (https://developer.chrome.com/native-client),
(tested with Pepper version 33 or higher).
The SDL backend for Chrome's Native Client has been tested only with the PNaCl
toolchain, which generates binaries designed to run on ARM and x86_32/64
platforms. This does not mean it won't work with the other toolchains!
================================================================================
Building SDL for NaCl
================================================================================
Set up the right environment variables (see naclbuild.sh), then configure SDL with:
configure --host=pnacl --prefix some/install/destination
Then "make".
As an example of how to create a deployable app a Makefile project is provided
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
provided by NaCl, without which linking properly to SDL won't work (the search
path can't be modified externally, so the linker won't find SDL's binaries unless
you dump them into the SDK path, which is inconvenient).
Also provided in test/nacl is the required support file, such as index.html,
manifest.json, etc.
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
hiding the asynchronous nature of the browser behind the scenes...which is not the
same as making it disappear!
================================================================================
Running tests
================================================================================
Due to the nature of NaCl programs, building and running SDL tests is not as
straightforward as one would hope. The script naclbuild.sh in build-scripts
automates the process and should serve as a guide for users of SDL trying to build
their own applications.
Basic usage:
./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
This will build testgles2.c by default.
If you want to build a different test, for example testrendercopyex.c:
SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
Once the build finishes, you have to serve the contents with a web server (the
script will give you instructions on how to do that with Python).
================================================================================
RWops and nacl_io
================================================================================
SDL_RWops work transparently with nacl_io. Two functions control the mount points:
int mount(const char* source, const char* target,
const char* filesystemtype,
unsigned long mountflags, const void *data);
int umount(const char *target);
For convenience, SDL will by default mount an httpfs tree at / before calling
the app's main function. Such setting can be overridden by calling:
umount("/");
And then mounting a different filesystem at /
It's important to consider that the asynchronous nature of file operations on a
browser is hidden from the application, effectively providing the developer with
a set of blocking file operations just like you get in a regular desktop
environment, which eases the job of porting to Native Client, but also introduces
a set of challenges of its own, in particular when big file sizes and slow
connections are involved.
For more information on how nacl_io and mount points work, see:
https://developer.chrome.com/native-client/devguide/coding/nacl_io
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
To be able to save into the directory "/save/" (like backup of game) :
mount("", "/save", "html5fs", 0, "type=PERSISTENT");
And add to manifest.json :
"permissions": [
"unlimitedStorage"
]
================================================================================
TODO - Known Issues
================================================================================
* Testing of all systems with a real application (something other than SDL's tests)
* Key events don't seem to work properly
Native Client
================================================================================
Requirements:
* Native Client SDK (https://developer.chrome.com/native-client),
(tested with Pepper version 33 or higher).
The SDL backend for Chrome's Native Client has been tested only with the PNaCl
toolchain, which generates binaries designed to run on ARM and x86_32/64
platforms. This does not mean it won't work with the other toolchains!
================================================================================
Building SDL for NaCl
================================================================================
Set up the right environment variables (see naclbuild.sh), then configure SDL with:
configure --host=pnacl --prefix some/install/destination
Then "make".
As an example of how to create a deployable app a Makefile project is provided
in test/nacl/Makefile, which includes some monkey patching of the common.mk file
provided by NaCl, without which linking properly to SDL won't work (the search
path can't be modified externally, so the linker won't find SDL's binaries unless
you dump them into the SDK path, which is inconvenient).
Also provided in test/nacl is the required support file, such as index.html,
manifest.json, etc.
SDL apps for NaCl run on a worker thread using the ppapi_simple infrastructure.
This allows for blocking calls on all the relevant systems (OpenGL ES, filesystem),
hiding the asynchronous nature of the browser behind the scenes...which is not the
same as making it disappear!
================================================================================
Running tests
================================================================================
Due to the nature of NaCl programs, building and running SDL tests is not as
straightforward as one would hope. The script naclbuild.sh in build-scripts
automates the process and should serve as a guide for users of SDL trying to build
their own applications.
Basic usage:
./naclbuild.sh path/to/pepper/toolchain (i.e. ~/naclsdk/pepper_35)
This will build testgles2.c by default.
If you want to build a different test, for example testrendercopyex.c:
SOURCES=~/sdl/SDL/test/testrendercopyex.c ./naclbuild.sh ~/naclsdk/pepper_35
Once the build finishes, you have to serve the contents with a web server (the
script will give you instructions on how to do that with Python).
================================================================================
RWops and nacl_io
================================================================================
SDL_RWops work transparently with nacl_io. Two functions control the mount points:
int mount(const char* source, const char* target,
const char* filesystemtype,
unsigned long mountflags, const void *data);
int umount(const char *target);
For convenience, SDL will by default mount an httpfs tree at / before calling
the app's main function. Such setting can be overridden by calling:
umount("/");
And then mounting a different filesystem at /
It's important to consider that the asynchronous nature of file operations on a
browser is hidden from the application, effectively providing the developer with
a set of blocking file operations just like you get in a regular desktop
environment, which eases the job of porting to Native Client, but also introduces
a set of challenges of its own, in particular when big file sizes and slow
connections are involved.
For more information on how nacl_io and mount points work, see:
https://developer.chrome.com/native-client/devguide/coding/nacl_io
https://src.chromium.org/chrome/trunk/src/native_client_sdk/src/libraries/nacl_io/nacl_io.h
To be able to save into the directory "/save/" (like backup of game) :
mount("", "/save", "html5fs", 0, "type=PERSISTENT");
And add to manifest.json :
"permissions": [
"unlimitedStorage"
]
================================================================================
TODO - Known Issues
================================================================================
* Testing of all systems with a real application (something other than SDL's tests)
* Key events don't seem to work properly
+44
View File
@@ -0,0 +1,44 @@
Nokia N-Gage
============
SDL2 port for Symbian S60v1 and v2 with a main focus on the Nokia N-Gage
(Classic and QD) by [Michael Fitzmayer](https://github.com/mupfdev).
Compiling
---------
SDL is part of the [N-Gage SDK.](https://github.com/ngagesdk) project.
The library is included in the
[toolchain](https://github.com/ngagesdk/ngage-toolchain) as a
sub-module.
A complete example project based on SDL2 can be found in the GitHub
account of the SDK: [Wordle](https://github.com/ngagesdk/wordle).
Current level of implementation
-------------------------------
The video driver currently provides full screen video support with
keyboard input.
At the moment only the software renderer works.
Audio is not yet implemented.
Acknowledgements
----------------
Thanks to Hannu Viitala, Kimmo Kinnunen and Markus Mertama for the
valuable insight into Symbian programming. Without the SDL 1.2 port
which was specially developed for CDoom (Doom for the Nokia 9210), this
adaptation would not have been possible.
I would like to thank my friends
[Razvan](https://twitter.com/bewarerazvan) and [Dan
Whelan](https://danwhelan.ie/), for their continuous support. Without
you and the [N-Gage community](https://discord.gg/dbUzqJ26vs), I would
have lost my patience long ago.
Last but not least, I would like to thank the development team of
[EKA2L1](https://12z1.com/) (an experimental Symbian OS emulator). Your
patience and support in troubleshooting helped me a lot.
+92 -92
View File
@@ -1,92 +1,92 @@
Simple DirectMedia Layer 2 for OS/2 & eComStation
================================================================================
SDL port for OS/2, authored by Andrey Vasilkin <digi@os2.snc.ru>, 2016
OpenGL and audio capture not supported by this port.
Additional optional environment variables:
SDL_AUDIO_SHARE
Values: 0 or 1, default is 0
Initializes the device as shareable or exclusively acquired.
SDL_VIDEODRIVER
Values: DIVE or VMAN, default is DIVE
Use video subsystem: Direct interface video extensions (DIVE) or
Video Manager (VMAN).
You may significantly increase video output speed with OS4 kernel and patched
files vman.dll and dive.dll or with latest versions of ACPI support and video
driver Panorama.
Latest versions of OS/4 kernel:
http://gus.biysk.ru/os4/
(Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4)
Patched files vman.dll and dive.dll:
http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR
Compiling:
----------
Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see:
https://github.com/open-watcom/ and https://open-watcom.github.io
WATCOM environment variable must to be set to the Open Watcom install
directory. To compile, run: wmake -f Makefile.os2
Installing:
-----------
- eComStation:
If you have previously installed SDL2, make a Backup copy of SDL2.dll
located in D:\ecs\dll (where D: is disk on which installed eComStation).
Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll
- OS/2:
Copy SDL2.dll to any directory on your LIBPATH. If you have a previous
version installed, close all SDL2 applications before replacing the old
copy. Also make sure that any other older versions of DLLs are removed
from your system.
Joysticks in SDL2:
------------------
The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version.
Here is the original documentation from SDL-1.2:
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
and the like). Therefore, if you use a non-standard joystick, you should
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
file or CONFIG.SYS, so SDL applications can provide full capability to your
device. The syntax is:
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
the line should be:
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
If you want to add spaces in your joystick name, just surround it with
quotes or double-quotes:
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
or
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
Note however that Balls and Hats are not supported under OS/2, and the
value will be ignored... but it is wise to define these correctly because
in the future those can be supported.
Also the number of buttons is limited to 2 when using two joysticks,
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
and 8 when using a joystick with 2 axes. Notice however these are limitations
of the Joystick Port hardware, not OS/2.
Simple DirectMedia Layer 2 for OS/2 & eComStation
================================================================================
SDL port for OS/2, authored by Andrey Vasilkin <digi@os2.snc.ru>, 2016
OpenGL not supported by this port.
Additional optional environment variables:
SDL_AUDIO_SHARE
Values: 0 or 1, default is 0
Initializes the device as shareable or exclusively acquired.
SDL_VIDEODRIVER
Values: DIVE or VMAN, default is DIVE
Use video subsystem: Direct interface video extensions (DIVE) or
Video Manager (VMAN).
You may significantly increase video output speed with OS4 kernel and patched
files vman.dll and dive.dll or with latest versions of ACPI support and video
driver Panorama.
Latest versions of OS/4 kernel:
http://gus.biysk.ru/os4/
(Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4)
Patched files vman.dll and dive.dll:
http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR
Compiling:
----------
Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see:
https://github.com/open-watcom/ and https://open-watcom.github.io
WATCOM environment variable must to be set to the Open Watcom install
directory. To compile, run: wmake -f Makefile.os2
Installing:
-----------
- eComStation:
If you have previously installed SDL2, make a Backup copy of SDL2.dll
located in D:\ecs\dll (where D: is disk on which installed eComStation).
Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll
- OS/2:
Copy SDL2.dll to any directory on your LIBPATH. If you have a previous
version installed, close all SDL2 applications before replacing the old
copy. Also make sure that any other older versions of DLLs are removed
from your system.
Joysticks in SDL2:
------------------
The joystick code in SDL2 is a direct forward-port from the SDL-1.2 version.
Here is the original documentation from SDL-1.2:
The Joystick detection only works for standard joysticks (2 buttons, 2 axes
and the like). Therefore, if you use a non-standard joystick, you should
specify its features in the SDL_OS2_JOYSTICK environment variable in a batch
file or CONFIG.SYS, so SDL applications can provide full capability to your
device. The syntax is:
SET SDL_OS2_JOYSTICK=[JOYSTICK_NAME] [AXES] [BUTTONS] [HATS] [BALLS]
So, it you have a Gravis GamePad with 4 axes, 2 buttons, 2 hats and 0 balls,
the line should be:
SET SDL_OS2_JOYSTICK=Gravis_GamePad 4 2 2 0
If you want to add spaces in your joystick name, just surround it with
quotes or double-quotes:
SET SDL_OS2_JOYSTICK='Gravis GamePad' 4 2 2 0
or
SET SDL_OS2_JOYSTICK="Gravis GamePad" 4 2 2 0
Note however that Balls and Hats are not supported under OS/2, and the
value will be ignored... but it is wise to define these correctly because
in the future those can be supported.
Also the number of buttons is limited to 2 when using two joysticks,
4 when using one joystick with 4 axes, 6 when using a joystick with 3 axes
and 8 when using a joystick with 2 axes. Notice however these are limitations
of the Joystick Port hardware, not OS/2.
+17 -17
View File
@@ -1,17 +1,17 @@
Pandora
=====================================================================
( http://openpandora.org/ )
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
support to work on the pandora under the framebuffer. This driver do not have
input support for now, so if you use it you will have to add your own control code.
The video driver name is "pandora" so if you have problem running it from
the framebuffer, try to set the following variable before starting your application :
"export SDL_VIDEODRIVER=pandora"
- OpenGL ES support was added to the x11 driver, so it's working like the normal
x11 driver one with OpenGLX support, with SDL input event's etc..
David Carré (Cpasjuste)
cpasjuste@gmail.com
Pandora
=====================================================================
( http://openpandora.org/ )
- A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES
support to work on the pandora under the framebuffer. This driver do not have
input support for now, so if you use it you will have to add your own control code.
The video driver name is "pandora" so if you have problem running it from
the framebuffer, try to set the following variable before starting your application :
"export SDL_VIDEODRIVER=pandora"
- OpenGL ES support was added to the x11 driver, so it's working like the normal
x11 driver one with OpenGLX support, with SDL input event's etc..
David Carré (Cpasjuste)
cpasjuste@gmail.com
+8 -8
View File
@@ -1,8 +1,8 @@
Platforms
=========
We maintain the list of supported platforms on our wiki now, and how to
build and install SDL for those platforms:
https://wiki.libsdl.org/Installation
Platforms
=========
We maintain the list of supported platforms on our wiki now, and how to
build and install SDL for those platforms:
https://wiki.libsdl.org/Installation
+68 -68
View File
@@ -1,68 +1,68 @@
Porting
=======
* Porting To A New Platform
The first thing you have to do when porting to a new platform, is look at
include/SDL_platform.h and create an entry there for your operating system.
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
Ideally SDL_platform.h will be able to auto-detect the system it's building
on based on C preprocessor symbols.
There are two basic ways of building SDL at the moment:
1. The "UNIX" way: ./configure; make; make install
If you have a GNUish system, then you might try this. Edit configure.ac,
take a look at the large section labelled:
"Set up the configuration based on the host platform!"
Add a section for your platform, and then re-run autogen.sh and build!
2. Using an IDE:
If you're using an IDE or other non-configure build system, you'll probably
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
add a section for your platform, and create a custom SDL_config_{platform}.h,
based on SDL_config_minimal.h and SDL_config.h.in
Add the top level include directory to the header search path, and then add
the following sources to the project:
src/*.c
src/atomic/*.c
src/audio/*.c
src/cpuinfo/*.c
src/events/*.c
src/file/*.c
src/haptic/*.c
src/joystick/*.c
src/power/*.c
src/render/*.c
src/render/software/*.c
src/stdlib/*.c
src/thread/*.c
src/timer/*.c
src/video/*.c
src/audio/disk/*.c
src/audio/dummy/*.c
src/filesystem/dummy/*.c
src/video/dummy/*.c
src/haptic/dummy/*.c
src/joystick/dummy/*.c
src/main/dummy/*.c
src/thread/generic/*.c
src/timer/dummy/*.c
src/loadso/dummy/*.c
Once you have a working library without any drivers, you can go back to each
of the major subsystems and start implementing drivers for your platform.
If you have any questions, don't hesitate to ask on the SDL mailing list:
http://www.libsdl.org/mailing-list.php
Enjoy!
Sam Lantinga (slouken@libsdl.org)
Porting
=======
* Porting To A New Platform
The first thing you have to do when porting to a new platform, is look at
include/SDL_platform.h and create an entry there for your operating system.
The standard format is "__PLATFORM__", where PLATFORM is the name of the OS.
Ideally SDL_platform.h will be able to auto-detect the system it's building
on based on C preprocessor symbols.
There are two basic ways of building SDL at the moment:
1. The "UNIX" way: ./configure; make; make install
If you have a GNUish system, then you might try this. Edit configure.ac,
take a look at the large section labelled:
"Set up the configuration based on the host platform!"
Add a section for your platform, and then re-run autogen.sh and build!
2. Using an IDE:
If you're using an IDE or other non-configure build system, you'll probably
want to create a custom SDL_config.h for your platform. Edit SDL_config.h,
add a section for your platform, and create a custom SDL_config_{platform}.h,
based on SDL_config_minimal.h and SDL_config.h.in
Add the top level include directory to the header search path, and then add
the following sources to the project:
src/*.c
src/atomic/*.c
src/audio/*.c
src/cpuinfo/*.c
src/events/*.c
src/file/*.c
src/haptic/*.c
src/joystick/*.c
src/power/*.c
src/render/*.c
src/render/software/*.c
src/stdlib/*.c
src/thread/*.c
src/timer/*.c
src/video/*.c
src/audio/disk/*.c
src/audio/dummy/*.c
src/filesystem/dummy/*.c
src/video/dummy/*.c
src/haptic/dummy/*.c
src/joystick/dummy/*.c
src/main/dummy/*.c
src/thread/generic/*.c
src/timer/dummy/*.c
src/loadso/dummy/*.c
Once you have a working library without any drivers, you can go back to each
of the major subsystems and start implementing drivers for your platform.
If you have any questions, don't hesitate to ask on the SDL mailing list:
http://www.libsdl.org/mailing-list.php
Enjoy!
Sam Lantinga (slouken@libsdl.org)
+51
View File
@@ -0,0 +1,51 @@
PS2
======
SDL2 port for the Sony Playstation 2 contributed by:
- Francisco Javier Trujillo Mata
Credit to
- The guys that ported SDL to PSP & Vita because I'm taking them as reference.
- David G. F. for helping me with several issues and tests.
## Building
To build SDL2 library for the PS2, make sure you have the latest PS2Dev status and run:
```bash
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PS2DEV/ps2sdk/ps2dev.cmake
cmake --build build
cmake --install build
```
## Hints
The PS2 port has a special Hint for having a dynamic VSYNC. The Hint is `SDL_HINT_PS2_DYNAMIC_VSYNC`.
If you enabled the dynamic vsync having as well `SDL_RENDERER_PRESENTVSYNC` enabled, then if the app is not able to run at 60 FPS, automatically the `vsync` will be disabled having a better performance, instead of droping FPS to 30.
## Notes
If you trying to debug a SDL app through [ps2client](https://github.com/ps2dev/ps2client) you need to avoid the IOP reset, otherwise you will lose the conection with your computer.
So to avoid the reset of the IOP CPU, you need to call to the macro `SDL_PS2_SKIP_IOP_RESET();`.
It could be something similar as:
```c
.....
SDL_PS2_SKIP_IOP_RESET();
int main(int argc, char *argv[])
{
.....
```
For a release binary is recommendable to reset the IOP always.
Remember to do a clean compilation everytime you enable or disable the `SDL_PS2_SKIP_IOP_RESET` otherwise the change won't be reflected.
## Getting PS2 Dev
[Installing PS2 Dev](https://github.com/ps2dev/ps2dev)
## Running on PCSX2 Emulator
[PCSX2](https://github.com/PCSX2/pcsx2)
[More PCSX2 information](https://pcsx2.net/)
## To Do
- PS2 Screen Keyboard
- Dialogs
- Others
+36 -36
View File
@@ -1,36 +1,36 @@
PSP
======
SDL2 port for the Sony PSP contributed by:
- Captian Lex
- Francisco Javier Trujillo Mata
- Wouter Wijsman
Credit to
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
Geecko for his PSP GU lib "Glib2d"
## Building
To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run:
```bash
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
cmake --build build
cmake --install build
```
## Getting PSP Dev
[Installing PSP Dev](https://github.com/pspdev/pspdev)
## Running on PPSSPP Emulator
[PPSSPP](https://github.com/hrydgard/ppsspp)
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
## Compiling a HelloWorld
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
## To Do
- PSP Screen Keyboard
- Dialogs
PSP
======
SDL2 port for the Sony PSP contributed by:
- Captian Lex
- Francisco Javier Trujillo Mata
- Wouter Wijsman
Credit to
Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP
Geecko for his PSP GU lib "Glib2d"
## Building
To build SDL2 library for the PSP, make sure you have the latest PSPDev status and run:
```bash
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake
cmake --build build
cmake --install build
```
## Getting PSP Dev
[Installing PSP Dev](https://github.com/pspdev/pspdev)
## Running on PPSSPP Emulator
[PPSSPP](https://github.com/hrydgard/ppsspp)
[Build Instructions](https://github.com/hrydgard/ppsspp/wiki/Build-instructions)
## Compiling a HelloWorld
[PSP Hello World](https://psp-dev.org/doku.php?id=tutorial:hello_world)
## To Do
- PSP Screen Keyboard
- Dialogs
+180 -180
View File
@@ -1,180 +1,180 @@
Raspberry Pi
============
Requirements:
Raspbian (other Linux distros may work as well).
Features
--------
* Works without X11
* Hardware accelerated OpenGL ES 2.x
* Sound via ALSA
* Input (mouse/keyboard/joystick) via EVDEV
* Hotplugging of input devices via UDEV
Raspbian Build Dependencies
---------------------------
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
NEON
----
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
that SDL will select some otherwise-disabled highly-optimized code. The
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
definitely does.
Cross compiling from x86 Linux
------------------------------
To cross compile SDL for Raspbian from your desktop machine, you'll need a
Raspbian system root and the cross compilation tools. We'll assume these tools
will be placed in /opt/rpi-tools
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
You'll also need a Raspbian binary image.
Get it from: http://downloads.raspberrypi.org/raspbian_latest
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
Let's assume the sysroot will be built in /opt/rpi-sysroot.
export SYSROOT=/opt/rpi-sysroot
sudo kpartx -a -v <path_to_raspbian_image>.img
sudo mount -o loop /dev/mapper/loop0p2 /mnt
sudo cp -r /mnt $SYSROOT
sudo apt-get install qemu binfmt-support qemu-user-static
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
sudo mount --bind /dev $SYSROOT/dev
sudo mount --bind /proc $SYSROOT/proc
sudo mount --bind /sys $SYSROOT/sys
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
sudo chroot $SYSROOT
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev libxss-dev
exit
sudo umount $SYSROOT/dev
sudo umount $SYSROOT/proc
sudo umount $SYSROOT/sys
sudo umount /mnt
There's one more fix required, as the libdl.so symlink uses an absolute path
which doesn't quite work in our setup.
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
The final step is compiling SDL itself.
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
cd <SDL SOURCE>
mkdir -p build;cd build
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
make
make install
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
Apps don't work or poor video/audio performance
-----------------------------------------------
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
update the RPi's firmware. Note that doing so will fix these problems, but it
will also render the CMA - Dynamic Memory Split functionality useless.
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
low in general, specially if a 1080p TV is hooked up.
See here how to configure this setting: http://elinux.org/RPiconfig
Using a fixed gpu_mem=128 is the best option (specially if you updated the
firmware, using CMA probably won't work, at least it's the current case).
No input
--------
Make sure you belong to the "input" group.
sudo usermod -aG input `whoami`
No HDMI Audio
-------------
If you notice that ALSA works but there's no audio over HDMI, try adding:
hdmi_drive=2
to your config.txt file and reboot.
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
Text Input API support
----------------------
The Text Input API is supported, with translation of scan codes done via the
kernel symbol tables. For this to work, SDL needs access to a valid console.
If you notice there's no SDL_TEXTINPUT message being emitted, double check that
your app has read access to one of the following:
* /proc/self/fd/0
* /dev/tty
* /dev/tty[0...6]
* /dev/vc/0
* /dev/console
This is usually not a problem if you run from the physical terminal (as opposed
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
quick workaround is to run your app as root or add yourself to the tty group,
then re-login to the system.
sudo usermod -aG tty `whoami`
The keyboard layout used by SDL is the same as the one the kernel uses.
To configure the layout on Raspbian:
sudo dpkg-reconfigure keyboard-configuration
To configure the locale, which controls which keys are interpreted as letters,
this determining the CAPS LOCK behavior:
sudo dpkg-reconfigure locales
OpenGL problems
---------------
If you have desktop OpenGL headers installed at build time in your RPi or cross
compilation environment, support for it will be built in. However, the chipset
does not actually have support for it, which causes issues in certain SDL apps
since the presence of OpenGL support supersedes the ES/ES2 variants.
The workaround is to disable OpenGL at configuration time:
./configure --disable-video-opengl
Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER
environment variable:
export SDL_RENDER_DRIVER=opengles2
Notes
-----
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
leaking into the console only if it has root privileges. Launching apps locally
does not suffer from this issue.
Raspberry Pi
============
Requirements:
Raspbian (other Linux distros may work as well).
Features
--------
* Works without X11
* Hardware accelerated OpenGL ES 2.x
* Sound via ALSA
* Input (mouse/keyboard/joystick) via EVDEV
* Hotplugging of input devices via UDEV
Raspbian Build Dependencies
---------------------------
sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev
You also need the VideoCore binary stuff that ships in /opt/vc for EGL and
OpenGL ES 2.x, it usually comes pre-installed, but in any case:
sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev
NEON
----
If your Pi has NEON support, make sure you add -mfpu=neon to your CFLAGS so
that SDL will select some otherwise-disabled highly-optimized code. The
original Pi units don't have NEON, the Pi2 probably does, and the Pi3
definitely does.
Cross compiling from x86 Linux
------------------------------
To cross compile SDL for Raspbian from your desktop machine, you'll need a
Raspbian system root and the cross compilation tools. We'll assume these tools
will be placed in /opt/rpi-tools
sudo git clone --depth 1 https://github.com/raspberrypi/tools /opt/rpi-tools
You'll also need a Raspbian binary image.
Get it from: http://downloads.raspberrypi.org/raspbian_latest
After unzipping, you'll get file with a name like: "<date>-wheezy-raspbian.img"
Let's assume the sysroot will be built in /opt/rpi-sysroot.
export SYSROOT=/opt/rpi-sysroot
sudo kpartx -a -v <path_to_raspbian_image>.img
sudo mount -o loop /dev/mapper/loop0p2 /mnt
sudo cp -r /mnt $SYSROOT
sudo apt-get install qemu binfmt-support qemu-user-static
sudo cp /usr/bin/qemu-arm-static $SYSROOT/usr/bin
sudo mount --bind /dev $SYSROOT/dev
sudo mount --bind /proc $SYSROOT/proc
sudo mount --bind /sys $SYSROOT/sys
Now, before chrooting into the ARM sysroot, you'll need to apply a workaround,
edit $SYSROOT/etc/ld.so.preload and comment out all lines in it.
sudo chroot $SYSROOT
apt-get install libudev-dev libasound2-dev libdbus-1-dev libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxss-dev
exit
sudo umount $SYSROOT/dev
sudo umount $SYSROOT/proc
sudo umount $SYSROOT/sys
sudo umount /mnt
There's one more fix required, as the libdl.so symlink uses an absolute path
which doesn't quite work in our setup.
sudo rm -rf $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
sudo ln -s ../../../lib/arm-linux-gnueabihf/libdl.so.2 $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so
The final step is compiling SDL itself.
export CC="/opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux"
cd <SDL SOURCE>
mkdir -p build;cd build
LDFLAGS="-L$SYSROOT/opt/vc/lib" ../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd
make
make install
To be able to deploy this to /usr/local in the Raspbian system you need to fix up a few paths:
perl -w -pi -e "s#$PWD/rpi-sdl2-installed#/usr/local#g;" ./rpi-sdl2-installed/lib/libSDL2.la ./rpi-sdl2-installed/lib/pkgconfig/sdl2.pc ./rpi-sdl2-installed/bin/sdl2-config
Apps don't work or poor video/audio performance
-----------------------------------------------
If you get sound problems, buffer underruns, etc, run "sudo rpi-update" to
update the RPi's firmware. Note that doing so will fix these problems, but it
will also render the CMA - Dynamic Memory Split functionality useless.
Also, by default the Raspbian distro configures the GPU RAM at 64MB, this is too
low in general, specially if a 1080p TV is hooked up.
See here how to configure this setting: http://elinux.org/RPiconfig
Using a fixed gpu_mem=128 is the best option (specially if you updated the
firmware, using CMA probably won't work, at least it's the current case).
No input
--------
Make sure you belong to the "input" group.
sudo usermod -aG input `whoami`
No HDMI Audio
-------------
If you notice that ALSA works but there's no audio over HDMI, try adding:
hdmi_drive=2
to your config.txt file and reboot.
Reference: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=5062
Text Input API support
----------------------
The Text Input API is supported, with translation of scan codes done via the
kernel symbol tables. For this to work, SDL needs access to a valid console.
If you notice there's no SDL_TEXTINPUT message being emitted, double check that
your app has read access to one of the following:
* /proc/self/fd/0
* /dev/tty
* /dev/tty[0...6]
* /dev/vc/0
* /dev/console
This is usually not a problem if you run from the physical terminal (as opposed
to running from a pseudo terminal, such as via SSH). If running from a PTS, a
quick workaround is to run your app as root or add yourself to the tty group,
then re-login to the system.
sudo usermod -aG tty `whoami`
The keyboard layout used by SDL is the same as the one the kernel uses.
To configure the layout on Raspbian:
sudo dpkg-reconfigure keyboard-configuration
To configure the locale, which controls which keys are interpreted as letters,
this determining the CAPS LOCK behavior:
sudo dpkg-reconfigure locales
OpenGL problems
---------------
If you have desktop OpenGL headers installed at build time in your RPi or cross
compilation environment, support for it will be built in. However, the chipset
does not actually have support for it, which causes issues in certain SDL apps
since the presence of OpenGL support supersedes the ES/ES2 variants.
The workaround is to disable OpenGL at configuration time:
./configure --disable-video-opengl
Or if the application uses the Render functions, you can use the SDL_RENDER_DRIVER
environment variable:
export SDL_RENDER_DRIVER=opengles2
Notes
-----
* When launching apps remotely (via SSH), SDL can prevent local keystrokes from
leaking into the console only if it has root privileges. Launching apps locally
does not suffer from this issue.
+41 -41
View File
@@ -1,41 +1,41 @@
RISC OS
=======
Requirements:
* RISC OS 3.5 or later.
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
Compiling:
----------
Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported.
The following commands can be used to build SDL2 for RISC OS using autoconf:
./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics
make
make install
The following commands can be used to build SDL2 for RISC OS using CMake:
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF
cmake --build build-riscos
cmake --build build-riscos --target install
Current level of implementation
-------------------------------
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake.
The joystick, locale and power APIs are not yet implemented.
RISC OS
=======
Requirements:
* RISC OS 3.5 or later.
* [SharedUnixLibrary](http://www.riscos.info/packages/LibraryDetails.html#SharedUnixLibraryarm).
* [DigitalRenderer](http://www.riscos.info/packages/LibraryDetails.html#DRendererarm), for audio support.
* [Iconv](http://www.netsurf-browser.org/projects/iconv/), for `SDL_iconv` and related functions.
Compiling:
----------
Currently, SDL2 for RISC OS only supports compiling with GCCSDK under Linux. Both the autoconf and CMake build systems are supported.
The following commands can be used to build SDL2 for RISC OS using autoconf:
./configure --host=arm-unknown-riscos --prefix=$GCCSDK_INSTALL_ENV --disable-gcc-atomics
make
make install
The following commands can be used to build SDL2 for RISC OS using CMake:
cmake -Bbuild-riscos -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake -DRISCOS=ON -DCMAKE_INSTALL_PREFIX=$GCCSDK_INSTALL_ENV -DCMAKE_BUILD_TYPE=Release -DSDL_GCC_ATOMICS=OFF
cmake --build build-riscos
cmake --build build-riscos --target install
Current level of implementation
-------------------------------
The video driver currently provides full screen video support with keyboard and mouse input. Windowed mode is not yet supported, but is planned in the future. Only software rendering is supported.
The filesystem APIs return either Unix-style paths or RISC OS-style paths based on the value of the `__riscosify_control` symbol, as is standard for UnixLib functions.
The audio, loadso, thread and timer APIs are currently provided by UnixLib.
GCC atomics are currently broken on some platforms, meaning it's currently necessary to compile with `--disable-gcc-atomics` using autotools or `-DSDL_GCC_ATOMICS=OFF` using CMake.
The joystick, locale and power APIs are not yet implemented.
+86 -86
View File
@@ -1,86 +1,86 @@
Touch
===========================================================================
System Specific Notes
===========================================================================
Linux:
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
Mac:
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
iPhone:
Works out of box.
Windows:
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
===========================================================================
Events
===========================================================================
SDL_FINGERDOWN:
Sent when a finger (or stylus) is placed on a touch device.
Fields:
* event.tfinger.touchId - the Id of the touch device.
* event.tfinger.fingerId - the Id of the finger which just went down.
* event.tfinger.x - the x coordinate of the touch (0..1)
* event.tfinger.y - the y coordinate of the touch (0..1)
* event.tfinger.pressure - the pressure of the touch (0..1)
SDL_FINGERMOTION:
Sent when a finger (or stylus) is moved on the touch device.
Fields:
Same as SDL_FINGERDOWN but with additional:
* event.tfinger.dx - change in x coordinate during this motion event.
* event.tfinger.dy - change in y coordinate during this motion event.
SDL_FINGERUP:
Sent when a finger (or stylus) is lifted from the touch device.
Fields:
Same as SDL_FINGERDOWN.
===========================================================================
Functions
===========================================================================
SDL provides the ability to access the underlying SDL_Finger structures.
These structures should _never_ be modified.
The following functions are included from SDL_touch.h
To get a SDL_TouchID call SDL_GetTouchDevice(int index).
This returns a SDL_TouchID.
IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this!
The number of touch devices can be queried with SDL_GetNumTouchDevices().
A SDL_TouchID may be used to get pointers to SDL_Finger.
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
float x = event.tfinger.x;
float y = event.tfinger.y;
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
As a result, be very careful to check for NULL return values.
A SDL_Finger has the following fields:
* x, y:
The current coordinates of the touch.
* pressure:
The pressure of the touch.
===========================================================================
Notes
===========================================================================
For a complete example see test/testgesture.c
Please direct questions/comments to:
jim.tla+sdl_touch@gmail.com
(original author, API was changed since)
Touch
===========================================================================
System Specific Notes
===========================================================================
Linux:
The linux touch system is currently based off event streams, and proc/bus/devices. The active user must be given permissions to read /dev/input/TOUCHDEVICE, where TOUCHDEVICE is the event stream for your device. Currently only Wacom tablets are supported. If you have an unsupported tablet contact me at jim.tla+sdl_touch@gmail.com and I will help you get support for it.
Mac:
The Mac and iPhone APIs are pretty. If your touch device supports them then you'll be fine. If it doesn't, then there isn't much we can do.
iPhone:
Works out of box.
Windows:
Unfortunately there is no windows support as of yet. Support for Windows 7 is planned, but we currently have no way to test. If you have a Windows 7 WM_TOUCH supported device, and are willing to help test please contact me at jim.tla+sdl_touch@gmail.com
===========================================================================
Events
===========================================================================
SDL_FINGERDOWN:
Sent when a finger (or stylus) is placed on a touch device.
Fields:
* event.tfinger.touchId - the Id of the touch device.
* event.tfinger.fingerId - the Id of the finger which just went down.
* event.tfinger.x - the x coordinate of the touch (0..1)
* event.tfinger.y - the y coordinate of the touch (0..1)
* event.tfinger.pressure - the pressure of the touch (0..1)
SDL_FINGERMOTION:
Sent when a finger (or stylus) is moved on the touch device.
Fields:
Same as SDL_FINGERDOWN but with additional:
* event.tfinger.dx - change in x coordinate during this motion event.
* event.tfinger.dy - change in y coordinate during this motion event.
SDL_FINGERUP:
Sent when a finger (or stylus) is lifted from the touch device.
Fields:
Same as SDL_FINGERDOWN.
===========================================================================
Functions
===========================================================================
SDL provides the ability to access the underlying SDL_Finger structures.
These structures should _never_ be modified.
The following functions are included from SDL_touch.h
To get a SDL_TouchID call SDL_GetTouchDevice(int index).
This returns a SDL_TouchID.
IMPORTANT: If the touch has been removed, or there is no touch with the given index, SDL_GetTouchDevice() will return 0. Be sure to check for this!
The number of touch devices can be queried with SDL_GetNumTouchDevices().
A SDL_TouchID may be used to get pointers to SDL_Finger.
SDL_GetNumTouchFingers(touchID) may be used to get the number of fingers currently down on the device.
The most common reason to access SDL_Finger is to query the fingers outside the event. In most cases accessing the fingers is using the event. This would be accomplished by code like the following:
float x = event.tfinger.x;
float y = event.tfinger.y;
To get a SDL_Finger, call SDL_GetTouchFinger(SDL_TouchID touchID, int index), where touchID is a SDL_TouchID, and index is the requested finger.
This returns a SDL_Finger *, or NULL if the finger does not exist, or has been removed.
A SDL_Finger is guaranteed to be persistent for the duration of a touch, but it will be de-allocated as soon as the finger is removed. This occurs when the SDL_FINGERUP event is _added_ to the event queue, and thus _before_ the SDL_FINGERUP event is polled.
As a result, be very careful to check for NULL return values.
A SDL_Finger has the following fields:
* x, y:
The current coordinates of the touch.
* pressure:
The pressure of the touch.
===========================================================================
Notes
===========================================================================
For a complete example see test/testgesture.c
Please direct questions/comments to:
jim.tla+sdl_touch@gmail.com
(original author, API was changed since)
+60
View File
@@ -0,0 +1,60 @@
# Versioning
## Since 2.23.0
SDL follows an "odd/even" versioning policy, similar to GLib, GTK, Flatpak
and older versions of the Linux kernel:
* The major version (first part) increases when backwards compatibility
is broken, which will happen infrequently.
* If the minor version (second part) is divisible by 2
(for example 2.24.x, 2.26.x), this indicates a version of SDL that
is believed to be stable and suitable for production use.
* In stable releases, the patchlevel or micro version (third part)
indicates bugfix releases. Bugfix releases should not add or
remove ABI, so the ".0" release (for example 2.24.0) should be
forwards-compatible with all the bugfix releases from the
same cycle (for example 2.24.1).
* The minor version increases when new API or ABI is added, or when
other significant changes are made. Newer minor versions are
backwards-compatible, but not fully forwards-compatible.
For example, programs built against SDL 2.24.x should work fine
with SDL 2.26.x, but programs built against SDL 2.26.x will not
necessarily work with 2.24.x.
* If the minor version (second part) is not divisible by 2
(for example 2.23.x, 2.25.x), this indicates a development prerelease
of SDL that is not suitable for stable software distributions.
Use with caution.
* The patchlevel or micro version (third part) increases with
each prerelease.
* Each prerelease might add new API and/or ABI.
* Prereleases are backwards-compatible with older stable branches.
For example, 2.25.x will be backwards-compatible with 2.24.x.
* Prereleases are not guaranteed to be backwards-compatible with
each other. For example, new API or ABI added in 2.25.1
might be removed or changed in 2.25.2.
If this would be a problem for you, please do not use prereleases.
* Only upgrade to a prerelease if you can guarantee that you will
promptly upgrade to the stable release that follows it.
For example, do not upgrade to 2.23.x unless you will be able to
upgrade to 2.24.0 when it becomes available.
* Software distributions that have a freeze policy (in particular Linux
distributions with a release cycle, such as Debian and Fedora)
should usually only package stable releases, and not prereleases.
## Before 2.23.0
Older versions of SDL followed a similar policy, but instead of the
odd/even rule applying to the minor version, it applied to the patchlevel
(micro version, third part). For example, 2.0.22 was a stable release
and 2.0.21 was a prerelease.
+114 -114
View File
@@ -1,114 +1,114 @@
Using SDL with Microsoft Visual C++
===================================
### by Lion Kimbro with additions by James Turk
You can either use the precompiled libraries from the [SDL](https://www.libsdl.org/download.php) web site, or you can build SDL
yourself.
### Building SDL
0. To build SDL, your machine must, at a minimum, have the DirectX9.0c SDK installed. It may or may not be retrievable from
the [Microsoft](https://www.microsoft.com) website, so you might need to locate it [online](https://duckduckgo.com/?q=directx9.0c+sdk+download&t=h_&ia=web).
_Editor's note: I've been able to successfully build SDL using Visual Studio 2019 **without** the DX9.0c SDK_
1. Open the Visual Studio solution file at `./VisualC/SDL.sln`.
2. Your IDE will likely prompt you to upgrade this solution file to whatever later version of the IDE you're using. In the `Retarget Projects` dialog,
all of the affected project files should be checked allowing you to use the latest `Windows SDK Version` you have installed, along with
the `Platform Toolset`.
If you choose *NOT* to upgrade to use the latest `Windows SDK Version` or `Platform Toolset`, then you'll need the `Visual Studio 2010 Platform Toolset`.
3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_
panel in the _FileView_ tab), and selecting `Build`.
You may get a few warnings, but you should not get any errors.
Later, we will refer to the following `.lib` and `.dll` files that have just been generated:
- `./VisualC/Win32/Debug/SDL2.dll` or `./VisualC/Win32/Release/SDL2.dll`
- `./VisualC/Win32/Debug/SDL2.lib` or `./VisualC/Win32/Release/SDL2.lib`
- `./VisualC/Win32/Debug/SDL2main.lib` or `./VisualC/Win32/Release/SDL2main.lib`
_Note for the `x64` versions, just replace `Win32` in the path with `x64`_
### Creating a Project with SDL
- Create a project as a `Win32 Application`.
- Create a C++ file for your project.
- Set the C runtime to `Multi-threaded DLL` in the menu:
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
- Add the SDL `include` directory to your list of includes in the menu:
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
*VC7 Specific: Instead of doing this, I find it easier to add the
include and library directories to the list that VC7 keeps. Do this by
selecting Tools|Options|Projects|VC++ Directories and under the "Show
Directories For:" dropbox select "Include Files", and click the "New
Directory Icon" and add the [SDLROOT]\\include directory (e.g. If you
installed to c:\\SDL\\ add c:\\SDL\\include). Proceed to change the
dropbox selection to "Library Files" and add [SDLROOT]\\lib.*
The "include directory" I am referring to is the `./include` folder.
Now we're going to use the files that we had created earlier in the *Build SDL* step.
Copy the following file into your Project directory:
- `SDL2.dll`
Add the following files to your project (It is not necessary to copy them to your project directory):
- `SDL2.lib`
- `SDL2main.lib`
To add them to your project, right click on your project, and select
`Add files to project`.
**Instead of adding the files to your project, it is more desirable to add them to the linker options: Project|Properties|Linker|Command Line
and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration
(e.g. Release,Debug).**
### Hello SDL2
Here's a sample SDL snippet to verify everything is setup in your IDE:
```
#include "SDL.h"
int main( int argc, char* argv[] )
{
const int WIDTH = 640;
const int HEIGHT = 480;
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
```
### That's it!
I hope that this document has helped you get through the most difficult part of using the SDL: installing it.
Suggestions for improvements should be posted to the [Github Issues](https://github.com/libsdl-org/SDL/issues).
### Credits
Thanks to [Paulus Esterhazy](mailto:pesterhazy@gmx.net), for the work on VC++ port.
This document was originally called "VisualC.txt", and was written by [Sam Lantinga](mailto:slouken@libsdl.org).
Later, it was converted to HTML and expanded into the document that you see today by [Lion Kimbro](mailto:snowlion@sprynet.com).
Minor Fixes and Visual C++ 7 Information (In Green) was added by [James Turk](mailto:james@conceptofzero.net)
Using SDL with Microsoft Visual C++
===================================
### by Lion Kimbro with additions by James Turk
You can either use the precompiled libraries from the [SDL](https://www.libsdl.org/download.php) web site, or you can build SDL
yourself.
### Building SDL
0. To build SDL, your machine must, at a minimum, have the DirectX9.0c SDK installed. It may or may not be retrievable from
the [Microsoft](https://www.microsoft.com) website, so you might need to locate it [online](https://duckduckgo.com/?q=directx9.0c+sdk+download&t=h_&ia=web).
_Editor's note: I've been able to successfully build SDL using Visual Studio 2019 **without** the DX9.0c SDK_
1. Open the Visual Studio solution file at `./VisualC/SDL.sln`.
2. Your IDE will likely prompt you to upgrade this solution file to whatever later version of the IDE you're using. In the `Retarget Projects` dialog,
all of the affected project files should be checked allowing you to use the latest `Windows SDK Version` you have installed, along with
the `Platform Toolset`.
If you choose *NOT* to upgrade to use the latest `Windows SDK Version` or `Platform Toolset`, then you'll need the `Visual Studio 2010 Platform Toolset`.
3. Build the `.dll` and `.lib` files by right clicking on each project in turn (Projects are listed in the _Workspace_
panel in the _FileView_ tab), and selecting `Build`.
You may get a few warnings, but you should not get any errors.
Later, we will refer to the following `.lib` and `.dll` files that have just been generated:
- `./VisualC/Win32/Debug/SDL2.dll` or `./VisualC/Win32/Release/SDL2.dll`
- `./VisualC/Win32/Debug/SDL2.lib` or `./VisualC/Win32/Release/SDL2.lib`
- `./VisualC/Win32/Debug/SDL2main.lib` or `./VisualC/Win32/Release/SDL2main.lib`
_Note for the `x64` versions, just replace `Win32` in the path with `x64`_
### Creating a Project with SDL
- Create a project as a `Win32 Application`.
- Create a C++ file for your project.
- Set the C runtime to `Multi-threaded DLL` in the menu:
`Project|Settings|C/C++ tab|Code Generation|Runtime Library `.
- Add the SDL `include` directory to your list of includes in the menu:
`Project|Settings|C/C++ tab|Preprocessor|Additional include directories `
*VC7 Specific: Instead of doing this, I find it easier to add the
include and library directories to the list that VC7 keeps. Do this by
selecting Tools|Options|Projects|VC++ Directories and under the "Show
Directories For:" dropbox select "Include Files", and click the "New
Directory Icon" and add the [SDLROOT]\\include directory (e.g. If you
installed to c:\\SDL\\ add c:\\SDL\\include). Proceed to change the
dropbox selection to "Library Files" and add [SDLROOT]\\lib.*
The "include directory" I am referring to is the `./include` folder.
Now we're going to use the files that we had created earlier in the *Build SDL* step.
Copy the following file into your Project directory:
- `SDL2.dll`
Add the following files to your project (It is not necessary to copy them to your project directory):
- `SDL2.lib`
- `SDL2main.lib`
To add them to your project, right click on your project, and select
`Add files to project`.
**Instead of adding the files to your project, it is more desirable to add them to the linker options: Project|Properties|Linker|Command Line
and type the names of the libraries to link with in the "Additional Options:" box. Note: This must be done for each build configuration
(e.g. Release,Debug).**
### Hello SDL2
Here's a sample SDL snippet to verify everything is setup in your IDE:
```
#include "SDL.h"
int main( int argc, char* argv[] )
{
const int WIDTH = 640;
const int HEIGHT = 480;
SDL_Window* window = NULL;
SDL_Renderer* renderer = NULL;
SDL_Init(SDL_INIT_VIDEO);
window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
```
### That's it!
I hope that this document has helped you get through the most difficult part of using the SDL: installing it.
Suggestions for improvements should be posted to the [Github Issues](https://github.com/libsdl-org/SDL/issues).
### Credits
Thanks to [Paulus Esterhazy](mailto:pesterhazy@gmx.net), for the work on VC++ port.
This document was originally called "VisualC.txt", and was written by [Sam Lantinga](mailto:slouken@libsdl.org).
Later, it was converted to HTML and expanded into the document that you see today by [Lion Kimbro](mailto:snowlion@sprynet.com).
Minor Fixes and Visual C++ 7 Information (In Green) was added by [James Turk](mailto:james@conceptofzero.net)
+33 -33
View File
@@ -1,33 +1,33 @@
PS Vita
=======
SDL port for the Sony Playstation Vita and Sony Playstation TV
Credit to
* xerpi, cpasjuste and rsn8887 for initial (vita2d) port
* vitasdk/dolcesdk devs
* CBPS discord (Namely Graphene and SonicMastr)
Building
--------
To build for the PSVita, make sure you have vitasdk and cmake installed and run:
```
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
```
Notes
-----
* gles1/gles2 support and renderers are disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PVR=ON`
These renderers support 720p and 1080i resolutions. These can be specified with:
`SDL_setenv("VITA_RESOLUTION", "720", 1);` and `SDL_setenv("VITA_RESOLUTION", "1080", 1);`
* Desktop GL 1.X and 2.X support and renderers are also disabled by default and also can be enabled with `-DVIDEO_VITA_PVR=ON` as long as gl4es4vita is present in your SDK.
They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_setenv("VITA_PVR_OGL", "1", 1);`
anytime before video subsystem initialization.
* gles2 support via PIB is disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PIB=ON`
* By default SDL emits mouse events for touch events on every touchscreen.
Vita has two touchscreens, so it's recommended to use `SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");` and handle touch events instead.
Individual touchscreens can be disabled with:
`SDL_setenv("VITA_DISABLE_TOUCH_FRONT", "1", 1);` and `SDL_setenv("VITA_DISABLE_TOUCH_BACK", "1", 1);`
* Support for L2/R2/R3/R3 buttons, haptic feedback and gamepad led only available on PSTV, or when using external ds4 gamepad on vita.
PS Vita
=======
SDL port for the Sony Playstation Vita and Sony Playstation TV
Credit to
* xerpi, cpasjuste and rsn8887 for initial (vita2d) port
* vitasdk/dolcesdk devs
* CBPS discord (Namely Graphene and SonicMastr)
Building
--------
To build for the PSVita, make sure you have vitasdk and cmake installed and run:
```
cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
```
Notes
-----
* gles1/gles2 support and renderers are disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PVR=ON`
These renderers support 720p and 1080i resolutions. These can be specified with:
`SDL_setenv("VITA_RESOLUTION", "720", 1);` and `SDL_setenv("VITA_RESOLUTION", "1080", 1);`
* Desktop GL 1.X and 2.X support and renderers are also disabled by default and also can be enabled with `-DVIDEO_VITA_PVR=ON` as long as gl4es4vita is present in your SDK.
They support the same resolutions as the gles1/gles2 backends and require specifying `SDL_setenv("VITA_PVR_OGL", "1", 1);`
anytime before video subsystem initialization.
* gles2 support via PIB is disabled by default and can be enabled by configuring with `-DVIDEO_VITA_PIB=ON`
* By default SDL emits mouse events for touch events on every touchscreen.
Vita has two touchscreens, so it's recommended to use `SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0");` and handle touch events instead.
Individual touchscreens can be disabled with:
`SDL_setenv("VITA_DISABLE_TOUCH_FRONT", "1", 1);` and `SDL_setenv("VITA_DISABLE_TOUCH_BACK", "1", 1);`
* Support for L2/R2/R3/R3 buttons, haptic feedback and gamepad led only available on PSTV, or when using external ds4 gamepad on vita.
+10 -10
View File
@@ -1,10 +1,10 @@
WinCE
=====
Windows CE is no longer supported by SDL.
We have left the CE support in SDL 1.2 for those that must have it, and we
have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3.
--ryan.
WinCE
=====
Windows CE is no longer supported by SDL.
We have left the CE support in SDL 1.2 for those that must have it, and we
have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3.
--ryan.
+58 -58
View File
@@ -1,58 +1,58 @@
# Windows
## LLVM and Intel C++ compiler support
SDL will build with the Visual Studio project files with LLVM-based compilers, such as the Intel oneAPI C++
compiler, but you'll have to manually add the "-msse3" command line option
to at least the SDL_audiocvt.c source file, and possibly others. This may
not be necessary if you build SDL with CMake instead of the included Visual
Studio solution.
Details are here: https://github.com/libsdl-org/SDL/issues/5186
## OpenGL ES 2.x support
SDL has support for OpenGL ES 2.x under Windows via two alternative
implementations.
The most straightforward method consists in running your app in a system with
a graphic card paired with a relatively recent (as of November of 2013) driver
which supports the WGL_EXT_create_context_es2_profile extension. Vendors known
to ship said extension on Windows currently include nVidia and Intel.
The other method involves using the
[ANGLE library](https://code.google.com/p/angleproject/). If an OpenGL ES 2.x
context is requested and no WGL_EXT_create_context_es2_profile extension is
found, SDL will try to load the libEGL.dll library provided by ANGLE.
To obtain the ANGLE binaries, you can either compile from source from
https://chromium.googlesource.com/angle/angle or copy the relevant binaries
from a recent Chrome/Chromium install for Windows. The files you need are:
- libEGL.dll
- libGLESv2.dll
- d3dcompiler_46.dll (supports Windows Vista or later, better shader
compiler) *or* d3dcompiler_43.dll (supports Windows XP or later)
If you compile ANGLE from source, you can configure it so it does not need the
d3dcompiler_* DLL at all (for details on this, see their documentation).
However, by default SDL will try to preload the d3dcompiler_46.dll to
comply with ANGLE's requirements. If you wish SDL to preload
d3dcompiler_43.dll (to support Windows XP) or to skip this step at all, you
can use the SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more
details).
Known Bugs:
- SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
that there's a bug in the library which prevents the window contents from
refreshing if this is set to anything other than the default value.
## Vulkan Surface Support
Support for creating Vulkan surfaces is configured on by default. To disable
it change the value of `SDL_VIDEO_VULKAN` to 0 in `SDL_config_windows.h`. You
must install the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) in order to
use Vulkan graphics in your application.
# Windows
## LLVM and Intel C++ compiler support
SDL will build with the Visual Studio project files with LLVM-based compilers, such as the Intel oneAPI C++
compiler, but you'll have to manually add the "-msse3" command line option
to at least the SDL_audiocvt.c source file, and possibly others. This may
not be necessary if you build SDL with CMake instead of the included Visual
Studio solution.
Details are here: https://github.com/libsdl-org/SDL/issues/5186
## OpenGL ES 2.x support
SDL has support for OpenGL ES 2.x under Windows via two alternative
implementations.
The most straightforward method consists in running your app in a system with
a graphic card paired with a relatively recent (as of November of 2013) driver
which supports the WGL_EXT_create_context_es2_profile extension. Vendors known
to ship said extension on Windows currently include nVidia and Intel.
The other method involves using the
[ANGLE library](https://code.google.com/p/angleproject/). If an OpenGL ES 2.x
context is requested and no WGL_EXT_create_context_es2_profile extension is
found, SDL will try to load the libEGL.dll library provided by ANGLE.
To obtain the ANGLE binaries, you can either compile from source from
https://chromium.googlesource.com/angle/angle or copy the relevant binaries
from a recent Chrome/Chromium install for Windows. The files you need are:
- libEGL.dll
- libGLESv2.dll
- d3dcompiler_46.dll (supports Windows Vista or later, better shader
compiler) *or* d3dcompiler_43.dll (supports Windows XP or later)
If you compile ANGLE from source, you can configure it so it does not need the
d3dcompiler_* DLL at all (for details on this, see their documentation).
However, by default SDL will try to preload the d3dcompiler_46.dll to
comply with ANGLE's requirements. If you wish SDL to preload
d3dcompiler_43.dll (to support Windows XP) or to skip this step at all, you
can use the SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more
details).
Known Bugs:
- SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears
that there's a bug in the library which prevents the window contents from
refreshing if this is set to anything other than the default value.
## Vulkan Surface Support
Support for creating Vulkan surfaces is configured on by default. To disable
it change the value of `SDL_VIDEO_VULKAN` to 0 in `SDL_config_windows.h`. You
must install the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) in order to
use Vulkan graphics in your application.
File diff suppressed because it is too large. Load diff
+63 -65
View File
@@ -1,65 +1,63 @@
Simple DirectMedia Layer {#mainpage}
========================
(SDL)
Version 2.0
---
http://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.
SDL officially supports Windows, macOS, Linux, iOS, and Android.
Support for other platforms may be found in the source code.
SDL is written in C, works natively with C++, and there are bindings
available for several other languages, including C# and Python.
This library is distributed under the zlib license, which can be found
in the file "LICENSE.txt".
The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at [the wiki](http://wiki.libsdl.org/)
- [Android](README-android.md)
- [CMake](README-cmake.md)
- [DirectFB](README-directfb.md)
- [DynAPI](README-dynapi.md)
- [Emscripten](README-emscripten.md)
- [Gesture](README-gesture.md)
- [Git](README-git.md)
- [iOS](README-ios.md)
- [Linux](README-linux.md)
- [macOS](README-macos.md)
- [OS/2](README-os2.md)
- [Native Client](README-nacl.md)
- [Pandora](README-pandora.md)
- [Supported Platforms](README-platforms.md)
- [Porting information](README-porting.md)
- [PSP](README-psp.md)
- [Raspberry Pi](README-raspberrypi.md)
- [Touch](README-touch.md)
- [WinCE](README-wince.md)
- [Windows](README-windows.md)
- [WinRT](README-winrt.md)
- [PSVita](README-vita.md)
If you need help with the library, or just want to discuss SDL related
issues, you can join the [SDL Discourse](https://discourse.libsdl.org/),
which can be used as a web forum or a mailing list, at your preference.
If you want to report bugs or contribute patches, please submit them to
[our bug tracker](https://github.com/libsdl-org/SDL/issues)
Enjoy!
Sam Lantinga <mailto:slouken@libsdl.org>
# Simple DirectMedia Layer
https://www.libsdl.org/
Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.
SDL officially supports Windows, macOS, Linux, iOS, and Android.
Support for other platforms may be found in the source code.
SDL is written in C, works natively with C++, and there are bindings
available for several other languages, including C# and Python.
This library is distributed under the zlib license, which can be found
in the file "LICENSE.txt".
The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at [the wiki](http://wiki.libsdl.org/)
- [Android](README-android.md)
- [CMake](README-cmake.md)
- [DirectFB](README-directfb.md)
- [DynAPI](README-dynapi.md)
- [Emscripten](README-emscripten.md)
- [GDK](README-gdk.md)
- [Gesture](README-gesture.md)
- [Git](README-git.md)
- [iOS](README-ios.md)
- [Linux](README-linux.md)
- [macOS](README-macos.md)
- [OS/2](README-os2.md)
- [Native Client](README-nacl.md)
- [Pandora](README-pandora.md)
- [Supported Platforms](README-platforms.md)
- [Porting information](README-porting.md)
- [PSP](README-psp.md)
- [PS2](README-ps2.md)
- [Raspberry Pi](README-raspberrypi.md)
- [Touch](README-touch.md)
- [Versions](README-versions.md)
- [WinCE](README-wince.md)
- [Windows](README-windows.md)
- [WinRT](README-winrt.md)
- [PSVita](README-vita.md)
- [Nokia N-Gage](README-ngage.md)
If you need help with the library, or just want to discuss SDL related
issues, you can join the [SDL Discourse](https://discourse.libsdl.org/),
which can be used as a web forum or a mailing list, at your preference.
If you want to report bugs or contribute patches, please submit them to
[our bug tracker](https://github.com/libsdl-org/SDL/issues)
Enjoy!
Sam Lantinga <mailto:slouken@libsdl.org>
+1561 -1560
View File
File diff suppressed because it is too large. Load diff
+49
View File
@@ -0,0 +1,49 @@
# Release checklist
When changing the version, run `build-scripts/update-version.sh X Y Z`,
where `X Y Z` are the major version, minor version, and patch level. So
`2 28 1` means "change the version to 2.28.1". This script does much of the
mechanical work.
## New feature release
* Update `WhatsNew.txt`
* Bump version number to 2.EVEN.0:
* `./build-scripts/update-version.sh 2 EVEN 0`
* Do the release
* Update the website file include/header.inc.php to reflect the new version
## New bugfix release
* Check that no new API/ABI was added
* If it was, do a new feature release (see above) instead
* Bump version number from 2.Y.Z to 2.Y.(Z+1) (Y is even)
* `./build-scripts/update-version.sh 2 Y Z+1`
* Do the release
* Update the website file include/header.inc.php to reflect the new version
## After a feature release
* Create a branch like `release-2.24.x`
* Bump version number to 2.ODD.0 for next development branch
* `./build-scripts/update-version.sh 2 ODD 0`
## New development prerelease
* Bump version number from 2.Y.Z to 2.Y.(Z+1) (Y is odd)
* `./build-scripts/update-version.sh 2 Y Z+1`
* Do the release
BIN
View File
Binary file not shown.
+65 -60
View File
@@ -1,60 +1,65 @@
#!/bin/sh
prefix=/opt/local/i686-w64-mingw32
exec_prefix=${prefix}
exec_prefix_set=no
libdir=${exec_prefix}/lib
#usage="\
#Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
usage="\
Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo 2.0.22
;;
--cflags)
echo -I${prefix}/include/SDL2 -Dmain=SDL_main
;;
--libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
;;
--static-libs)
# --libs|--static-libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--dynamicbase -Wl,--nxcompat -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
#!/bin/sh
# Get the canonical path of the folder containing this script
bindir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
# Calculate the canonical path of the prefix, relative to the folder of this script
prefix=$(cd -P -- "$bindir/.." && printf '%s\n' "$(pwd -P)")
exec_prefix=${prefix}
exec_prefix_set=no
libdir=${exec_prefix}/lib
#usage="\
#Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
usage="\
Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
if test $# -eq 0; then
echo "${usage}" 1>&2
exit 1
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo $prefix
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo $exec_prefix
;;
--version)
echo 2.28.5
;;
--cflags)
echo -I${prefix}/include/SDL2 -Dmain=SDL_main
;;
--libs)
echo -L${exec_prefix}/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
;;
--static-libs)
# --libs|--static-libs)
sdl_static_libs=$(echo "-lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--dynamicbase -Wl,--nxcompat -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid" | sed -E "s#-lSDL2[ $]#$libdir/libSDL2.a #g")
echo -L${exec_prefix}/lib $sdl_static_libs
;;
*)
echo "${usage}" 1>&2
exit 1
;;
esac
shift
done
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -41,6 +41,7 @@
#include "SDL_events.h"
#include "SDL_filesystem.h"
#include "SDL_gamecontroller.h"
#include "SDL_guid.h"
#include "SDL_haptic.h"
#include "SDL_hidapi.h"
#include "SDL_hints.h"
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -22,7 +22,7 @@
#ifndef SDL_assert_h_
#define SDL_assert_h_
#include "SDL_config.h"
#include "SDL_stdinc.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
@@ -51,8 +51,12 @@ assert can have unique static variables associated with it.
/* Don't include intrin.h here because it contains C++ code */
extern void __cdecl __debugbreak(void);
#define SDL_TriggerBreakpoint() __debugbreak()
#elif _SDL_HAS_BUILTIN(__builtin_debugtrap)
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
#elif defined(__APPLE__) && defined(__arm__)
@@ -69,7 +73,7 @@ assert can have unique static variables associated with it.
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */
# define SDL_FUNCTION __func__
#elif ((__GNUC__ >= 2) || defined(_MSC_VER) || defined (__WATCOMC__))
#elif ((defined(__GNUC__) && (__GNUC__ >= 2)) || defined(_MSC_VER) || defined (__WATCOMC__))
# define SDL_FUNCTION __FUNCTION__
#else
# define SDL_FUNCTION "???"
@@ -123,12 +127,10 @@ typedef struct SDL_AssertData
const struct SDL_AssertData *next;
} SDL_AssertData;
#if (SDL_ASSERT_LEVEL > 0)
/* Never call this directly. Use the SDL_assert* macros. */
extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
const char *,
const char *, int)
const char *,
const char *, int)
#if defined(__clang__)
#if __has_feature(attribute_analyzer_noreturn)
/* this tells Clang's static analysis that we're a custom assert function,
@@ -149,9 +151,7 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
#define SDL_enabled_assert(condition) \
do { \
while ( !(condition) ) { \
static struct SDL_AssertData sdl_assert_data = { \
0, 0, #condition, 0, 0, 0, 0 \
}; \
static struct SDL_AssertData sdl_assert_data = { 0, 0, #condition, 0, 0, 0, 0 }; \
const SDL_AssertState sdl_assert_state = SDL_ReportAssertion(&sdl_assert_data, SDL_FUNCTION, SDL_FILE, SDL_LINE); \
if (sdl_assert_state == SDL_ASSERTION_RETRY) { \
continue; /* go again. */ \
@@ -162,8 +162,6 @@ extern DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData *,
} \
} while (SDL_NULL_WHILE_LOOP_CONDITION)
#endif /* enabled assertions support code */
/* Enable various levels of assertions. */
#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */
# define SDL_assert(condition) SDL_disabled_assert(condition)
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -237,6 +237,25 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
#endif
#endif
/* "REP NOP" is PAUSE, coded for tools that don't know it by that name. */
#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("pause\n") /* Some assemblers can't do REP NOP, so go with PAUSE. */
#elif (defined(__arm__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7) || defined(__aarch64__)
#define SDL_CPUPauseInstruction() __asm__ __volatile__("yield" ::: "memory")
#elif (defined(__powerpc__) || defined(__powerpc64__))
#define SDL_CPUPauseInstruction() __asm__ __volatile__("or 27,27,27");
#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
#define SDL_CPUPauseInstruction() _mm_pause() /* this is actually "rep nop" and not a SIMD instruction. No inline asm in MSVC x86-64! */
#elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
#define SDL_CPUPauseInstruction() __yield()
#elif defined(__WATCOMC__) && defined(__386__)
extern __inline void SDL_CPUPauseInstruction(void);
#pragma aux SDL_CPUPauseInstruction = ".686p" ".xmm2" "pause"
#else
#define SDL_CPUPauseInstruction()
#endif
/**
* \brief A type representing an atomic integer value. It is a struct
* so people don't accidentally use numeric operations on it.
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -169,13 +169,13 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
* The calculated values in this structure are calculated by SDL_OpenAudio().
*
* For multi-channel audio, the default SDL channel mapping is:
* 2: FL FR (stereo)
* 3: FL FR LFE (2.1 surround)
* 4: FL FR BL BR (quad)
* 5: FL FR FC BL BR (quad + center)
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
* 7: FL FR FC LFE BC SL SR (6.1 surround)
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
* 2: FL FR (stereo)
* 3: FL FR LFE (2.1 surround)
* 4: FL FR BL BR (quad)
* 5: FL FR LFE BL BR (4.1 surround)
* 6: FL FR FC LFE SL SR (5.1 surround - last two can also be BL BR)
* 7: FL FR FC LFE BC SL SR (6.1 surround)
* 8: FL FR FC LFE BL BR SL SR (7.1 surround)
*/
typedef struct SDL_AudioSpec
{
@@ -487,6 +487,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_GetNumAudioDevices
* \sa SDL_GetDefaultAudioInfo
*/
extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
int iscapture);
@@ -512,12 +513,48 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index,
* \since This function is available since SDL 2.0.16.
*
* \sa SDL_GetNumAudioDevices
* \sa SDL_GetDefaultAudioInfo
*/
extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
int iscapture,
SDL_AudioSpec *spec);
/**
* Get the name and preferred format of the default audio device.
*
* Some (but not all!) platforms have an isolated mechanism to get information
* about the "default" device. This can actually be a completely different
* device that's not in the list you get from SDL_GetAudioDeviceSpec(). It can
* even be a network address! (This is discussed in SDL_OpenAudioDevice().)
*
* As a result, this call is not guaranteed to be performant, as it can query
* the sound server directly every time, unlike the other query functions. You
* should call this function sparingly!
*
* `spec` will be filled with the sample rate, sample format, and channel
* count, if a default device exists on the system. If `name` is provided,
* will be filled with either a dynamically-allocated UTF-8 string or NULL.
*
* \param name A pointer to be filled with the name of the default device (can
* be NULL). Please call SDL_free() when you are done with this
* pointer!
* \param spec The SDL_AudioSpec to be initialized by this function.
* \param iscapture non-zero to query the default recording device, zero to
* query the default output device.
* \returns 0 on success, nonzero on error
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GetAudioDeviceName
* \sa SDL_GetAudioDeviceSpec
* \sa SDL_OpenAudioDevice
*/
extern DECLSPEC int SDLCALL SDL_GetDefaultAudioInfo(char **name,
SDL_AudioSpec *spec,
int iscapture);
/**
* Open a specific audio device.
*
@@ -584,6 +621,7 @@ extern DECLSPEC int SDLCALL SDL_GetAudioDeviceSpec(int index,
* - `SDL_AUDIO_ALLOW_FREQUENCY_CHANGE`
* - `SDL_AUDIO_ALLOW_FORMAT_CHANGE`
* - `SDL_AUDIO_ALLOW_CHANNELS_CHANGE`
* - `SDL_AUDIO_ALLOW_SAMPLES_CHANGE`
* - `SDL_AUDIO_ALLOW_ANY_CHANGE`
*
* These flags specify how SDL should behave when a device cannot offer a
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -52,7 +52,7 @@ typedef enum
dstA = dstA */
SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply
dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA)) */
dstA = dstA */
SDL_BLENDMODE_INVALID = 0x7FFFFFFF
/* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -82,6 +82,53 @@ extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
/**
* Put UTF-8 text into the primary selection.
*
* \param text the text to store in the primary selection
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 2.26.0.
*
* \sa SDL_GetPrimarySelectionText
* \sa SDL_HasPrimarySelectionText
*/
extern DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text);
/**
* Get UTF-8 text from the primary selection, which must be freed with
* SDL_free().
*
* This functions returns empty string if there was not enough memory left for
* a copy of the primary selection's content.
*
* \returns the primary selection text on success or an empty string on
* failure; call SDL_GetError() for more information. Caller must
* call SDL_free() on the returned pointer when done with it (even if
* there was an error).
*
* \since This function is available since SDL 2.26.0.
*
* \sa SDL_HasPrimarySelectionText
* \sa SDL_SetPrimarySelectionText
*/
extern DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void);
/**
* Query whether the primary selection exists and contains a non-empty text
* string.
*
* \returns SDL_TRUE if the primary selection has text, or SDL_FALSE if it
* does not.
*
* \since This function is available since SDL 2.26.0.
*
* \sa SDL_GetPrimarySelectionText
* \sa SDL_SetPrimarySelectionText
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasPrimarySelectionText(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -38,12 +38,23 @@
#include <winsdkver.h>
#endif
/* sdkddkver.h defines more specific SDK version numbers. This is needed because older versions of the
* Windows 10 SDK have broken declarations for the C API for DirectX 12. */
#if !defined(HAVE_SDKDDKVER_H) && defined(__has_include)
#if __has_include(<sdkddkver.h>)
#define HAVE_SDKDDKVER_H 1
#endif
#endif
#ifdef HAVE_SDKDDKVER_H
#include <sdkddkver.h>
#endif
/* This is a set of defines to configure the SDL features */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
#define HAVE_STDINT_H 1
#elif defined(_MSC_VER)
#if !defined(HAVE_STDINT_H) && !defined(_STDINT_H_)
/* Most everything except Visual Studio 2008 and earlier has stdint.h now */
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
@@ -60,28 +71,9 @@ typedef unsigned int uintptr_t;
#endif
#define _UINTPTR_T_DEFINED
#endif
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#endif
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
#endif
#else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#ifndef _SIZE_T_DEFINED_
#define _SIZE_T_DEFINED_
typedef unsigned int size_t;
#endif
typedef unsigned int uintptr_t;
#endif /* __GNUC__ || _MSC_VER */
#else
#define HAVE_STDINT_H 1
#endif /* Visual Studio 2008 */
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */
#ifdef _WIN64
@@ -97,6 +89,7 @@ typedef unsigned int uintptr_t;
#define HAVE_DDRAW_H 1
#define HAVE_DINPUT_H 1
#define HAVE_DSOUND_H 1
#ifndef __WATCOMC__
#define HAVE_DXGI_H 1
#define HAVE_XINPUT_H 1
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */
@@ -106,10 +99,17 @@ typedef unsigned int uintptr_t;
#define HAVE_D3D11_H 1
#define HAVE_ROAPI_H 1
#endif
#if defined(WDK_NTDDI_VERSION) && WDK_NTDDI_VERSION > 0x0A000008 /* 10.0.19041.0 */
#define HAVE_D3D12_H 1
#endif
#if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0603 /* Windows 8.1 SDK */
#define HAVE_SHELLSCALINGAPI_H 1
#endif
#define HAVE_MMDEVICEAPI_H 1
#define HAVE_AUDIOCLIENT_H 1
#define HAVE_TPCSHRD_H 1
#define HAVE_SENSORSAPI_H 1
#endif
#if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
#define HAVE_IMMINTRIN_H 1
#elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
@@ -136,7 +136,11 @@ typedef unsigned int uintptr_t;
#define HAVE_REALLOC 1
#define HAVE_FREE 1
#define HAVE_ALLOCA 1
/* OpenWatcom requires specific calling conventions for qsort and bsearch */
#ifndef __WATCOMC__
#define HAVE_QSORT 1
#define HAVE_BSEARCH 1
#endif
#define HAVE_ABS 1
#define HAVE_MEMSET 1
#define HAVE_MEMCPY 1
@@ -167,37 +171,40 @@ typedef unsigned int uintptr_t;
#define HAVE__WCSNICMP 1
#define HAVE__WCSDUP 1
#define HAVE_ACOS 1
#define HAVE_ACOSF 1
#define HAVE_ASIN 1
#define HAVE_ASINF 1
#define HAVE_ATAN 1
#define HAVE_ATANF 1
#define HAVE_ATAN2 1
#define HAVE_CEIL 1
#define HAVE_COS 1
#define HAVE_EXP 1
#define HAVE_FABS 1
#define HAVE_FLOOR 1
#define HAVE_FMOD 1
#define HAVE_LOG 1
#define HAVE_LOG10 1
#define HAVE_POW 1
#define HAVE_SIN 1
#define HAVE_SQRT 1
#define HAVE_TAN 1
#ifndef __WATCOMC__
#define HAVE_ACOSF 1
#define HAVE_ASINF 1
#define HAVE_ATANF 1
#define HAVE_ATAN2F 1
#define HAVE_CEILF 1
#define HAVE__COPYSIGN 1
#define HAVE_COS 1
#define HAVE_COSF 1
#define HAVE_EXP 1
#define HAVE_EXPF 1
#define HAVE_FABS 1
#define HAVE_FABSF 1
#define HAVE_FLOOR 1
#define HAVE_FLOORF 1
#define HAVE_FMOD 1
#define HAVE_FMODF 1
#define HAVE_LOG 1
#define HAVE_LOGF 1
#define HAVE_LOG10 1
#define HAVE_LOG10F 1
#define HAVE_POW 1
#define HAVE_POWF 1
#define HAVE_SIN 1
#define HAVE_SINF 1
#define HAVE_SQRT 1
#define HAVE_SQRTF 1
#define HAVE_TAN 1
#define HAVE_TANF 1
#endif
#if defined(_MSC_VER)
/* These functions were added with the VC++ 2013 C runtime library */
#if _MSC_VER >= 1800
@@ -217,8 +224,18 @@ typedef unsigned int uintptr_t;
#if _MSC_VER >= 1400
#define HAVE__FSEEKI64 1
#endif
#ifdef _USE_MATH_DEFINES
#define HAVE_M_PI 1
#endif
#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
#elif defined(__WATCOMC__)
#define HAVE__FSEEKI64 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOULL 1
#define HAVE_VSSCANF 1
#define HAVE_ROUND 1
#define HAVE_SCALBN 1
#define HAVE_TRUNC 1
#else
#define HAVE_M_PI 1
#endif
#else
@@ -227,7 +244,9 @@ typedef unsigned int uintptr_t;
#endif
/* Enable various audio drivers */
#if defined(HAVE_MMDEVICEAPI_H) && defined(HAVE_AUDIOCLIENT_H)
#define SDL_AUDIO_DRIVER_WASAPI 1
#endif
#define SDL_AUDIO_DRIVER_DSOUND 1
#define SDL_AUDIO_DRIVER_WINMM 1
#define SDL_AUDIO_DRIVER_DISK 1
@@ -248,7 +267,11 @@ typedef unsigned int uintptr_t;
#define SDL_HAPTIC_XINPUT 1
/* Enable the sensor driver */
#ifdef HAVE_SENSORSAPI_H
#define SDL_SENSOR_WINDOWS 1
#else
#define SDL_SENSOR_DUMMY 1
#endif
/* Enable various shared object loading systems */
#define SDL_LOADSO_WINDOWS 1
@@ -270,6 +293,9 @@ typedef unsigned int uintptr_t;
#if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
#define SDL_VIDEO_RENDER_D3D11 1
#endif
#if !defined(SDL_VIDEO_RENDER_D3D12) && defined(HAVE_D3D12_H)
#define SDL_VIDEO_RENDER_D3D12 1
#endif
/* Enable OpenGL support */
#ifndef SDL_VIDEO_OPENGL
@@ -300,11 +326,6 @@ typedef unsigned int uintptr_t;
/* Enable filesystem support */
#define SDL_FILESYSTEM_WINDOWS 1
/* Enable assembly routines (Win64 doesn't have inline asm) */
#ifndef _WIN64
#define SDL_ASSEMBLY_ROUTINES 1
#endif
#endif /* SDL_config_windows_h_ */
/* vi: set ts=4 sw=4 expandtab: */
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -79,7 +79,7 @@ _m_prefetch(void *__P)
#if !defined(SDL_DISABLE_ARM_NEON_H)
# if defined(__ARM_NEON)
# include <arm_neon.h>
# elif defined(__WINDOWS__) || defined(__WINRT__)
# elif defined(__WINDOWS__) || defined(__WINRT__) || defined(__GDK__)
/* Visual Studio doesn't define __ARM_ARCH, but _M_ARM (if set, always 7), and _M_ARM64 (if set, always 1). */
# if defined(_M_ARM)
# include <armintr.h>
@@ -90,6 +90,7 @@ _m_prefetch(void *__P)
# include <arm64intr.h>
# include <arm64_neon.h>
# define __ARM_NEON 1 /* Set __ARM_NEON so that it can be used elsewhere, at compile time */
# define __ARM_ARCH 8
# endif
# endif
#endif
@@ -98,6 +99,14 @@ _m_prefetch(void *__P)
#if defined(__3dNOW__) && !defined(SDL_DISABLE_MM3DNOW_H)
#include <mm3dnow.h>
#endif
#if defined(__loongarch_sx) && !defined(SDL_DISABLE_LSX_H)
#include <lsxintrin.h>
#define __LSX__
#endif
#if defined(__loongarch_asx) && !defined(SDL_DISABLE_LASX_H)
#include <lasxintrin.h>
#define __LASX__
#endif
#if defined(HAVE_IMMINTRIN_H) && !defined(SDL_DISABLE_IMMINTRIN_H)
#include <immintrin.h>
#else
@@ -433,10 +442,36 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasARMSIMD(void);
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasNEON(void);
/**
* Determine whether the CPU has LSX (LOONGARCH SIMD) features.
*
* This always returns false on CPUs that aren't using LOONGARCH instruction
* sets.
*
* \returns SDL_TRUE if the CPU has LOONGARCH LSX features or SDL_FALSE if
* not.
*
* \since This function is available since SDL 2.24.0.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasLSX(void);
/**
* Determine whether the CPU has LASX (LOONGARCH SIMD) features.
*
* This always returns false on CPUs that aren't using LOONGARCH instruction
* sets.
*
* \returns SDL_TRUE if the CPU has LOONGARCH LASX features or SDL_FALSE if
* not.
*
* \since This function is available since SDL 2.24.0.
*/
extern DECLSPEC SDL_bool SDLCALL SDL_HasLASX(void);
/**
* Get the amount of RAM configured in the system.
*
* \returns the amount of RAM configured in the system in MB.
* \returns the amount of RAM configured in the system in MiB.
*
* \since This function is available since SDL 2.0.1.
*/
@@ -494,7 +529,7 @@ extern DECLSPEC size_t SDLCALL SDL_SIMDGetAlignment(void);
*
* \since This function is available since SDL 2.0.10.
*
* \sa SDL_SIMDAlignment
* \sa SDL_SIMDGetAlignment
* \sa SDL_SIMDRealloc
* \sa SDL_SIMDFree
*/
@@ -518,7 +553,7 @@ extern DECLSPEC void * SDLCALL SDL_SIMDAlloc(const size_t len);
*
* \since This function is available since SDL 2.0.14.
*
* \sa SDL_SIMDAlignment
* \sa SDL_SIMDGetAlignment
* \sa SDL_SIMDAlloc
* \sa SDL_SIMDFree
*/
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -192,6 +192,20 @@ typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
#define KHRONOS_SUPPORT_INT64 1
#define KHRONOS_SUPPORT_FLOAT 1
/*
* To support platform where unsigned long cannot be used interchangeably with
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
* unsigned long long or similar (this results in different C++ name mangling).
* To avoid changes for existing platforms, we restrict usage of intptr_t to
* platforms where the size of a pointer is larger than the size of long.
*/
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
#define KHRONOS_USE_INTPTR_T
#endif
#endif
#elif defined(__VMS ) || defined(__sgi)
@@ -274,14 +288,21 @@ typedef unsigned short int khronos_uint16_t;
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
* to be the only LLP64 architecture in current use.
*/
#ifdef _WIN64
#ifdef KHRONOS_USE_INTPTR_T
typedef intptr_t khronos_intptr_t;
typedef uintptr_t khronos_uintptr_t;
#elif defined(_WIN64)
typedef signed long long int khronos_intptr_t;
typedef unsigned long long int khronos_uintptr_t;
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_intptr_t;
typedef unsigned long int khronos_uintptr_t;
#endif
#if defined(_WIN64)
typedef signed long long int khronos_ssize_t;
typedef unsigned long long int khronos_usize_t;
#else
typedef signed long int khronos_ssize_t;
typedef unsigned long int khronos_usize_t;
#endif
@@ -516,7 +537,7 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
*/
/*#include <EGL/eglplatform.h>*/
@@ -525,7 +546,7 @@ extern "C" {
#define EGL_EGL_PROTOTYPES 1
#endif
/* Generated on date 20210901 */
/* Generated on date 20220525 */
/* Generated C header for:
* API: egl
@@ -860,12 +881,12 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.khronos.org/registry/egl
**
** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
*/
/*#include <EGL/eglplatform.h>*/
#define EGL_EGLEXT_VERSION 20210901
#define EGL_EGLEXT_VERSION 20220525
/* Generated C header for:
* API: egl
@@ -1569,6 +1590,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi
#define EGL_RENDERER_EXT 0x335F
#endif /* EGL_EXT_device_query_name */
#ifndef EGL_EXT_explicit_device
#define EGL_EXT_explicit_device 1
#endif /* EGL_EXT_explicit_device */
#ifndef EGL_EXT_gl_colorspace_bt2020_linear
#define EGL_EXT_gl_colorspace_bt2020_linear 1
#define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
@@ -1794,6 +1819,31 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
#define EGL_METADATA_SCALING_EXT 50000
#endif /* EGL_EXT_surface_SMPTE2086_metadata */
#ifndef EGL_EXT_surface_compression
#define EGL_EXT_surface_compression 1
#define EGL_SURFACE_COMPRESSION_EXT 0x34B0
#define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E
#define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE
#define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
#endif
#endif /* EGL_EXT_surface_compression */
#ifndef EGL_EXT_swap_buffers_with_damage
#define EGL_EXT_swap_buffers_with_damage 1
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
@@ -2028,12 +2078,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
#define EGL_STREAM_IMAGE_ADD_NV 0x3374
#define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
#define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
#ifdef EGL_EGLEXT_PROTOTYPES
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -39,7 +39,7 @@
static __inline__ void __attribute__((__always_inline__, __nodebug__))
_m_prefetch(void *__P)
{
__builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
__builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */);
}
#endif /* __PRFCHWINTRIN_H */
#endif /* __clang__ */
@@ -59,7 +59,7 @@ _m_prefetch(void *__P)
#ifdef __linux__
#include <endian.h>
#define SDL_BYTEORDER __BYTE_ORDER
#elif defined(__OpenBSD__)
#elif defined(__OpenBSD__) || defined(__DragonFly__)
#include <endian.h>
#define SDL_BYTEORDER BYTE_ORDER
#elif defined(__FreeBSD__) || defined(__NetBSD__)
@@ -78,7 +78,7 @@ _m_prefetch(void *__P)
#if defined(__hppa__) || \
defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
(defined(__MIPS__) && defined(__MIPSEB__)) || \
defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
defined(__sparc__)
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#else
@@ -87,6 +87,28 @@ _m_prefetch(void *__P)
#endif /* __linux__ */
#endif /* !SDL_BYTEORDER */
#ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
/* predefs from newer gcc versions: */
#if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
#if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
#elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
#else
#error Unsupported endianness
#endif /**/
#elif defined(__MAVERICK__)
/* For Maverick, float words are always little-endian. */
#define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
#elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
/* For FPA, float words are always big-endian. */
#define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
#else
/* By default, assume that floats words follow the memory system mode. */
#define SDL_FLOATWORDORDER SDL_BYTEORDER
#endif /* __FLOAT_WORD_ORDER__ */
#endif /* !SDL_FLOATWORDORDER */
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
@@ -118,7 +140,7 @@ extern "C" {
#if HAS_BUILTIN_BSWAP16
#define SDL_Swap16(x) __builtin_bswap16(x)
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
#pragma intrinsic(_byteswap_ushort)
#define SDL_Swap16(x) _byteswap_ushort(x)
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
@@ -167,7 +189,7 @@ SDL_Swap16(Uint16 x)
#if HAS_BUILTIN_BSWAP32
#define SDL_Swap32(x) __builtin_bswap32(x)
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
#pragma intrinsic(_byteswap_ulong)
#define SDL_Swap32(x) _byteswap_ulong(x)
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
@@ -219,7 +241,7 @@ SDL_Swap32(Uint32 x)
#if HAS_BUILTIN_BSWAP64
#define SDL_Swap64(x) __builtin_bswap64(x)
#elif defined(_MSC_VER) && (_MSC_VER >= 1400)
#elif (defined(_MSC_VER) && (_MSC_VER >= 1400)) && !defined(__ICL)
#pragma intrinsic(_byteswap_uint64)
#define SDL_Swap64(x) _byteswap_uint64(x)
#elif defined(__i386__) && !HAS_BROKEN_BSWAP
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -118,6 +118,7 @@ typedef enum
SDL_JOYBUTTONUP, /**< Joystick button released */
SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
SDL_JOYBATTERYUPDATED, /**< Joystick battery level change */
/* Game controller events */
SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
@@ -142,7 +143,7 @@ typedef enum
SDL_MULTIGESTURE,
/* Clipboard events */
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard or primary selection changed */
/* Drag and drop events */
SDL_DROPFILE = 0x1000, /**< The system requests a file open */
@@ -317,6 +318,8 @@ typedef struct SDL_MouseWheelEvent
Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
Sint32 mouseX; /**< X coordinate, relative to window (added in 2.26.0) */
Sint32 mouseY; /**< Y coordinate, relative to window (added in 2.26.0) */
} SDL_MouseWheelEvent;
/**
@@ -395,6 +398,16 @@ typedef struct SDL_JoyDeviceEvent
Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
} SDL_JoyDeviceEvent;
/**
* \brief Joysick battery level change event structure (event.jbattery.*)
*/
typedef struct SDL_JoyBatteryEvent
{
Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
SDL_JoystickID which; /**< The joystick instance id */
SDL_JoystickPowerLevel level; /**< The joystick battery level */
} SDL_JoyBatteryEvent;
/**
* \brief Game controller axis motion event structure (event.caxis.*)
@@ -463,6 +476,7 @@ typedef struct SDL_ControllerSensorEvent
SDL_JoystickID which; /**< The joystick instance id */
Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
} SDL_ControllerSensorEvent;
/**
@@ -554,6 +568,7 @@ typedef struct SDL_SensorEvent
Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
Sint32 which; /**< The instance ID of the sensor */
float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
} SDL_SensorEvent;
/**
@@ -625,6 +640,7 @@ typedef union SDL_Event
SDL_JoyHatEvent jhat; /**< Joystick hat event data */
SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
SDL_JoyBatteryEvent jbattery; /**< Joystick battery event data */
SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -60,6 +60,10 @@ extern "C" {
* - `parent`: the containing directory of the bundle. For example:
* `/Applications/SDLApp/`
*
* **Nintendo 3DS Specific Functionality**: This function returns "romfs"
* directory of the application as it is uncommon to store resources outside
* the executable. As such it is not a writable directory.
*
* The returned path is guaranteed to end with a path separator ('\' on
* Windows, '/' on most other platforms).
*
@@ -92,7 +96,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
*
* `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
*
* On Linux, the string might look like"
* On Linux, the string might look like:
*
* `/home/bob/.local/share/My Program Name/`
*
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -69,7 +69,11 @@ typedef enum
SDL_CONTROLLER_TYPE_VIRTUAL,
SDL_CONTROLLER_TYPE_PS5,
SDL_CONTROLLER_TYPE_AMAZON_LUNA,
SDL_CONTROLLER_TYPE_GOOGLE_STADIA
SDL_CONTROLLER_TYPE_GOOGLE_STADIA,
SDL_CONTROLLER_TYPE_NVIDIA_SHIELD,
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
} SDL_GameControllerType;
typedef enum
@@ -289,6 +293,25 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
/**
* Get the implementation dependent path for the game controller.
*
* This function can be called before any controllers are opened.
*
* `joystick_index` is the same as the `device_index` passed to
* SDL_JoystickOpen().
*
* \param joystick_index the device_index of a device, from zero to
* SDL_NumJoysticks()-1
* \returns the implementation-dependent path for the game controller, or NULL
* if there is no path or the index is invalid.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GameControllerPath
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index);
/**
* Get the type of a game controller.
*
@@ -386,6 +409,23 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
/**
* Get the implementation-dependent path for an opened game controller.
*
* This is the same path as returned by SDL_GameControllerNameForIndex(), but
* it takes a controller identifier instead of the (unstable) device index.
*
* \param gamecontroller a game controller identifier previously returned by
* SDL_GameControllerOpen()
* \returns the implementation dependent path for the game controller, or NULL
* if there is no path or the identifier passed is invalid.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GameControllerPathForIndex
*/
extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller);
/**
* Get the type of this currently opened controller
*
@@ -415,7 +455,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController
* Set the player index of an opened game controller.
*
* \param gamecontroller the game controller object to adjust.
* \param player_index Player index to assign to this controller.
* \param player_index Player index to assign to this controller, or -1 to
* clear the player index and turn off player LEDs.
*
* \since This function is available since SDL 2.0.12.
*/
@@ -457,6 +498,18 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *
*/
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
/**
* Get the firmware version of an opened controller, if available.
*
* If the firmware version isn't available this function returns 0.
*
* \param gamecontroller the game controller object to query.
* \return the controller firmware version, or zero if unavailable.
*
* \since This function is available since SDL 2.24.0.
*/
extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller);
/**
* Get the serial number of an opened controller, if available.
*
@@ -671,10 +724,10 @@ typedef enum
SDL_CONTROLLER_BUTTON_DPAD_LEFT,
SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Amazon Luna microphone button */
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 (upper left, facing the back) */
SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 (upper right, facing the back) */
SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 (lower left, facing the back) */
SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 (lower right, facing the back) */
SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
SDL_CONTROLLER_BUTTON_MAX
} SDL_GameControllerButton;
@@ -701,7 +754,7 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom
* The caller should not SDL_free() the returned string.
*
* \param button an enum value for a given SDL_GameControllerButton
* \returns a string for the given button, or NULL if an invalid axis is
* \returns a string for the given button, or NULL if an invalid button is
* specified. The string returned is of the format used by
* SDL_GameController mapping strings.
*
@@ -842,6 +895,25 @@ extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameContro
*/
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
/**
* Get the current state of a game controller sensor with the timestamp of the
* last update.
*
* The number of values and interpretation of the data is sensor dependent.
* See SDL_sensor.h for the details for each type of sensor.
*
* \param gamecontroller The controller to query
* \param type The type of sensor to query
* \param timestamp A pointer filled with the timestamp in microseconds of the
* current sensor reading if available, or 0 if not
* \param data A pointer filled with the current sensor state
* \param num_values The number of values to write to data
* \return 0 or -1 if an error occurred.
*
* \since This function is available since SDL 2.26.0.
*/
extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values);
/**
* Start a rumble effect on a game controller.
*
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -0,0 +1,100 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
/**
* \file SDL_guid.h
*
* Include file for handling ::SDL_GUID values.
*/
#ifndef SDL_guid_h_
#define SDL_guid_h_
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif
/**
* An SDL_GUID is a 128-bit identifier for an input device that
* identifies that device across runs of SDL programs on the same
* platform. If the device is detached and then re-attached to a
* different port, or if the base system is rebooted, the device
* should still report the same GUID.
*
* GUIDs are as precise as possible but are not guaranteed to
* distinguish physically distinct but equivalent devices. For
* example, two game controllers from the same vendor with the same
* product ID and revision may have the same GUID.
*
* GUIDs may be platform-dependent (i.e., the same device may report
* different GUIDs on different operating systems).
*/
typedef struct {
Uint8 data[16];
} SDL_GUID;
/* Function prototypes */
/**
* Get an ASCII string representation for a given ::SDL_GUID.
*
* You should supply at least 33 bytes for pszGUID.
*
* \param guid the ::SDL_GUID you wish to convert to string
* \param pszGUID buffer in which to write the ASCII string
* \param cbGUID the size of pszGUID
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GUIDFromString
*/
extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
/**
* Convert a GUID string into a ::SDL_GUID structure.
*
* Performs no error checking. If this function is given a string containing
* an invalid GUID, the function will silently succeed, but the GUID generated
* will not be useful.
*
* \param pchGUID string containing an ASCII representation of a GUID
* \returns a ::SDL_GUID structure.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GUIDToString
*/
extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_guid_h_ */
/* vi: set ts=4 sw=4 expandtab: */
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -92,7 +92,7 @@ extern "C" {
* By default this hint is not set and the APK expansion files are not searched.
*/
#define SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
/**
* \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
*
@@ -132,13 +132,13 @@ extern "C" {
* \brief A variable to control whether we trap the Android back button to handle it manually.
* This is necessary for the right mouse button to work on some Android devices, or
* to be able to trap the back button for use in your code reliably. If set to true,
* the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of
* the back button will show up as an SDL_KEYDOWN / SDL_KEYUP pair with a keycode of
* SDL_SCANCODE_AC_BACK.
*
* The variable can be set to the following values:
* "0" - Back button will be handled as usual for system. (default)
* "1" - Back button will be trapped, allowing you to handle the key press
* manually. (This will also let right mouse click work on systems
* manually. (This will also let right mouse click work on systems
* where the right mouse button functions as back.)
*
* The value of this hint is used at runtime, so it can be changed at any time.
@@ -147,7 +147,7 @@ extern "C" {
/**
* \brief Specify an application name.
*
*
* This hint lets you specify the application name sent to the OS when
* required. For example, this will often appear in volume control applets for
* audio streams, and in lists of applications which are inhibiting the
@@ -278,10 +278,7 @@ extern "C" {
* If this hint isn't specified to a valid setting, or libsamplerate isn't
* available, SDL will use the default, internal resampling algorithm.
*
* Note that this is currently only applicable to resampling audio that is
* being written to a device for playback or audio being read from a device
* for capture. SDL_AudioCVT always uses the default resampler (although this
* might change for SDL 2.1).
* As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available.
*
* This hint is currently only checked at audio subsystem initialization.
*
@@ -380,6 +377,17 @@ extern "C" {
*/
#define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
/**
* \brief A variable that controls whether the on-screen keyboard should be shown when text input is active
*
* The variable can be set to the following values:
* "0" - Do not show the on-screen keyboard
* "1" - Show the on-screen keyboard
*
* The default value is "1". This hint must be set before text input is activated.
*/
#define SDL_HINT_ENABLE_SCREEN_KEYBOARD "SDL_ENABLE_SCREEN_KEYBOARD"
/**
* \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
*
@@ -392,13 +400,14 @@ extern "C" {
#define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
/**
* \brief A variable controlling whether SDL logs all events pushed onto its internal queue.
* \brief A variable controlling verbosity of the logging of SDL events pushed onto the internal queue.
*
* This variable can be set to the following values:
* This variable can be set to the following values, from least to most verbose:
*
* "0" - Don't log any events (default)
* "1" - Log all events except mouse and finger motion, which are pretty spammy.
* "2" - Log all events.
* "1" - Log most events (other than the really spammy ones).
* "2" - Include mouse and finger motion events.
* "3" - Include SDL_SysWMEvent events.
*
* This is generally meant to be used to debug SDL itself, but can be useful
* for application developers that need better visibility into what is going
@@ -509,7 +518,7 @@ extern "C" {
/**
* \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
*
*
* For example, on Nintendo Switch controllers, normally you'd get:
*
* (Y)
@@ -541,6 +550,14 @@ extern "C" {
*/
#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD"
/**
* \brief A variable containing a list of devices to ignore in SDL_hid_enumerate()
*
* For example, to ignore the Shanwan DS3 controller and any Valve controller, you might
* have the string "0x2563/0x0523,0x28de/0x0000"
*/
#define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES"
/**
* \brief A variable controlling whether the idle timer is disabled on iOS.
*
@@ -563,9 +580,9 @@ extern "C" {
*
* The variable can be set to the following values:
* "0" - SDL_TEXTEDITING events are sent, and it is the application's
* responsibility to render the text from these events and
* responsibility to render the text from these events and
* differentiate it somehow from committed text. (default)
* "1" - If supported by the IME then SDL_TEXTEDITING events are not sent,
* "1" - If supported by the IME then SDL_TEXTEDITING events are not sent,
* and text that is being composed will be rendered in its own UI.
*/
#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
@@ -651,18 +668,38 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
/**
* \brief A variable controlling whether Switch Joy-Cons should be treated the same as Switch Pro Controllers when using the HIDAPI driver.
/**
* \brief A variable controlling whether the HIDAPI driver for Nintendo Switch Joy-Cons should be used.
*
* This variable can be set to the following values:
* "0" - basic Joy-Con support with no analog input (the default)
* "1" - Joy-Cons treated as half full Pro Controllers with analog inputs and sensors
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* This does not combine Joy-Cons into a single controller. That's up to the user.
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
#define SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS "SDL_JOYSTICK_HIDAPI_JOY_CONS"
/**
/**
* \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be combined into a single Pro-like controller when using the HIDAPI driver
*
* This variable can be set to the following values:
* "0" - Left and right Joy-Con controllers will not be combined and each will be a mini-gamepad
* "1" - Left and right Joy-Con controllers will be combined into a single controller (the default)
*/
#define SDL_HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"
/**
* \brief A variable controlling whether Nintendo Switch Joy-Con controllers will be in vertical mode when using the HIDAPI driver
*
* This variable can be set to the following values:
* "0" - Left and right Joy-Con controllers will not be in vertical mode (the default)
* "1" - Left and right Joy-Con controllers will be in vertical mode
*
* This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
*/
#define SDL_HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS "SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"
/**
* \brief A variable controlling whether the HIDAPI driver for Amazon Luna controllers connected via Bluetooth should be used.
*
* This variable can be set to the following values:
@@ -673,6 +710,42 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA"
/**
* \brief A variable controlling whether the HIDAPI driver for Nintendo Online classic controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
#define SDL_HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"
/**
* \brief A variable controlling whether the HIDAPI driver for NVIDIA SHIELD controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI
*/
#define SDL_HINT_JOYSTICK_HIDAPI_SHIELD "SDL_JOYSTICK_HIDAPI_SHIELD"
/**
* \brief A variable controlling whether the HIDAPI driver for PS3 controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI on macOS, and "0" on other platforms.
*
* It is not possible to use this driver on Windows, due to limitations in the default drivers
* installed. See https://github.com/ViGEm/DsHidMini for an alternative driver on Windows.
*/
#define SDL_HINT_JOYSTICK_HIDAPI_PS3 "SDL_JOYSTICK_HIDAPI_PS3"
/**
* \brief A variable controlling whether the HIDAPI driver for PS4 controllers should be used.
*
@@ -755,7 +828,7 @@ extern "C" {
#define SDL_HINT_JOYSTICK_HIDAPI_STADIA "SDL_JOYSTICK_HIDAPI_STADIA"
/**
* \brief A variable controlling whether the HIDAPI driver for Steam Controllers should be used.
* \brief A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
@@ -778,16 +851,56 @@ extern "C" {
#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH "SDL_JOYSTICK_HIDAPI_SWITCH"
/**
* \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch controller is opened
* \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Pro controller is opened
*
* This variable can be set to the following values:
* "0" - home button LED is turned off
* "1" - home button LED is turned on
*
* By default the Home button LED state is not changed.
* By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED.
*/
#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
/**
* \brief A variable controlling whether the Home button LED should be turned on when a Nintendo Switch Joy-Con controller is opened
*
* This variable can be set to the following values:
* "0" - home button LED is turned off
* "1" - home button LED is turned on
*
* By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED.
*/
#define SDL_HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"
/**
* \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Nintendo Switch controller.
*
* This variable can be set to the following values:
* "0" - player LEDs are not enabled
* "1" - player LEDs are enabled (the default)
*/
#define SDL_HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
/**
* \brief A variable controlling whether the HIDAPI driver for Nintendo Wii and Wii U controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* This driver doesn't work with the dolphinbar, so the default is SDL_FALSE for now.
*/
#define SDL_HINT_JOYSTICK_HIDAPI_WII "SDL_JOYSTICK_HIDAPI_WII"
/**
* \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with a Wii controller.
*
* This variable can be set to the following values:
* "0" - player LEDs are not enabled
* "1" - player LEDs are enabled (the default)
*/
#define SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED "SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED"
/**
* \brief A variable controlling whether the HIDAPI driver for XBox controllers should be used.
*
@@ -799,7 +912,60 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
/**
/**
* \brief A variable controlling whether the HIDAPI driver for XBox 360 controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
*/
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360 "SDL_JOYSTICK_HIDAPI_XBOX_360"
/**
* \brief A variable controlling whether the player LEDs should be lit to indicate which player is associated with an Xbox 360 controller.
*
* This variable can be set to the following values:
* "0" - player LEDs are not enabled
* "1" - player LEDs are enabled (the default)
*/
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED "SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED"
/**
* \brief A variable controlling whether the HIDAPI driver for XBox 360 wireless controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360
*/
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS "SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS"
/**
* \brief A variable controlling whether the HIDAPI driver for XBox One controllers should be used.
*
* This variable can be set to the following values:
* "0" - HIDAPI driver is not used
* "1" - HIDAPI driver is used
*
* The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
*/
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE "SDL_JOYSTICK_HIDAPI_XBOX_ONE"
/**
* \brief A variable controlling whether the Home button LED should be turned on when an Xbox One controller is opened
*
* This variable can be set to the following values:
* "0" - home button LED is turned off
* "1" - home button LED is turned on
*
* By default the Home button LED state is not changed. This hint can also be set to a floating point value between 0.0 and 1.0 which controls the brightness of the Home button LED. The default brightness is 0.4.
*/
#define SDL_HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED "SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"
/**
* \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
*
* This variable can be set to the following values:
@@ -808,7 +974,7 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"
/**
/**
* \brief A variable controlling whether the RAWINPUT driver should pull correlated data from XInput.
*
* This variable can be set to the following values:
@@ -821,7 +987,7 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
/**
/**
* \brief A variable controlling whether the ROG Chakram mice should show up as joysticks
*
* This variable can be set to the following values:
@@ -830,7 +996,7 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_ROG_CHAKRAM "SDL_JOYSTICK_ROG_CHAKRAM"
/**
/**
* \brief A variable controlling whether a separate thread should be used
* for handling joystick detection and raw input messages on Windows
*
@@ -841,6 +1007,15 @@ extern "C" {
*/
#define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD"
/**
* \brief A variable controlling whether Windows.Gaming.Input should be used for controller handling.
*
* This variable can be set to the following values:
* "0" - WGI is not used
* "1" - WGI is used (the default)
*/
#define SDL_HINT_JOYSTICK_WGI "SDL_JOYSTICK_WGI"
/**
* \brief Determines whether SDL enforces that DRM master is required in order
* to initialize the KMSDRM video backend.
@@ -864,14 +1039,32 @@ extern "C" {
*/
#define SDL_HINT_KMSDRM_REQUIRE_DRM_MASTER "SDL_KMSDRM_REQUIRE_DRM_MASTER"
/**
/**
* \brief A comma separated list of devices to open as joysticks
*
* This variable is currently only used by the Linux joystick driver.
*/
#define SDL_HINT_JOYSTICK_DEVICE "SDL_JOYSTICK_DEVICE"
/**
/**
* \brief A variable controlling whether joysticks on Linux will always treat 'hat' axis inputs (ABS_HAT0X - ABS_HAT3Y) as 8-way digital hats without checking whether they may be analog.
*
* This variable can be set to the following values:
* "0" - Only map hat axis inputs to digital hat outputs if the input axes appear to actually be digital (the default)
* "1" - Always handle the input axes numbered ABS_HAT0X to ABS_HAT3Y as digital hats
*/
#define SDL_HINT_LINUX_DIGITAL_HATS "SDL_LINUX_DIGITAL_HATS"
/**
* \brief A variable controlling whether digital hats on Linux will apply deadzones to their underlying input axes or use unfiltered values.
*
* This variable can be set to the following values:
* "0" - Return digital hat values based on unfiltered input axis values
* "1" - Return digital hat values with deadzones on the input axes taken into account (the default)
*/
#define SDL_HINT_LINUX_HAT_DEADZONES "SDL_LINUX_HAT_DEADZONES"
/**
* \brief A variable controlling whether to use the classic /dev/input/js* joystick interface or the newer /dev/input/event* joystick interface on Linux
*
* This variable can be set to the following values:
@@ -882,7 +1075,7 @@ extern "C" {
*/
#define SDL_HINT_LINUX_JOYSTICK_CLASSIC "SDL_LINUX_JOYSTICK_CLASSIC"
/**
/**
* \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.
*
* This variable can be set to the following values:
@@ -907,6 +1100,24 @@ extern "C" {
*/
#define SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
/**
* \brief A variable controlling whether dispatching OpenGL context updates should block the dispatching thread until the main thread finishes processing
*
* This variable can be set to the following values:
* "0" - Dispatching OpenGL context updates will block the dispatching thread until the main thread finishes processing (default).
* "1" - Dispatching OpenGL context updates will allow the dispatching thread to continue execution.
*
* Generally you want the default, but if you have OpenGL code in a background thread on a Mac, and the main thread
* hangs because it's waiting for that background thread, but that background thread is also hanging because it's
* waiting for the main thread to do an update, this might fix your issue.
*
* This hint only applies to macOS.
*
* This hint is available since SDL 2.24.0.
*
*/
#define SDL_HINT_MAC_OPENGL_ASYNC_DISPATCH "SDL_MAC_OPENGL_ASYNC_DISPATCH"
/**
* \brief A variable setting the double click radius, in pixels.
*/
@@ -976,6 +1187,28 @@ extern "C" {
*/
#define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE"
/**
* \brief A variable controlling whether the system mouse acceleration curve is used for relative mouse motion.
*
* This variable can be set to the following values:
* "0" - Relative mouse motion will be unscaled (the default)
* "1" - Relative mouse motion will be scaled using the system mouse acceleration curve.
*
* If SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE is set, that will override the system speed scale.
*/
#define SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE "SDL_MOUSE_RELATIVE_SYSTEM_SCALE"
/**
* \brief A variable controlling whether a motion event should be generated for mouse warping in relative mode.
*
* This variable can be set to the following values:
* "0" - Warping the mouse will not generate a motion event in relative mode
* "1" - Warping the mouse will generate a motion event in relative mode
*
* By default warping the mouse will not generate motion events in relative mode. This avoids the application having to filter out large relative motion due to warping.
*/
#define SDL_HINT_MOUSE_RELATIVE_WARP_MOTION "SDL_MOUSE_RELATIVE_WARP_MOTION"
/**
* \brief A variable controlling whether mouse events should generate synthetic touch events
*
@@ -1063,7 +1296,7 @@ extern "C" {
* When polling for events, SDL_PumpEvents is used to gather new events from devices.
* If a device keeps producing new events between calls to SDL_PumpEvents, a poll loop will
* become stuck until the new events stop.
* This is most noticable when moving a high frequency mouse.
* This is most noticeable when moving a high frequency mouse.
*
* By default, poll sentinels are enabled.
*/
@@ -1097,6 +1330,8 @@ extern "C" {
*
* This variable can be one of the following values:
* "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
*
* Since SDL 2.0.22 this variable accepts a comma-separated list of values above.
*/
#define SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION "SDL_QTWAYLAND_CONTENT_ORIENTATION"
@@ -1181,6 +1416,8 @@ extern "C" {
*
* This variable is case insensitive and can be set to the following values:
* "direct3d"
* "direct3d11"
* "direct3d12"
* "opengl"
* "opengles2"
* "opengles"
@@ -1237,7 +1474,29 @@ extern "C" {
*/
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
/**
/**
* \brief A variable controlling whether the Metal render driver select low power device over default one
*
* This variable can be set to the following values:
* "0" - Use the prefered OS device
* "1" - Select a low power one
*
* By default the prefered OS device is used.
*/
#define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"
/**
* \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
*
* This variable can be set to the following values:
* "0" - It will be using VSYNC as defined in the main flag. Default
* "1" - If VSYNC was previously enabled, then it will disable VSYNC if doesn't reach enough speed
*
* By default SDL does not enable the automatic VSYNC
*/
#define SDL_HINT_PS2_DYNAMIC_VSYNC "SDL_PS2_DYNAMIC_VSYNC"
/**
* \brief A variable to control whether the return key on the soft keyboard
* should hide the soft keyboard on Android and iOS.
*
@@ -1269,7 +1528,7 @@ extern "C" {
* disabled. You should use a string that describes what your program is doing
* (and, therefore, why the screensaver is disabled). For example, "Playing a
* game" or "Watching a video".
*
*
* Setting this to "" or leaving it unset will have SDL use a reasonable
* default: "Playing a game" or something similar.
*
@@ -1283,13 +1542,13 @@ extern "C" {
* On some platforms, like Linux, a realtime priority thread may be subject to restrictions
* that require special handling by the application. This hint exists to let SDL know that
* the app is prepared to handle said restrictions.
*
*
* On Linux, SDL will apply the following configuration to any thread that becomes realtime:
* * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy,
* * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit.
* * Exceeding this limit will result in the kernel sending SIGKILL to the app,
* * Refer to the man pages for more information.
*
*
* This variable can be set to the following values:
* "0" - default platform specific behaviour
* "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy
@@ -1377,7 +1636,7 @@ extern "C" {
#define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK"
/**
* \brief A variable controlling whether the screensaver is enabled.
* \brief A variable controlling whether the screensaver is enabled.
*
* This variable can be set to the following values:
* "0" - Disable screensaver
@@ -1390,7 +1649,7 @@ extern "C" {
/**
* \brief Tell the video driver that we only want a double buffer.
*
* By default, most lowlevel 2D APIs will use a triple buffer scheme that
* By default, most lowlevel 2D APIs will use a triple buffer scheme that
* wastes no CPU time on waiting for vsync after issuing a flip, but
* introduces a frame of latency. On the other hand, using a double buffer
* scheme instead is recommended for cases where low latency is an important
@@ -1450,9 +1709,7 @@ extern "C" {
* SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
* button on their titlebars).
*
* The default value is "1". Spaces are disabled regardless of this hint if
* the OS isn't at least Mac OS X Lion (10.7). This hint must be set before
* any windows are created.
* The default value is "1". This hint must be set before any windows are created.
*/
#define SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
@@ -1489,11 +1746,43 @@ extern "C" {
*/
#define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
/**
* \brief A variable controlling whether video mode emulation is enabled under Wayland.
*
* When this hint is set, a standard set of emulated CVT video modes will be exposed for use by the application.
* If it is disabled, the only modes exposed will be the logical desktop size and, in the case of a scaled
* desktop, the native display resolution.
*
* This variable can be set to the following values:
* "0" - Video mode emulation is disabled.
* "1" - Video mode emulation is enabled.
*
* By default video mode emulation is enabled.
*/
#define SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION "SDL_VIDEO_WAYLAND_MODE_EMULATION"
/**
* \brief Enable or disable mouse pointer warp emulation, needed by some older games.
*
* When this hint is set, any SDL will emulate mouse warps using relative mouse mode.
* This is required for some older games (such as Source engine games), which warp the
* mouse to the centre of the screen rather than using relative mouse motion. Note that
* relative mouse mode may have different mouse acceleration behaviour than pointer warps.
*
* This variable can be set to the following values:
* "0" - All mouse warps fail, as mouse warping is not available under wayland.
* "1" - Some mouse warps will be emulated by forcing relative mouse mode.
*
* If not set, this is automatically enabled unless an application uses relative mouse
* mode directly.
*/
#define SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP "SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"
/**
* \brief A variable that is the address of another SDL_Window* (as a hex string formatted with "%p").
*
*
* If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
* SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the newly
* created SDL_Window:
*
* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
@@ -1559,13 +1848,13 @@ extern "C" {
/**
* \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
*
*
* This variable can be set to the following values:
* "0" - Disable _NET_WM_BYPASS_COMPOSITOR
* "1" - Enable _NET_WM_BYPASS_COMPOSITOR
*
*
* By default SDL will use _NET_WM_BYPASS_COMPOSITOR
*
*
*/
#define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
@@ -1590,13 +1879,11 @@ extern "C" {
#define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
/**
* \brief A variable controlling whether the X11 Xinerama extension should be used.
* \brief A no-longer-used variable controlling whether the X11 Xinerama extension should be used.
*
* This variable can be set to the following values:
* "0" - Disable Xinerama
* "1" - Enable Xinerama
*
* By default SDL will use Xinerama if it is available.
* Before SDL 2.0.24, this would let apps and users disable Xinerama support on X11.
* Now SDL never uses Xinerama, and does not check for this hint at all.
* The preprocessor define is left here for source compatibility.
*/
#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA"
@@ -1607,18 +1894,16 @@ extern "C" {
* "0" - Disable XRandR
* "1" - Enable XRandR
*
* By default SDL will not use XRandR because of window manager issues.
* By default SDL will use XRandR.
*/
#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
/**
* \brief A variable controlling whether the X11 VidMode extension should be used.
* \brief A no-longer-used variable controlling whether the X11 VidMode extension should be used.
*
* This variable can be set to the following values:
* "0" - Disable XVidMode
* "1" - Enable XVidMode
*
* By default SDL will use XVidMode if it is available.
* Before SDL 2.0.24, this would let apps and users disable XVidMode support on X11.
* Now SDL never uses XVidMode, and does not check for this hint at all.
* The preprocessor define is left here for source compatibility.
*/
#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE"
@@ -1703,7 +1988,29 @@ extern "C" {
#define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
/**
* \brief A variable controlling whether the windows message loop is processed by SDL
* \brief Controls whether menus can be opened with their keyboard shortcut (Alt+mnemonic).
*
* If the mnemonics are enabled, then menus can be opened by pressing the Alt
* key and the corresponding mnemonic (for example, Alt+F opens the File menu).
* However, in case an invalid mnemonic is pressed, Windows makes an audible
* beep to convey that nothing happened. This is true even if the window has
* no menu at all!
*
* Because most SDL applications don't have menus, and some want to use the Alt
* key for other purposes, SDL disables mnemonics (and the beeping) by default.
*
* Note: This also affects keyboard events: with mnemonics enabled, when a
* menu is opened from the keyboard, you will not receive a KEYUP event for
* the mnemonic key, and *might* not receive one for Alt.
*
* This variable can be set to the following values:
* "0" - Alt+mnemonic does nothing, no beeping. (default)
* "1" - Alt+mnemonic opens menus, invalid mnemonics produce a beep.
*/
#define SDL_HINT_WINDOWS_ENABLE_MENU_MNEMONICS "SDL_WINDOWS_ENABLE_MENU_MNEMONICS"
/**
* \brief A variable controlling whether the windows message loop is processed by SDL
*
* This variable can be set to the following values:
* "0" - The window message loop is not run
@@ -1744,7 +2051,7 @@ extern "C" {
#define SDL_HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
/**
* \brief A variable to specify custom icon resource id from RC file on Windows platform
* \brief A variable to specify custom icon resource id from RC file on Windows platform
*/
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON "SDL_WINDOWS_INTRESOURCE_ICON"
#define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
@@ -1779,7 +2086,58 @@ extern "C" {
#define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX"
/**
* \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
* \brief Controls whether SDL will declare the process to be DPI aware.
*
* This hint must be set before initializing the video subsystem.
*
* The main purpose of declaring DPI awareness is to disable OS bitmap scaling of SDL windows on monitors with
* a DPI scale factor.
*
* This hint is equivalent to requesting DPI awareness via external means (e.g. calling SetProcessDpiAwarenessContext)
* and does not cause SDL to use a virtualized coordinate system, so it will generally give you 1 SDL coordinate = 1 pixel
* even on high-DPI displays.
*
* For more information, see:
* https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows
*
* This variable can be set to the following values:
* "" - Do not change the DPI awareness (default).
* "unaware" - Declare the process as DPI unaware. (Windows 8.1 and later).
* "system" - Request system DPI awareness. (Vista and later).
* "permonitor" - Request per-monitor DPI awareness. (Windows 8.1 and later).
* "permonitorv2" - Request per-monitor V2 DPI awareness. (Windows 10, version 1607 and later).
* The most visible difference from "permonitor" is that window title bar will be scaled
* to the visually correct size when dragging between monitors with different scale factors.
* This is the preferred DPI awareness level.
*
* If the requested DPI awareness is not available on the currently running OS, SDL will try to request the best
* available match.
*/
#define SDL_HINT_WINDOWS_DPI_AWARENESS "SDL_WINDOWS_DPI_AWARENESS"
/**
* \brief Uses DPI-scaled points as the SDL coordinate system on Windows.
*
* This changes the SDL coordinate system units to be DPI-scaled points, rather than pixels everywhere.
* This means windows will be appropriately sized, even when created on high-DPI displays with scaling.
*
* e.g. requesting a 640x480 window from SDL, on a display with 125% scaling in Windows display settings,
* will create a window with an 800x600 client area (in pixels).
*
* Setting this to "1" implicitly requests process DPI awareness (setting SDL_WINDOWS_DPI_AWARENESS is unnecessary),
* and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows.
*
* This variable can be set to the following values:
* "0" - SDL coordinates equal Windows coordinates. No automatic window resizing when dragging
* between monitors with different scale factors (unless this is performed by
* Windows itself, which is the case when the process is DPI unaware).
* "1" - SDL coordinates are in DPI-scaled points. Automatically resize windows as needed on
* displays with non-100% scale factors.
*/
#define SDL_HINT_WINDOWS_DPI_SCALING "SDL_WINDOWS_DPI_SCALING"
/**
* \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
*
* This variable can be set to the following values:
* "0" - The window frame is not interactive when the cursor is hidden (no move, resize, etc)
@@ -1790,7 +2148,7 @@ extern "C" {
#define SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
/**
* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called
* \brief A variable controlling whether the window is activated when the SDL_ShowWindow function is called
*
* This variable can be set to the following values:
* "0" - The window is activated when the SDL_ShowWindow function is called
@@ -1920,6 +2278,15 @@ extern "C" {
*/
#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED"
/**
* \brief A variable that lets you disable the detection and use of DirectInput gamepad devices
*
* The variable can be set to the following values:
* "0" - Disable DirectInput detection (only uses XInput)
* "1" - Enable DirectInput detection (the default)
*/
#define SDL_HINT_DIRECTINPUT_ENABLED "SDL_DIRECTINPUT_ENABLED"
/**
* \brief A variable that causes SDL to use the old axis and button mapping for XInput devices.
*
@@ -2039,6 +2406,42 @@ extern "C" {
*/
#define SDL_HINT_AUDIODRIVER "SDL_AUDIODRIVER"
/**
* \brief A variable that decides what KMSDRM device to use.
*
* Internally, SDL might open something like "/dev/dri/cardNN" to
* access KMSDRM functionality, where "NN" is a device index number.
*
* SDL makes a guess at the best index to use (usually zero), but the
* app or user can set this hint to a number between 0 and 99 to
* force selection.
*
* This hint is available since SDL 2.24.0.
*/
#define SDL_HINT_KMSDRM_DEVICE_INDEX "SDL_KMSDRM_DEVICE_INDEX"
/**
* \brief A variable that treats trackpads as touch devices.
*
* On macOS (and possibly other platforms in the future), SDL will report
* touches on a trackpad as mouse input, which is generally what users
* expect from this device; however, these are often actually full
* multitouch-capable touch devices, so it might be preferable to some apps
* to treat them as such.
*
* Setting this hint to true will make the trackpad input report as a
* multitouch device instead of a mouse. The default is false.
*
* Note that most platforms don't support this hint. As of 2.24.0, it
* only supports MacBooks' trackpads on macOS. Others may follow later.
*
* This hint is checked during SDL_Init and can not be changed after.
*
* This hint is available since SDL 2.24.0.
*/
#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY"
/**
* \brief An enumeration of hint priorities
@@ -2091,6 +2494,38 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
const char *value);
/**
* Reset a hint to the default value.
*
* This will reset a hint to the value of the environment variable, or NULL if
* the environment isn't set. Callbacks will be called normally with this
* change.
*
* \param name the hint to set
* \returns SDL_TRUE if the hint was set, SDL_FALSE otherwise.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GetHint
* \sa SDL_SetHint
*/
extern DECLSPEC SDL_bool SDLCALL SDL_ResetHint(const char *name);
/**
* Reset all hints to the default values.
*
* This will reset all hints to the value of the associated environment
* variable, or NULL if the environment isn't set. Callbacks will be called
* normally with this change.
*
* \since This function is available since SDL 2.26.0.
*
* \sa SDL_GetHint
* \sa SDL_SetHint
* \sa SDL_ResetHint
*/
extern DECLSPEC void SDLCALL SDL_ResetHints(void);
/**
* Get the value of a hint.
*
@@ -2164,9 +2599,16 @@ extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
/**
* Clear all hints.
*
* This function is automatically called during SDL_Quit().
* This function is automatically called during SDL_Quit(), and deletes all
* callbacks without calling them and frees all memory associated with hints.
* If you're calling this from application code you probably want to call
* SDL_ResetHints() instead.
*
* This function will be removed from the API the next time we rev the ABI.
*
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_ResetHints
*/
extern DECLSPEC void SDLCALL SDL_ClearHints(void);
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -43,6 +43,8 @@
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_guid.h"
#include "SDL_mutex.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
@@ -65,13 +67,14 @@ extern "C" {
/**
* The joystick structure used to identify an SDL joystick
*/
#ifdef SDL_THREAD_SAFETY_ANALYSIS
extern SDL_mutex *SDL_joystick_lock;
#endif
struct _SDL_Joystick;
typedef struct _SDL_Joystick SDL_Joystick;
/* A structure that encodes the stable unique id for a joystick device */
typedef struct {
Uint8 data[16];
} SDL_JoystickGUID;
typedef SDL_GUID SDL_JoystickGUID;
/**
* This is a unique ID for a joystick for the time it is connected to the system,
@@ -125,9 +128,14 @@ typedef enum
* the API functions that take a joystick index will be valid, and joystick
* and game controller events will not be delivered.
*
* As of SDL 2.26.0, you can take the joystick lock around reinitializing the
* joystick subsystem, to prevent other threads from seeing joysticks in an
* uninitialized state. However, all open joysticks will be closed and SDL
* functions called with them will fail.
*
* \since This function is available since SDL 2.0.7.
*/
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
extern DECLSPEC void SDLCALL SDL_LockJoysticks(void) SDL_ACQUIRE(SDL_joystick_lock);
/**
@@ -142,7 +150,7 @@ extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
*
* \since This function is available since SDL 2.0.7.
*/
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void) SDL_RELEASE(SDL_joystick_lock);
/**
* Count the number of joysticks attached to the system.
@@ -153,6 +161,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_JoystickName
* \sa SDL_JoystickPath
* \sa SDL_JoystickOpen
*/
extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
@@ -174,6 +183,23 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
*/
extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
/**
* Get the implementation dependent path of a joystick.
*
* This can be called before any joysticks are opened.
*
* \param device_index the index of the joystick to query (the N'th joystick
* on the system)
* \returns the path of the selected joystick. If no path can be found, this
* function returns NULL; call SDL_GetError() for more information.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_JoystickPath
* \sa SDL_JoystickOpen
*/
extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
/**
* Get the player index of a joystick, or -1 if it's not available This can be
* called before any joysticks are opened.
@@ -262,13 +288,12 @@ extern DECLSPEC SDL_JoystickType SDLCALL SDL_JoystickGetDeviceType(int device_in
/**
* Get the instance ID of a joystick.
*
* This can be called before any joysticks are opened. If the index is out of
* range, this function will return -1.
* This can be called before any joysticks are opened.
*
* \param device_index the index of the joystick to query (the N'th joystick
* on the system
* \returns the instance id of the selected joystick. If called on an invalid
* index, this function returns zero
* index, this function returns -1.
*
* \since This function is available since SDL 2.0.6.
*/
@@ -330,6 +355,54 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
int nbuttons,
int nhats);
/**
* The structure that defines an extended virtual joystick description
*
* The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx()
* All other elements of this structure are optional and can be left 0.
*
* \sa SDL_JoystickAttachVirtualEx
*/
typedef struct SDL_VirtualJoystickDesc
{
Uint16 version; /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */
Uint16 type; /**< `SDL_JoystickType` */
Uint16 naxes; /**< the number of axes on this joystick */
Uint16 nbuttons; /**< the number of buttons on this joystick */
Uint16 nhats; /**< the number of hats on this joystick */
Uint16 vendor_id; /**< the USB vendor ID of this joystick */
Uint16 product_id; /**< the USB product ID of this joystick */
Uint16 padding; /**< unused */
Uint32 button_mask; /**< A mask of which buttons are valid for this controller
e.g. (1 << SDL_CONTROLLER_BUTTON_A) */
Uint32 axis_mask; /**< A mask of which axes are valid for this controller
e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */
const char *name; /**< the name of the joystick */
void *userdata; /**< User data pointer passed to callbacks */
void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */
int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */
int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */
int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */
} SDL_VirtualJoystickDesc;
/**
* \brief The current version of the SDL_VirtualJoystickDesc structure
*/
#define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1
/**
* Attach a new virtual joystick with extended properties.
*
* \returns the joystick's device index, or -1 if an error occurred.
*
* \since This function is available since SDL 2.24.0.
*/
extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc);
/**
* Detach a virtual joystick.
*
@@ -360,6 +433,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
* the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
* SDL_WaitEvent.
*
* Note that when sending trigger axes, you should scale the value to the full
* range of Sint16. For example, a trigger at rest would have the value of
* `SDL_JOYSTICK_AXIS_MIN`.
*
* \param joystick the virtual joystick on which to set state.
* \param axis the specific axis on the virtual joystick to set.
* \param value the new value for the specified axis.
@@ -419,6 +496,19 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in
*/
extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
/**
* Get the implementation dependent path of a joystick.
*
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
* \returns the path of the selected joystick. If no path can be found, this
* function returns NULL; call SDL_GetError() for more information.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_JoystickPathForIndex
*/
extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick);
/**
* Get the player index of an opened joystick.
*
@@ -436,7 +526,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
* Set the player index of an opened joystick.
*
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
* \param player_index the player index to set.
* \param player_index Player index to assign to this joystick, or -1 to clear
* the player index and turn off player LEDs.
*
* \since This function is available since SDL 2.0.12.
*/
@@ -495,6 +586,19 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
*/
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
/**
* Get the firmware version of an opened joystick, if available.
*
* If the firmware version isn't available this function returns 0.
*
* \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
* \returns the firmware version of the selected joystick, or 0 if
* unavailable.
*
* \since This function is available since SDL 2.24.0.
*/
extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick);
/**
* Get the serial number of an opened joystick, if available.
*
@@ -551,6 +655,25 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
*/
extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
/**
* Get the device information encoded in a SDL_JoystickGUID structure
*
* \param guid the SDL_JoystickGUID you wish to get info about
* \param vendor A pointer filled in with the device VID, or 0 if not
* available
* \param product A pointer filled in with the device PID, or 0 if not
* available
* \param version A pointer filled in with the device version, or 0 if not
* available
* \param crc16 A pointer filled in with a CRC used to distinguish different
* products with the same VID/PID, or 0 if not available
*
* \since This function is available since SDL 2.26.0.
*
* \sa SDL_JoystickGetDeviceGUID
*/
extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
/**
* Get the status of a specified joystick.
*
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -90,9 +90,21 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
* \since This function is available since SDL 2.0.0.
*
* \sa SDL_PumpEvents
* \sa SDL_ResetKeyboard
*/
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
/**
* Clear the state of the keyboard
*
* This function will generate key up events for all pressed keys.
*
* \since This function is available since SDL 2.24.0.
*
* \sa SDL_GetKeyboardState
*/
extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
/**
* Get the current key modifier state for the keyboard.
*
@@ -288,7 +300,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
/**
* Set the rectangle used to type Unicode text inputs.
*
* Note: If you want use system native IME window, try to set hint
* To start text input in a given location, this function is intended to be
* called before SDL_StartTextInput, although some platforms support moving
* the rectangle even while text input (and a composition) is active.
*
* Note: If you want to use the system native IME window, try setting hint
* **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you
* any feedback.
*
@@ -299,7 +315,7 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
*
* \sa SDL_StartTextInput
*/
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
/**
* Check whether the platform has screen keyboard support.
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -40,7 +40,7 @@
* an SDLK_* constant for those keys that do not generate characters.
*
* A special exception is the number keys at the top of the keyboard which
* always map to SDLK_0...SDLK_9, regardless of layout.
* map to SDLK_0...SDLK_9 on AZERTY layouts.
*/
typedef Sint32 SDL_Keycode;
@@ -318,7 +318,12 @@ typedef enum
SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD),
SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT),
SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
} SDL_KeyCode;
/**
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -47,9 +47,9 @@ extern "C" {
/**
* \brief The maximum size of a log message
* \brief The maximum size of a log message prior to SDL 2.0.24
*
* Messages longer than the maximum size will be truncated
* As of 2.0.24 there is no limit to the length of SDL log messages.
*/
#define SDL_MAX_LOG_MESSAGE 4096
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -51,6 +51,15 @@
*/
#define SDL_MAIN_NEEDED
#elif defined(__GDK__)
/* On GDK, SDL provides a main function that initializes the game runtime.
Please note that #include'ing SDL_main.h is not enough to get a main()
function working. You must either link against SDL2main or, if not possible,
call the SDL_GDKRunApp function from your entry point.
*/
#define SDL_MAIN_NEEDED
#elif defined(__IPHONEOS__)
/* On iOS SDL provides a main function that creates an application delegate
and starts the iOS application run loop.
@@ -92,6 +101,22 @@
*/
#define SDL_MAIN_AVAILABLE
#elif defined(__PS2__)
#define SDL_MAIN_AVAILABLE
#define SDL_PS2_SKIP_IOP_RESET() \
void reset_IOP(); \
void reset_IOP() {}
#elif defined(__3DS__)
/*
On N3DS, SDL provides a main function that sets up the screens
and storage.
If you provide this yourself, you may define SDL_MAIN_HANDLED
*/
#define SDL_MAIN_AVAILABLE
#endif
#endif /* SDL_MAIN_HANDLED */
@@ -145,7 +170,7 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
*/
extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
#ifdef __WIN32__
#if defined(__WIN32__) || defined(__GDK__)
/**
* Register a win32 window class for SDL's use.
@@ -189,7 +214,7 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
*/
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
#endif /* __WIN32__ */
#endif /* defined(__WIN32__) || defined(__GDK__) */
#ifdef __WINRT__
@@ -224,6 +249,28 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
#endif /* __IPHONEOS__ */
#ifdef __GDK__
/**
* Initialize and launch an SDL GDK application.
*
* \param mainFunction the SDL app's C-style main(), an SDL_main_func
* \param reserved reserved for future use; should be NULL
* \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
* more information on the failure.
*
* \since This function is available since SDL 2.24.0.
*/
extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
/**
* Callback from the application to let the suspend continue.
*
* \since This function is available since SDL 2.28.0.
*/
extern DECLSPEC void SDLCALL SDL_GDKSuspendComplete(void);
#endif /* __GDK__ */
#ifdef __cplusplus
}
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -82,7 +82,7 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
*
* \since This function is available since SDL 2.0.14.
*
* \sa SDL_MetalCreateView
* \sa SDL_Metal_CreateView
*/
extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -154,7 +154,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
/**
* Move the mouse cursor to the given position within the window.
*
* This function generates a mouse motion event.
* This function generates a mouse motion event if relative mode is not
* enabled. If relative mode is enabled, you can force mouse events for the
* warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
*
* Note that this function will appear to succeed, but not actually move the
* mouse when used over Microsoft Remote Desktop.
@@ -196,13 +198,9 @@ extern DECLSPEC int SDLCALL SDL_WarpMouseGlobal(int x, int y);
/**
* Set relative mouse mode.
*
* While the mouse is in relative mode, the cursor is hidden, and the driver
* will try to report continuous motion in the current window. Only relative
* motion events will be delivered, the mouse position will not change.
*
* Note that this function will not be able to provide continuous relative
* motion when used over Microsoft Remote Desktop, instead motion is limited
* to the bounds of the screen.
* While the mouse is in relative mode, the cursor is hidden, the mouse
* position is constrained to the window, and SDL will report continuous
* relative mouse motion even if the mouse is at the edge of the window.
*
* This function will flush any pending mouse motion.
*
@@ -245,6 +243,15 @@ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
* While capturing is enabled, the current window will have the
* `SDL_WINDOW_MOUSE_CAPTURE` flag set.
*
* Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the
* mouse while the user is pressing a button; this is to try and make mouse
* behavior more consistent between platforms, and deal with the common case
* of a user dragging the mouse outside of the window. This means that if you
* are calling SDL_CaptureMouse() only to deal with this situation, you no
* longer have to (although it is safe to do so). If this causes problems for
* your app, you can disable auto capture by setting the
* `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
*
* \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
* \returns 0 on success or -1 if not supported; call SDL_GetError() for more
* information.
@@ -378,6 +385,9 @@ extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void);
/**
* Get the default cursor.
*
* You do not have to call SDL_FreeCursor() on the return value, but it is
* safe to do so.
*
* \returns the default cursor on success or NULL on failure.
*
* \since This function is available since SDL 2.0.0.
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -31,6 +31,80 @@
#include "SDL_stdinc.h"
#include "SDL_error.h"
/******************************************************************************/
/* Enable thread safety attributes only with clang.
* The attributes can be safely erased when compiling with other compilers.
*/
#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
defined(__clang__) && (!defined(SWIG))
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x))
#else
#define SDL_THREAD_ANNOTATION_ATTRIBUTE__(x) /* no-op */
#endif
#define SDL_CAPABILITY(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(capability(x))
#define SDL_SCOPED_CAPABILITY \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable)
#define SDL_GUARDED_BY(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x))
#define SDL_PT_GUARDED_BY(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x))
#define SDL_ACQUIRED_BEFORE(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(x))
#define SDL_ACQUIRED_AFTER(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(x))
#define SDL_REQUIRES(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(x))
#define SDL_REQUIRES_SHARED(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(x))
#define SDL_ACQUIRE(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_capability(x))
#define SDL_ACQUIRE_SHARED(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(acquire_shared_capability(x))
#define SDL_RELEASE(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_capability(x))
#define SDL_RELEASE_SHARED(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_shared_capability(x))
#define SDL_RELEASE_GENERIC(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(release_generic_capability(x))
#define SDL_TRY_ACQUIRE(x, y) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_capability(x, y))
#define SDL_TRY_ACQUIRE_SHARED(x, y) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(try_acquire_shared_capability(x, y))
#define SDL_EXCLUDES(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(x))
#define SDL_ASSERT_CAPABILITY(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_capability(x))
#define SDL_ASSERT_SHARED_CAPABILITY(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_capability(x))
#define SDL_RETURN_CAPABILITY(x) \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x))
#define SDL_NO_THREAD_SAFETY_ANALYSIS \
SDL_THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis)
/******************************************************************************/
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
@@ -96,7 +170,7 @@ extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void);
*
* \since This function is available since SDL 2.0.0.
*/
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex) SDL_ACQUIRE(mutex);
#define SDL_mutexP(m) SDL_LockMutex(m)
/**
@@ -119,7 +193,7 @@ extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex);
* \sa SDL_LockMutex
* \sa SDL_UnlockMutex
*/
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex) SDL_TRY_ACQUIRE(0, mutex);
/**
* Unlock the mutex.
@@ -138,7 +212,7 @@ extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex);
*
* \since This function is available since SDL 2.0.0.
*/
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex) SDL_RELEASE(mutex);
#define SDL_mutexV(m) SDL_UnlockMutex(m)
/**
@@ -276,7 +350,7 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
* successful it will atomically decrement the semaphore value.
*
* \param sem the semaphore to wait on
* \param ms the length of the timeout, in milliseconds
* \param timeout the length of the timeout, in milliseconds
* \returns 0 if the wait succeeds, `SDL_MUTEX_TIMEDOUT` if the wait does not
* succeed in the allotted time, or a negative error code on failure;
* call SDL_GetError() for more information.
@@ -290,7 +364,7 @@ extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem);
* \sa SDL_SemValue
* \sa SDL_SemWait
*/
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms);
extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout);
/**
* Atomically increment a semaphore's value and wake waiting threads.
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -2107,57 +2107,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
/*
* ???. GL_MESA_packed_depth_stencil
* XXX obsolete
*/
#ifndef GL_MESA_packed_depth_stencil
#define GL_MESA_packed_depth_stencil 1
#define GL_DEPTH_STENCIL_MESA 0x8750
#define GL_UNSIGNED_INT_24_8_MESA 0x8751
#define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
#define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
#define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
#endif /* GL_MESA_packed_depth_stencil */
#ifndef GL_ATI_blend_equation_separate
#define GL_ATI_blend_equation_separate 1
#define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
#endif /* GL_ATI_blend_equation_separate */
/* GL_OES_EGL_image */
#ifndef GL_OES_EGL_image
typedef void* GLeglImageOES;
#endif
#ifndef GL_OES_EGL_image
#define GL_OES_EGL_image 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
#endif
typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
/**
** NOTE!!!!! If you add new functions to this file, or update
** glext.h be sure to regenerate the gl_mangle.h file. See comments
** in that file for details.
**/
/**********************************************************************
* Begin system-specific stuff
*/
File diff suppressed because it is too large. Load diff
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,6 +1,6 @@
/*
Simple DirectMedia Layer
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -1,56 +1,70 @@
#ifndef __gl2_h_
#define __gl2_h_
/* $Revision: 20555 $ on $Date:: 2013-02-12 14:32:47 -0800 #$ */
/*#include <GLES2/gl2platform.h>*/
#ifndef __gles2_gl2_h_
#define __gles2_gl2_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
** Copyright 2013-2020 The Khronos Group Inc.
** SPDX-License-Identifier: MIT
**
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** https://github.com/KhronosGroup/OpenGL-Registry
*/
/*#include <GLES2/gl2platform.h>*/
#ifndef GL_APIENTRYP
#define GL_APIENTRYP GL_APIENTRY*
#endif
#ifndef GL_GLES_PROTOTYPES
#define GL_GLES_PROTOTYPES 1
#endif
/* Generated on date 20220530 */
/* Generated C header for:
* API: gles2
* Profile: common
* Versions considered: 2\.[0-9]
* Versions emitted: .*
* Default extensions included: None
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
/*-------------------------------------------------------------------------
* Data type definitions
*-----------------------------------------------------------------------*/
typedef void GLvoid;
typedef char GLchar;
typedef unsigned int GLenum;
typedef unsigned char GLboolean;
typedef unsigned int GLbitfield;
typedef khronos_int8_t GLbyte;
typedef short GLshort;
typedef int GLint;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
typedef unsigned short GLushort;
typedef unsigned int GLuint;
typedef khronos_float_t GLfloat;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
/* GL types for handling large vertex buffer objects */
#ifndef GL_ES_VERSION_2_0
#define GL_ES_VERSION_2_0 1
/*#include <KHR/khrplatform.h>*/
typedef khronos_int8_t GLbyte;
typedef khronos_float_t GLclampf;
typedef khronos_int32_t GLfixed;
typedef khronos_int16_t GLshort;
typedef khronos_uint16_t GLushort;
typedef void GLvoid;
typedef struct __GLsync *GLsync;
typedef khronos_int64_t GLint64;
typedef khronos_uint64_t GLuint64;
typedef unsigned int GLenum;
typedef unsigned int GLuint;
typedef char GLchar;
typedef khronos_float_t GLfloat;
typedef khronos_ssize_t GLsizeiptr;
typedef khronos_intptr_t GLintptr;
typedef khronos_ssize_t GLsizeiptr;
/* OpenGL ES core versions */
#define GL_ES_VERSION_2_0 1
/* ClearBufferMask */
typedef unsigned int GLbitfield;
typedef int GLint;
typedef unsigned char GLboolean;
typedef int GLsizei;
typedef khronos_uint8_t GLubyte;
#define GL_DEPTH_BUFFER_BIT 0x00000100
#define GL_STENCIL_BUFFER_BIT 0x00000400
#define GL_COLOR_BUFFER_BIT 0x00004000
/* Boolean */
#define GL_FALSE 0
#define GL_TRUE 1
/* BeginMode */
#define GL_POINTS 0x0000
#define GL_LINES 0x0001
#define GL_LINE_LOOP 0x0002
@@ -58,18 +72,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_TRIANGLES 0x0004
#define GL_TRIANGLE_STRIP 0x0005
#define GL_TRIANGLE_FAN 0x0006
/* AlphaFunction (not supported in ES20) */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* BlendingFactorDest */
#define GL_ZERO 0
#define GL_ONE 1
#define GL_SRC_COLOR 0x0300
@@ -78,29 +80,15 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
#define GL_DST_ALPHA 0x0304
#define GL_ONE_MINUS_DST_ALPHA 0x0305
/* BlendingFactorSrc */
/* GL_ZERO */
/* GL_ONE */
#define GL_DST_COLOR 0x0306
#define GL_ONE_MINUS_DST_COLOR 0x0307
#define GL_SRC_ALPHA_SATURATE 0x0308
/* GL_SRC_ALPHA */
/* GL_ONE_MINUS_SRC_ALPHA */
/* GL_DST_ALPHA */
/* GL_ONE_MINUS_DST_ALPHA */
/* BlendEquationSeparate */
#define GL_FUNC_ADD 0x8006
#define GL_BLEND_EQUATION 0x8009
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
#define GL_BLEND_EQUATION_RGB 0x8009
#define GL_BLEND_EQUATION_ALPHA 0x883D
/* BlendSubtract */
#define GL_FUNC_SUBTRACT 0x800A
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
/* Separate Blend Functions */
#define GL_BLEND_DST_RGB 0x80C8
#define GL_BLEND_SRC_RGB 0x80C9
#define GL_BLEND_DST_ALPHA 0x80CA
@@ -110,38 +98,19 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_CONSTANT_ALPHA 0x8003
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
#define GL_BLEND_COLOR 0x8005
/* Buffer Objects */
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_ARRAY_BUFFER_BINDING 0x8894
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
#define GL_STREAM_DRAW 0x88E0
#define GL_STATIC_DRAW 0x88E4
#define GL_DYNAMIC_DRAW 0x88E8
#define GL_BUFFER_SIZE 0x8764
#define GL_BUFFER_USAGE 0x8765
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
/* CullFaceMode */
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
#define GL_FRONT_AND_BACK 0x0408
/* DepthFunction */
/* GL_NEVER */
/* GL_LESS */
/* GL_EQUAL */
/* GL_LEQUAL */
/* GL_GREATER */
/* GL_NOTEQUAL */
/* GL_GEQUAL */
/* GL_ALWAYS */
/* EnableCap */
#define GL_TEXTURE_2D 0x0DE1
#define GL_CULL_FACE 0x0B44
#define GL_BLEND 0x0BE2
@@ -152,19 +121,13 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_POLYGON_OFFSET_FILL 0x8037
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
#define GL_SAMPLE_COVERAGE 0x80A0
/* ErrorCode */
#define GL_NO_ERROR 0
#define GL_INVALID_ENUM 0x0500
#define GL_INVALID_VALUE 0x0501
#define GL_INVALID_OPERATION 0x0502
#define GL_OUT_OF_MEMORY 0x0505
/* FrontFaceDirection */
#define GL_CW 0x0900
#define GL_CCW 0x0901
/* GetPName */
#define GL_LINE_WIDTH 0x0B21
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
@@ -191,7 +154,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
#define GL_VIEWPORT 0x0BA2
#define GL_SCISSOR_BOX 0x0C10
/* GL_SCISSOR_TEST */
#define GL_COLOR_CLEAR_VALUE 0x0C22
#define GL_COLOR_WRITEMASK 0x0C23
#define GL_UNPACK_ALIGNMENT 0x0CF5
@@ -206,32 +168,18 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_DEPTH_BITS 0x0D56
#define GL_STENCIL_BITS 0x0D57
#define GL_POLYGON_OFFSET_UNITS 0x2A00
/* GL_POLYGON_OFFSET_FILL */
#define GL_POLYGON_OFFSET_FACTOR 0x8038
#define GL_TEXTURE_BINDING_2D 0x8069
#define GL_SAMPLE_BUFFERS 0x80A8
#define GL_SAMPLES 0x80A9
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
/* GetTextureParameter */
/* GL_TEXTURE_MAG_FILTER */
/* GL_TEXTURE_MIN_FILTER */
/* GL_TEXTURE_WRAP_S */
/* GL_TEXTURE_WRAP_T */
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
/* HintMode */
#define GL_DONT_CARE 0x1100
#define GL_FASTEST 0x1101
#define GL_NICEST 0x1102
/* HintTarget */
#define GL_GENERATE_MIPMAP_HINT 0x8192
/* DataType */
#define GL_GENERATE_MIPMAP_HINT 0x8192
#define GL_BYTE 0x1400
#define GL_UNSIGNED_BYTE 0x1401
#define GL_SHORT 0x1402
@@ -240,44 +188,35 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_UNSIGNED_INT 0x1405
#define GL_FLOAT 0x1406
#define GL_FIXED 0x140C
/* PixelFormat */
#define GL_DEPTH_COMPONENT 0x1902
#define GL_ALPHA 0x1906
#define GL_RGB 0x1907
#define GL_RGBA 0x1908
#define GL_LUMINANCE 0x1909
#define GL_LUMINANCE_ALPHA 0x190A
/* PixelType */
/* GL_UNSIGNED_BYTE */
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
/* Shaders */
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_FRAGMENT_SHADER 0x8B30
#define GL_VERTEX_SHADER 0x8B31
#define GL_MAX_VERTEX_ATTRIBS 0x8869
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
#define GL_MAX_VARYING_VECTORS 0x8DFC
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
/* StencilFunction */
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
#define GL_SHADER_TYPE 0x8B4F
#define GL_DELETE_STATUS 0x8B80
#define GL_LINK_STATUS 0x8B82
#define GL_VALIDATE_STATUS 0x8B83
#define GL_ATTACHED_SHADERS 0x8B85
#define GL_ACTIVE_UNIFORMS 0x8B86
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
#define GL_ACTIVE_ATTRIBUTES 0x8B89
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
#define GL_CURRENT_PROGRAM 0x8B8D
#define GL_NEVER 0x0200
#define GL_LESS 0x0201
#define GL_EQUAL 0x0202
@@ -286,9 +225,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_NOTEQUAL 0x0205
#define GL_GEQUAL 0x0206
#define GL_ALWAYS 0x0207
/* StencilOp */
/* GL_ZERO */
#define GL_KEEP 0x1E00
#define GL_REPLACE 0x1E01
#define GL_INCR 0x1E02
@@ -296,35 +232,21 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_INVERT 0x150A
#define GL_INCR_WRAP 0x8507
#define GL_DECR_WRAP 0x8508
/* StringName */
#define GL_VENDOR 0x1F00
#define GL_RENDERER 0x1F01
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
/* TextureMagFilter */
#define GL_NEAREST 0x2600
#define GL_LINEAR 0x2601
/* TextureMinFilter */
/* GL_NEAREST */
/* GL_LINEAR */
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
/* TextureParameterName */
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
#define GL_TEXTURE_WRAP_T 0x2803
/* TextureTarget */
/* GL_TEXTURE_2D */
#define GL_TEXTURE 0x1702
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
@@ -334,8 +256,6 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
/* TextureUnit */
#define GL_TEXTURE0 0x84C0
#define GL_TEXTURE1 0x84C1
#define GL_TEXTURE2 0x84C2
@@ -369,13 +289,9 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_TEXTURE30 0x84DE
#define GL_TEXTURE31 0x84DF
#define GL_ACTIVE_TEXTURE 0x84E0
/* TextureWrapMode */
#define GL_REPEAT 0x2901
#define GL_CLAMP_TO_EDGE 0x812F
#define GL_MIRRORED_REPEAT 0x8370
/* Uniform Types */
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
#define GL_FLOAT_VEC4 0x8B52
@@ -391,48 +307,34 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_FLOAT_MAT4 0x8B5C
#define GL_SAMPLER_2D 0x8B5E
#define GL_SAMPLER_CUBE 0x8B60
/* Vertex Arrays */
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
/* Read Format */
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
/* Shader Source */
#define GL_COMPILE_STATUS 0x8B81
#define GL_INFO_LOG_LENGTH 0x8B84
#define GL_SHADER_SOURCE_LENGTH 0x8B88
#define GL_SHADER_COMPILER 0x8DFA
/* Shader Binary */
#define GL_SHADER_BINARY_FORMATS 0x8DF8
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
/* Shader Precision-Specified Types */
#define GL_LOW_FLOAT 0x8DF0
#define GL_MEDIUM_FLOAT 0x8DF1
#define GL_HIGH_FLOAT 0x8DF2
#define GL_LOW_INT 0x8DF3
#define GL_MEDIUM_INT 0x8DF4
#define GL_HIGH_INT 0x8DF5
/* Framebuffer Object. */
#define GL_FRAMEBUFFER 0x8D40
#define GL_RENDERBUFFER 0x8D41
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGB565 0x8D62
#define GL_DEPTH_COMPONENT16 0x81A5
#define GL_STENCIL_INDEX8 0x8D48
#define GL_RENDERBUFFER_WIDTH 0x8D42
#define GL_RENDERBUFFER_HEIGHT 0x8D43
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
@@ -442,180 +344,313 @@ typedef khronos_ssize_t GLsizeiptr;
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
#define GL_COLOR_ATTACHMENT0 0x8CE0
#define GL_DEPTH_ATTACHMENT 0x8D00
#define GL_STENCIL_ATTACHMENT 0x8D20
#define GL_NONE 0
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
#define GL_FRAMEBUFFER_BINDING 0x8CA6
#define GL_RENDERBUFFER_BINDING 0x8CA7
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
/*-------------------------------------------------------------------------
* GL core functions.
*-----------------------------------------------------------------------*/
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode );
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
GL_APICALL void GL_APIENTRY glFlush (void);
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* const* string, const GLint* length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
#if GL_GLES_PROTOTYPES
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
GL_APICALL void GL_APIENTRY glFinish (void);
GL_APICALL void GL_APIENTRY glFlush (void);
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
GL_APICALL GLenum GL_APIENTRY glGetError (void);
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
#endif
#endif /* GL_ES_VERSION_2_0 */
#ifdef __cplusplus
}
#endif
#endif /* __gl2_h_ */
#endif
File diff suppressed because it is too large. Load diff
@@ -1,20 +1,17 @@
#ifndef __gl2platform_h_
#define __gl2platform_h_
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
/*
* This document is licensed under the SGI Free Software B License Version
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
*/
** Copyright 2017-2020 The Khronos Group Inc.
** SPDX-License-Identifier: Apache-2.0
*/
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
* they can be included in future versions of this file. Please submit changes
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
* by filing a bug against product "OpenGL-ES" component "Registry".
* Please contribute modifications back to Khronos as pull requests on the
* public github repository:
* https://github.com/KhronosGroup/OpenGL-Registry
*/
/*#include <KHR/khrplatform.h>*/
Loaded 100 of 1434 files, more files were not shown because too many files have changed in this diff. Show more