Parcourir la source

docs: heavy editing to make this happy with latest wikibridge.

The public headers saw lots of cleanups, backporting from SDL3 docs, and
merging with the wiki.

The markdown files in docs/README-*.md were converted to Unix endlines.
Ryan C. Gordon il y a 1 an
Parent
commit
e03ad30a57
80 fichiers modifiés avec 6984 ajouts et 6136 suppressions
  1. 519 180
      build-scripts/wikiheaders.pl
  2. 483 483
      docs/README-android.md
  3. 163 163
      docs/README-cmake.md
  4. 123 123
      docs/README-directfb.md
  5. 138 138
      docs/README-dynapi.md
  6. 374 374
      docs/README-emscripten.md
  7. 176 176
      docs/README-gdk.md
  8. 71 71
      docs/README-gesture.md
  9. 19 19
      docs/README-git.md
  10. 4 4
      docs/README-hg.md
  11. 307 307
      docs/README-ios.md
  12. 27 27
      docs/README-kmsbsd.md
  13. 96 96
      docs/README-linux.md
  14. 285 285
      docs/README-macos.md
  15. 28 28
      docs/README-n3ds.md
  16. 103 103
      docs/README-nacl.md
  17. 44 44
      docs/README-ngage.md
  18. 92 92
      docs/README-os2.md
  19. 17 17
      docs/README-pandora.md
  20. 8 8
      docs/README-platforms.md
  21. 68 68
      docs/README-porting.md
  22. 51 51
      docs/README-ps2.md
  23. 36 36
      docs/README-psp.md
  24. 180 180
      docs/README-raspberrypi.md
  25. 41 41
      docs/README-riscos.md
  26. 86 86
      docs/README-touch.md
  27. 60 60
      docs/README-versions.md
  28. 114 114
      docs/README-visualc.md
  29. 33 33
      docs/README-vita.md
  30. 10 10
      docs/README-wince.md
  31. 58 58
      docs/README-windows.md
  32. 519 519
      docs/README-winrt.md
  33. 3 2
      include/SDL_atomic.h
  34. 26 22
      include/SDL_audio.h
  35. 6 0
      include/SDL_bits.h
  36. 4 3
      include/SDL_blendmode.h
  37. 39 0
      include/SDL_endian.h
  38. 86 81
      include/SDL_events.h
  39. 15 12
      include/SDL_gamecontroller.h
  40. 16 16
      include/SDL_guid.h
  41. 318 306
      include/SDL_haptic.h
  42. 3 2
      include/SDL_hidapi.h
  43. 1691 1311
      include/SDL_hints.h
  44. 12 8
      include/SDL_joystick.h
  45. 5 4
      include/SDL_keyboard.h
  46. 8 8
      include/SDL_keycode.h
  47. 7 8
      include/SDL_log.h
  48. 3 3
      include/SDL_main.h
  49. 6 4
      include/SDL_messagebox.h
  50. 2 2
      include/SDL_metal.h
  51. 5 5
      include/SDL_mouse.h
  52. 3 3
      include/SDL_mutex.h
  53. 28 4
      include/SDL_pixels.h
  54. 1 1
      include/SDL_power.h
  55. 3 3
      include/SDL_quit.h
  56. 2 2
      include/SDL_render.h
  57. 5 5
      include/SDL_rwops.h
  58. 6 6
      include/SDL_scancode.h
  59. 59 51
      include/SDL_sensor.h
  60. 9 9
      include/SDL_shape.h
  61. 27 15
      include/SDL_stdinc.h
  62. 66 64
      include/SDL_surface.h
  63. 5 5
      include/SDL_system.h
  64. 7 6
      include/SDL_syswm.h
  65. 1 1
      include/SDL_test.h
  66. 9 9
      include/SDL_test_assert.h
  67. 10 10
      include/SDL_test_common.h
  68. 2 2
      include/SDL_test_compare.h
  69. 11 11
      include/SDL_test_font.h
  70. 29 28
      include/SDL_test_fuzzer.h
  71. 5 5
      include/SDL_test_harness.h
  72. 2 2
      include/SDL_test_images.h
  73. 3 3
      include/SDL_test_log.h
  74. 4 4
      include/SDL_test_md5.h
  75. 3 3
      include/SDL_test_memory.h
  76. 4 4
      include/SDL_test_random.h
  77. 8 6
      include/SDL_thread.h
  78. 9 9
      include/SDL_timer.h
  79. 26 25
      include/SDL_version.h
  80. 49 49
      include/SDL_video.h

+ 519 - 180
build-scripts/wikiheaders.pl

@@ -2,6 +2,7 @@
 
 use warnings;
 use strict;
+use File::Path;
 use Text::Wrap;
 
 $Text::Wrap::huge = 'overflow';
@@ -31,6 +32,8 @@ my $wikipreamble = undef;
 my $wikiheaderfiletext = 'Defined in %fname%';
 my $manpageheaderfiletext = 'Defined in %fname%';
 my $changeformat = undef;
+my $manpath = undef;
+my $gitrev = undef;
 
 foreach (@ARGV) {
     $warn_about_missing = 1, next if $_ eq '--warn-about-missing';
@@ -44,6 +47,12 @@ foreach (@ARGV) {
     } elsif (/\A--changeformat=(.*)\Z/) {
         $changeformat = $1;
         next;
+    } elsif (/\A--manpath=(.*)\Z/) {
+        $manpath = $1;
+        next;
+    } elsif (/\A--rev=(.*)\Z/) {
+        $gitrev = $1;
+        next;
     }
     $srcpath = $_, next if not defined $srcpath;
     $wikipath = $_, next if not defined $wikipath;
@@ -169,6 +178,8 @@ sub wordwrap_one_paragraph {  # don't call this directly.
         if ($item ne '') {
             $retval .= wordwrap_with_bullet_indent($bullet, $item);
         }
+    } elsif ($p =~ /\A\s*\|.*\|\s*\n/) {  # Markdown table
+        $retval = "$p\n";  # don't wrap it (!!! FIXME: but maybe parse by lines until we run out of table...)
     } else {
         $retval = wordwrap_atom($p) . "\n";
     }
@@ -308,7 +319,9 @@ sub wikify {
 
     #print("WIKIFY WHOLE:\n\n$str\n\n\n");
 
-    while ($str =~ s/\A(.*?)\`\`\`(c\+\+|c)(.*?)\`\`\`//ms) {
+    # !!! FIXME: this shouldn't check language but rather if there are
+    # !!! FIXME: chars immediately after "```" to a newline.
+    while ($str =~ s/\A(.*?)\`\`\`(c\+\+|c|)(.*?)\`\`\`//ms) {
         $retval .= wikify_chunk($wikitype, $1, $2, $3);
     }
     $retval .= wikify_chunk($wikitype, $str, undef, undef);
@@ -381,8 +394,8 @@ sub dewikify_chunk {
             # <code></code> is also popular.  :/
             $str =~ s/\s*\<code>(.*?)<\/code>\s*/\n.BR $1\n/gms;
 
-            # bold+italic
-            $str =~ s/\s*'''''(.*?)'''''\s*/\n.BI $1\n/gms;
+            # bold+italic (this looks bad, just make it bold).
+            $str =~ s/\s*'''''(.*?)'''''\s*/\n.B $1\n/gms;
 
             # bold
             $str =~ s/\s*'''(.*?)'''\s*/\n.B $1\n/gms;
@@ -404,8 +417,8 @@ sub dewikify_chunk {
             # <code></code> is also popular.  :/
             $str =~ s/\s*\`(.*?)\`\s*/\n.BR $1\n/gms;
 
-            # bold+italic
-            $str =~ s/\s*\*\*\*(.*?)\*\*\*\s*/\n.BI $1\n/gms;
+            # bold+italic (this looks bad, just make it bold).
+            $str =~ s/\s*\*\*\*(.*?)\*\*\*\s*/\n.B $1\n/gms;
 
             # bold
             $str =~ s/\s*\*\*(.*?)\*\*\s*/\n.B $1\n/gms;
@@ -417,7 +430,7 @@ sub dewikify_chunk {
             $str =~ s/^\- /\n\\\(bu /gm;
 
         } else {
-            die("Unexpected wikitype when converting to manpages\n");   # !!! FIXME: need to handle Markdown wiki pages.
+            die("Unexpected wikitype when converting to manpages");   # !!! FIXME: need to handle Markdown wiki pages.
         }
 
         if (defined $code) {
@@ -431,7 +444,7 @@ sub dewikify_chunk {
             $str .= ".EX\n$code\n.EE\n.PP\n";
         }
     } else {
-        die("Unexpected dewikify_mode\n");
+        die("Unexpected dewikify_mode");
     }
 
     #print("\n\nDEWIKIFY CHUNK DONE:\n\n$str\n\n\n");
@@ -478,13 +491,17 @@ sub filecopy {
 }
 
 sub usage {
-    die("USAGE: $0 <source code git clone path> <wiki git clone path> [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing]\n\n");
+    die("USAGE: $0 <source code git clone path> <wiki git clone path> [--copy-to-headers|--copy-to-wiki|--copy-to-manpages] [--warn-about-missing] [--manpath=<man path>]\n\n");
 }
 
 usage() if not defined $srcpath;
 usage() if not defined $wikipath;
 #usage() if $copy_direction == 0;
 
+if (not defined $manpath) {
+    $manpath = "$srcpath/man";
+}
+
 my @standard_wiki_sections = (
     'Draft',
     '[Brief]',
@@ -492,12 +509,15 @@ my @standard_wiki_sections = (
     'Header File',
     'Syntax',
     'Function Parameters',
+    'Macro Parameters',
+    'Fields',
+    'Values',
     'Return Value',
     'Remarks',
     'Thread Safety',
     'Version',
     'Code Examples',
-    'Related Functions'
+    'See Also'
 );
 
 # Sections that only ever exist in the wiki and shouldn't be deleted when
@@ -510,11 +530,53 @@ my %only_wiki_sections = (  # The ones don't mean anything, I just need to check
 
 
 my %headers = ();       # $headers{"SDL_audio.h"} -> reference to an array of all lines of text in SDL_audio.h.
-my %headerfuncs = ();   # $headerfuncs{"SDL_OpenAudio"} -> string of header documentation for SDL_OpenAudio, with comment '*' bits stripped from the start. Newlines embedded!
+my %headersyms = ();   # $headersyms{"SDL_OpenAudio"} -> string of header documentation for SDL_OpenAudio, with comment '*' bits stripped from the start. Newlines embedded!
 my %headerdecls = ();
-my %headerfuncslocation = ();   # $headerfuncslocation{"SDL_OpenAudio"} -> name of header holding SDL_OpenAudio define ("SDL_audio.h" in this case).
-my %headerfuncschunk = ();   # $headerfuncschunk{"SDL_OpenAudio"} -> offset in array in %headers that should be replaced for this function.
-my %headerfuncshasdoxygen = ();   # $headerfuncschunk{"SDL_OpenAudio"} -> 1 if there was no existing doxygen for this function.
+my %headersymslocation = ();   # $headersymslocation{"SDL_OpenAudio"} -> name of header holding SDL_OpenAudio define ("SDL_audio.h" in this case).
+my %headersymschunk = ();   # $headersymschunk{"SDL_OpenAudio"} -> offset in array in %headers that should be replaced for this symbol.
+my %headersymshasdoxygen = ();   # $headersymshasdoxygen{"SDL_OpenAudio"} -> 1 if there was no existing doxygen for this function.
+my %headersymstype = ();   # $headersymstype{"SDL_OpenAudio"} -> 1 (function), 2 (macro), 3 (struct), 4 (enum), 5 (other typedef)
+
+my %wikitypes = ();  # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki'
+my %wikisyms = ();  # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikisyms{"SDL_OpenAudio"}{"Remarks"}.
+my %wikisectionorder = ();   # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
+
+sub print_undocumented_section {
+    my $fh = shift;
+    my $typestr = shift;
+    my $typeval = shift;
+
+    print $fh "## $typestr defined in the headers, but not in the wiki\n\n";
+    my $header_only_sym = 0;
+    foreach (sort keys %headersyms) {
+        my $sym = $_;
+        if ((not defined $wikisyms{$sym}) && ($headersymstype{$sym} == $typeval)) {
+            print $fh "- [$sym]($sym)\n";
+            $header_only_sym = 1;
+        }
+    }
+    if (!$header_only_sym) {
+        print $fh "(none)\n";
+    }
+    print $fh "\n";
+
+    if (0) {  # !!! FIXME: this lists things that _shouldn't_ be in the headers, like MigrationGuide, etc, but also we don't know if they're functions, macros, etc at this point (can we parse that from the wiki page, though?)
+    print $fh "## $typestr defined in the wiki, but not in the headers\n\n";
+
+    my $wiki_only_sym = 0;
+    foreach (sort keys %wikisyms) {
+        my $sym = $_;
+        if ((not defined $headersyms{$sym}) && ($headersymstype{$sym} == $typeval)) {
+            print $fh "- [$sym]($sym)\n";
+            $wiki_only_sym = 1;
+        }
+    }
+    if (!$wiki_only_sym) {
+        print $fh "(none)\n";
+    }
+    print $fh "\n";
+    }
+}
 
 my $incpath = "$srcpath";
 $incpath .= "/$incsubdir" if $incsubdir ne '';
@@ -532,14 +594,38 @@ while (my $d = readdir(DH)) {
     open(FH, '<', "$incpath/$dent") or die("Can't open '$incpath/$dent': $!\n");
 
     my @contents = ();
+    my $ignoring_lines = 0;
 
     while (<FH>) {
         chomp;
+        my $symtype = 0;  # nothing, yet.
         my $decl;
         my @templines;
         my $str;
         my $has_doxygen = 1;
-        if (/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) {  # a function declaration without a doxygen comment?
+
+        # Since a lot of macros are just preprocessor logic spam and not all macros are worth documenting anyhow, we only pay attention to them when they have a Doxygen comment attached.
+        # Functions and other things are a different story, though!
+
+        if ($ignoring_lines && /\A\s*\#\s*endif\s*\Z/) {
+            $ignoring_lines = 0;
+            push @contents, $_;
+            next;
+        } elsif ($ignoring_lines) {
+            push @contents, $_;
+            next;
+        } elsif (/\A\s*\#\s*ifndef\s+SDL_WIKI_DOCUMENTATION_SECTION\s*\Z/) {
+            $ignoring_lines = 1;
+            push @contents, $_;
+            next;
+        } elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) {  # a function declaration without a doxygen comment?
+            $symtype = 1;   # function declaration
+            @templines = ();
+            $decl = $_;
+            $str = '';
+            $has_doxygen = 0;
+        } elsif (/\A\s*SDL_FORCE_INLINE/) {  # a (forced-inline) function declaration without a doxygen comment?
+            $symtype = 1;   # function declaration
             @templines = ();
             $decl = $_;
             $str = '';
@@ -575,7 +661,19 @@ while (my $d = readdir(DH)) {
             $decl = <FH>;
             $decl = '' if not defined $decl;
             chomp($decl);
-            if (not $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) {
+            if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC/) {
+                $symtype = 1;   # function declaration
+            } elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
+                $symtype = 1;   # (forced-inline) function declaration
+            } elsif ($decl =~ /\A\s*\#\s*define\s+/) {
+                $symtype = 2;   # macro
+            } elsif ($decl =~ /\A\s*(typedef\s+|)(struct|union)/) {
+                $symtype = 3;   # struct or union
+            } elsif ($decl =~ /\A\s*(typedef\s+|)enum/) {
+                $symtype = 4;   # enum
+            } elsif ($decl =~ /\A\s*typedef\s+.*;\Z/) {
+                $symtype = 5;   # other typedef
+            } else {
                 #print "Found doxygen but no function sig:\n$str\n\n";
                 foreach (@templines) {
                     push @contents, $_;
@@ -586,76 +684,212 @@ while (my $d = readdir(DH)) {
         }
 
         my @decllines = ( $decl );
+        my $sym = '';
 
-        if (not $decl =~ /\)\s*;/) {
-            while (<FH>) {
-                chomp;
-                push @decllines, $_;
-                s/\A\s+//;
-                s/\s+\Z//;
-                $decl .= " $_";
-                last if /\)\s*;/;
+        if ($symtype == 1) {  # a function
+            my $is_forced_inline = ($decl =~ /\A\s*SDL_FORCE_INLINE/);
+
+            if ($is_forced_inline) {
+                if (not $decl =~ /\)\s*(\{.*|)\s*\Z/) {
+                    while (<FH>) {
+                        chomp;
+                        push @decllines, $_;
+                        s/\A\s+//;
+                        s/\s+\Z//;
+                        $decl .= " $_";
+                        last if /\)\s*(\{.*|)\s*\Z/;
+                    }
+                }
+                $decl =~ s/\s*\)\s*(\{.*|)\s*\Z/);/;
+            } else {
+                if (not $decl =~ /\)\s*;/) {
+                    while (<FH>) {
+                        chomp;
+                        push @decllines, $_;
+                        s/\A\s+//;
+                        s/\s+\Z//;
+                        $decl .= " $_";
+                        last if /\)\s*;/;
+                    }
+                }
+                $decl =~ s/\s+\);\Z/);/;
             }
-        }
 
-        $decl =~ s/\s+\);\Z/);/;
-        $decl =~ s/\s+\Z//;
-        #print("DECL: [$decl]\n");
+            $decl =~ s/\s+\Z//;
 
-        my $fn = '';
-        if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
-            $fn = $6;
-            #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
-        } else {
-            #print "Found doxygen but no function sig:\n$str\n\n";
-            foreach (@templines) {
-                push @contents, $_;
+            if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)\s*(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
+                $sym = $6;
+                #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
+            } elsif ($is_forced_inline && $decl =~ /\A\s*SDL_FORCE_INLINE\s+(SDL_DEPRECATED\s+|)(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(.*?)\s*\((.*?)\);/) {
+                $sym = $6;
+            } else {
+                #print "Found doxygen but no function sig:\n$str\n\n";
+                foreach (@templines) {
+                    push @contents, $_;
+                }
+                foreach (@decllines) {
+                    push @contents, $_;
+                }
+                next;
             }
-            foreach (@decllines) {
-                push @contents, $_;
+
+            if (!$is_forced_inline) {  # !!! FIXME: maybe we need to do this for forced-inline stuff too?
+                $decl = '';  # build this with the line breaks, since it looks better for syntax highlighting.
+                foreach (@decllines) {
+                    if ($decl eq '') {
+                        $decl = $_;
+                        $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$2$3 /;
+                    } else {
+                        my $trimmed = $_;
+                        # !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
+                        $trimmed =~ s/\A\s{24}//;  # 24 for shrinking to match the removed "extern DECLSPEC SDLCALL "
+                        $decl .= $trimmed;
+                    }
+                    $decl .= "\n";
+                }
+            }
+        } elsif ($symtype == 2) {  # a macro
+            if ($decl =~ /\A\s*\#\s*define\s+(.*?)(\(.*?\)|)\s+/) {
+                $sym = $1;
+                #$decl =~ s/\A\s*extern\s+DECLSPEC\s+(.*?)\s+SDLCALL/$1/;
+            } else {
+                #print "Found doxygen but no macro:\n$str\n\n";
+                foreach (@templines) {
+                    push @contents, $_;
+                }
+                foreach (@decllines) {
+                    push @contents, $_;
+                }
+                next;
             }
-            next;
-        }
 
-        $decl = '';  # build this with the line breaks, since it looks better for syntax highlighting.
-        foreach (@decllines) {
-            if ($decl eq '') {
-                $decl = $_;
-                $decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$2$3 /;
+            while ($decl =~ /\\\Z/) {
+                my $l = <FH>;
+                last if not $l;
+                chomp($l);
+                push @decllines, $l;
+                #$l =~ s/\A\s+//;
+                $l =~ s/\s+\Z//;
+                $decl .= "\n$l";
+            }
+        } elsif (($symtype == 3) || ($symtype == 4)) {  # struct or union or enum
+            my $has_definition = 0;
+            if ($decl =~ /\A\s*(typedef\s+|)(struct|union|enum)\s*(.*?)\s*(\n|\{|\;|\Z)/) {
+                my $ctype = $2;
+                my $origsym = $3;
+                my $ending = $4;
+                $sym = $origsym;
+                if ($sym =~ s/\A(.*?)(\s+)(.*?)\Z/$1/) {
+                    die("Failed to parse '$origsym' correctly!") if ($sym ne $1);  # Thought this was "typedef struct MySym MySym;" ... it was not.  :(  This is a hack!
+                }
+                if ($sym eq '') {
+                    die("\n\n$0 FAILURE!\n" .
+                        "There's a 'typedef $ctype' in $incpath/$dent without a name at the top.\n" .
+                        "Instead of `typedef $ctype {} x;`, this should be `typedef $ctype x {} x;`.\n" .
+                        "This causes problems for wikiheaders.pl and scripting language bindings.\n" .
+                        "Please fix it!\n\n");
+                }
+                $has_definition = ($ending ne ';');
+            } else {
+                #print "Found doxygen but no datatype:\n$str\n\n";
+                foreach (@templines) {
+                    push @contents, $_;
+                }
+                foreach (@decllines) {
+                    push @contents, $_;
+                }
+                next;
+            }
+
+            # This block attempts to find the whole struct/union/enum definition by counting matching brackets. Kind of yucky.
+            if ($has_definition) {
+                my $started = 0;
+                my $brackets = 0;
+                my $pending = $decl;
+
+                $decl = '';
+                while (!$started || ($brackets != 0)) {
+                    foreach my $seg (split(/([{}])/, $pending)) {
+                        $decl .= $seg;
+                        if ($seg eq '{') {
+                            $started = 1;
+                            $brackets++;
+                        } elsif ($seg eq '}') {
+                            die("Something is wrong with header $incpath/$dent while parsing $sym; is a bracket missing?\n") if ($brackets <= 0);
+                            $brackets--;
+                        }
+                    }
+
+                    if (!$started || ($brackets != 0)) {
+                        $pending = <FH>;
+                        die("EOF/error reading $incpath/$dent while parsing $sym\n") if not $pending;
+                        chomp($pending);
+                        push @decllines, $pending;
+                        $decl .= "\n";
+                    }
+                }
+                # this currently assumes the struct/union/enum ends on the line with the final bracket. I'm not writing a C parser here, fix the header!
+            }
+        } elsif ($symtype == 5) {  # other typedef
+            if ($decl =~ /\A\s*typedef\s+(.*);\Z/) {
+                my $tdstr = $1;
+                #my $datatype;
+                if ($tdstr =~ /\A(.*?)\s*\((.*?)\s*\*\s*(.*?)\)\s*\((.*?)\)\s*\Z/) {  # a function pointer type
+                    $sym = $3;
+                    #$datatype = "$1 ($2 *$sym)($4)";
+                } elsif ($tdstr =~ /\A(.*[\s\*]+)(.*?)\s*\Z/) {
+                    $sym = $2;
+                    #$datatype = $1;
+                } else {
+                    die("Failed to parse typedef '$tdstr' in $incpath/$dent!\n");  # I'm hitting a C grammar nail with a regexp hammer here, y'all.
+                }
+
+                $sym =~ s/\A\s+//;
+                $sym =~ s/\s+\Z//;
+                #$datatype =~ s/\A\s+//;
+                #$datatype =~ s/\s+\Z//;
             } else {
-                my $trimmed = $_;
-                # !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
-                $trimmed =~ s/\A\s{24}//;  # 24 for shrinking to match the removed "extern DECLSPEC SDLCALL "
-                $decl .= $trimmed;
+                #print "Found doxygen but no datatype:\n$str\n\n";
+                foreach (@templines) {
+                    push @contents, $_;
+                }
+                foreach (@decllines) {
+                    push @contents, $_;
+                }
+                next;
             }
-            $decl .= "\n";
+        } else {
+            die("Unexpected symtype $symtype");
         }
 
-        #print("$fn:\n$str\n\n");
+        #print("DECL: [$decl]\n");
+
+        #print("$sym:\n$str\n\n");
 
         # There might be multiple declarations of a function due to #ifdefs,
         #  and only one of them will have documentation. If we hit an
         #  undocumented one before, delete the placeholder line we left for
         #  it so it doesn't accumulate a new blank line on each run.
-        my $skipfn = 0;
-        if (defined $headerfuncshasdoxygen{$fn}) {
-            if ($headerfuncshasdoxygen{$fn} == 0) {  # An undocumented declaration already exists, nuke its placeholder line.
-                delete $contents[$headerfuncschunk{$fn}];  # delete DOES NOT RENUMBER existing elements!
+        my $skipsym = 0;
+        if (defined $headersymshasdoxygen{$sym}) {
+            if ($headersymshasdoxygen{$sym} == 0) {  # An undocumented declaration already exists, nuke its placeholder line.
+                delete $contents[$headersymschunk{$sym}];  # delete DOES NOT RENUMBER existing elements!
             } else {  # documented function already existed?
-                $skipfn = 1;  # don't add this copy to the list of functions.
+                $skipsym = 1;  # don't add this copy to the list of functions.
                 if ($has_doxygen) {
-                    print STDERR "WARNING: Function '$fn' appears to be documented in multiple locations. Only keeping the first one we saw!\n";
+                    print STDERR "WARNING: Symbol '$sym' appears to be documented in multiple locations. Only keeping the first one we saw!\n";
                 }
                 push @contents, join("\n", @decllines);  # just put the existing declation in as-is.
             }
         }
 
-        if (!$skipfn) {
-            $headerfuncs{$fn} = $str;
-            $headerdecls{$fn} = $decl;
-            $headerfuncslocation{$fn} = $dent;
-            $headerfuncschunk{$fn} = scalar(@contents);
-            $headerfuncshasdoxygen{$fn} = $has_doxygen;
+        if (!$skipsym) {
+            $headersyms{$sym} = $str;
+            $headerdecls{$sym} = $decl;
+            $headersymslocation{$sym} = $dent;
+            $headersymschunk{$sym} = scalar(@contents);
+            $headersymshasdoxygen{$sym} = $has_doxygen;
+            $headersymstype{$sym} = $symtype;
             push @contents, join("\n", @templines);
             push @contents, join("\n", @decllines);
         }
@@ -667,13 +901,6 @@ while (my $d = readdir(DH)) {
 }
 closedir(DH);
 
-
-# !!! FIXME: we need to parse enums and typedefs and structs and defines and and and and and...
-# !!! FIXME:  (but functions are good enough for now.)
-
-my %wikitypes = ();  # contains string of wiki page extension, like $wikitypes{"SDL_OpenAudio"} == 'mediawiki'
-my %wikifuncs = ();  # contains references to hash of strings, each string being the full contents of a section of a wiki page, like $wikifuncs{"SDL_OpenAudio"}{"Remarks"}.
-my %wikisectionorder = ();   # contains references to array, each array item being a key to a wikipage section in the correct order, like $wikisectionorder{"SDL_OpenAudio"}[2] == 'Remarks'
 opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n");
 while (my $d = readdir(DH)) {
     my $dent = $d;
@@ -684,14 +911,14 @@ while (my $d = readdir(DH)) {
         next;  # only dealing with wiki pages.
     }
 
-    my $fn = $dent;
-    $fn =~ s/\..*\Z//;
+    my $sym = $dent;
+    $sym =~ s/\..*\Z//;
 
     # Ignore FrontPage.
-    next if $fn eq 'FrontPage';
+    next if $sym eq 'FrontPage';
 
     # Ignore "Category*" pages.
-    next if ($fn =~ /\ACategory/);
+    next if ($sym =~ /\ACategory/);
 
     open(FH, '<', "$wikipath/$dent") or die("Can't open '$wikipath/$dent': $!\n");
 
@@ -714,13 +941,13 @@ while (my $d = readdir(DH)) {
                 next;
             } elsif (/\A\= (.*?) \=\Z/) {
                 $firstline = 0;
-                $current_section = ($1 eq $fn) ? '[Brief]' : $1;
+                $current_section = ($1 eq $sym) ? '[Brief]' : $1;
                 die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
                 push @section_order, $current_section;
                 $sections{$current_section} = '';
             } elsif (/\A\=\= (.*?) \=\=\Z/) {
                 $firstline = 0;
-                $current_section = ($1 eq $fn) ? '[Brief]' : $1;
+                $current_section = ($1 eq $sym) ? '[Brief]' : $1;
                 die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
                 push @section_order, $current_section;
                 $sections{$current_section} = '';
@@ -739,7 +966,7 @@ while (my $d = readdir(DH)) {
                 next;
             } elsif (/\A\#+ (.*?)\Z/) {
                 $firstline = 0;
-                $current_section = ($1 eq $fn) ? '[Brief]' : $1;
+                $current_section = ($1 eq $sym) ? '[Brief]' : $1;
                 die("Doubly-defined section '$current_section' in '$dent'!\n") if defined $sections{$current_section};
                 push @section_order, $current_section;
                 $sections{$current_section} = '';
@@ -753,7 +980,7 @@ while (my $d = readdir(DH)) {
                 next;
             }
         } else {
-            die("Unexpected wiki file type. Fixme!\n");
+            die("Unexpected wiki file type. Fixme!");
         }
 
         if ($firstline) {
@@ -771,33 +998,53 @@ while (my $d = readdir(DH)) {
         $sections{$_} .= "\n";
     }
 
+    # older section name we used, migrate over from it.
+    if (defined $sections{'Related Functions'}) {
+        if (not defined $sections{'See Also'}) {
+            $sections{'See Also'} = $sections{'Related Functions'};
+        }
+        delete $sections{'Related Functions'};
+    }
+
     if (0) {
         foreach (@section_order) {
-            print("$fn SECTION '$_':\n");
+            print("$sym SECTION '$_':\n");
             print($sections{$_});
             print("\n\n");
         }
     }
 
-    $wikitypes{$fn} = $type;
-    $wikifuncs{$fn} = \%sections;
-    $wikisectionorder{$fn} = \@section_order;
+    $wikitypes{$sym} = $type;
+    $wikisyms{$sym} = \%sections;
+    $wikisectionorder{$sym} = \@section_order;
 }
 closedir(DH);
 
+delete $wikisyms{"Undocumented"};
+
+{
+    my $path = "$wikipath/Undocumented.md";
+    open(my $fh, '>', $path) or die("Can't open '$path': $!\n");
+
+    print $fh "# Undocumented\n\n";
+    print_undocumented_section($fh, 'Functions', 1);
+    #print_undocumented_section($fh, 'Macros', 2);
+
+    close($fh);
+}
 
 if ($warn_about_missing) {
-    foreach (keys %wikifuncs) {
-        my $fn = $_;
-        if (not defined $headerfuncs{$fn}) {
-            print("WARNING: $fn defined in the wiki but not the headers!\n");
+    foreach (keys %wikisyms) {
+        my $sym = $_;
+        if (not defined $headersyms{$sym}) {
+            print("WARNING: $sym defined in the wiki but not the headers!\n");
         }
     }
 
-    foreach (keys %headerfuncs) {
-        my $fn = $_;
-        if (not defined $wikifuncs{$fn}) {
-            print("WARNING: $fn defined in the headers but not the wiki!\n");
+    foreach (keys %headersyms) {
+        my $sym = $_;
+        if (not defined $wikisyms{$sym}) {
+            print("WARNING: $sym defined in the headers but not the wiki!\n");
         }
     }
 }
@@ -808,23 +1055,42 @@ if ($copy_direction == 1) {  # --copy-to-headers
     $dewikify_mode = 'md';
     $wordwrap_mode = 'md';   # the headers use Markdown format.
 
-    foreach (keys %headerfuncs) {
-        my $fn = $_;
-        next if not defined $wikifuncs{$fn};  # don't have a page for that function, skip it.
-        my $wikitype = $wikitypes{$fn};
-        my $sectionsref = $wikifuncs{$fn};
+    foreach (keys %headersyms) {
+        my $sym = $_;
+        next if not defined $wikisyms{$sym};  # don't have a page for that function, skip it.
+        my $symtype = $headersymstype{$sym};
+        my $wikitype = $wikitypes{$sym};
+        my $sectionsref = $wikisyms{$sym};
         my $remarks = $sectionsref->{'Remarks'};
-        my $params = $sectionsref->{'Function Parameters'};
         my $returns = $sectionsref->{'Return Value'};
         my $threadsafety = $sectionsref->{'Thread Safety'};
         my $version = $sectionsref->{'Version'};
-        my $related = $sectionsref->{'Related Functions'};
+        my $related = $sectionsref->{'See Also'};
         my $deprecated = $sectionsref->{'Deprecated'};
         my $brief = $sectionsref->{'[Brief]'};
         my $addblank = 0;
         my $str = '';
 
-        $headerfuncshasdoxygen{$fn} = 1;  # Added/changed doxygen for this header.
+        my $params = undef;
+        my $paramstr = undef;
+
+        if (($symtype == 1) || (($symtype == 5))) {  # we'll assume a typedef (5) with a \param is a function pointer typedef.
+            $params = $sectionsref->{'Function Parameters'};
+            $paramstr = '\param';
+        } elsif ($symtype == 2) {
+            $params = $sectionsref->{'Macro Parameters'};
+            $paramstr = '\param';
+        } elsif ($symtype == 3) {
+            $params = $sectionsref->{'Fields'};
+            $paramstr = '\field';
+        } elsif ($symtype == 4) {
+            $params = $sectionsref->{'Values'};
+            $paramstr = '\value';
+        } else {
+            die("Unexpected symtype $symtype");
+        }
+
+        $headersymshasdoxygen{$sym} = 1;  # Added/changed doxygen for this header.
 
         $brief = dewikify($wikitype, $brief);
         $brief =~ s/\A(.*?\.) /$1\n/;  # \brief should only be one sentence, delimited by a period+space. Split if necessary.
@@ -874,13 +1140,13 @@ if ($copy_direction == 1) {  # --copy-to-headers
                     $name =~ s/\A\*\*(.*?)\*\*/$1/;
                     $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
                     $desc =~ s/\A\|\s*//;
-                    #print STDERR "FN: $fn   NAME: $name   DESC: $desc TERM: $terminator\n";
+                    #print STDERR "SYM: $sym   NAME: $name   DESC: $desc TERM: $terminator\n";
                     my $whitespacelen = length($name) + 8;
                     my $whitespace = ' ' x $whitespacelen;
                     $desc = wordwrap($desc, -$whitespacelen);
                     my @desclines = split /\n/, $desc;
                     my $firstline = shift @desclines;
-                    $str .= "\\param $name $firstline\n";
+                    $str .= "$paramstr $name $firstline\n";
                     foreach (@desclines) {
                         $str .= "${whitespace}$_\n";
                     }
@@ -898,13 +1164,13 @@ if ($copy_direction == 1) {  # --copy-to-headers
                         my $desc = $2;
                         $name =~ s/\A\*\*(.*?)\*\*/$1/;
                         $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
-                        #print STDERR "FN: $fn   NAME: $name   DESC: $desc\n";
+                        #print STDERR "SYM: $sym   NAME: $name   DESC: $desc\n";
                         my $whitespacelen = length($name) + 8;
                         my $whitespace = ' ' x $whitespacelen;
                         $desc = wordwrap($desc, -$whitespacelen);
                         my @desclines = split /\n/, $desc;
                         my $firstline = shift @desclines;
-                        $str .= "\\param $name $firstline\n";
+                        $str .= "$paramstr $name $firstline\n";
                         foreach (@desclines) {
                             $str .= "${whitespace}$_\n";
                         }
@@ -981,9 +1247,9 @@ if ($copy_direction == 1) {  # --copy-to-headers
             }
         }
 
-        my $header = $headerfuncslocation{$fn};
+        my $header = $headersymslocation{$sym};
         my $contentsref = $headers{$header};
-        my $chunk = $headerfuncschunk{$fn};
+        my $chunk = $headersymschunk{$sym};
 
         my @lines = split /\n/, $str;
 
@@ -1001,10 +1267,10 @@ if ($copy_direction == 1) {  # --copy-to-headers
         }
         $output .= " */";
 
-        #print("$fn:\n$output\n\n");
+        #print("$sym:\n$output\n\n");
 
         $$contentsref[$chunk] = $output;
-        #$$contentsref[$chunk+1] = $headerdecls{$fn};
+        #$$contentsref[$chunk+1] = $headerdecls{$sym};
 
         $changed_headers{$header} = 1;
     }
@@ -1014,12 +1280,12 @@ if ($copy_direction == 1) {  # --copy-to-headers
 
         # this is kinda inefficient, but oh well.
         my @removelines = ();
-        foreach (keys %headerfuncslocation) {
-            my $fn = $_;
-            next if $headerfuncshasdoxygen{$fn};
-            next if $headerfuncslocation{$fn} ne $header;
+        foreach (keys %headersymslocation) {
+            my $sym = $_;
+            next if $headersymshasdoxygen{$sym};
+            next if $headersymslocation{$sym} ne $header;
             # the index of the blank line we put before the function declaration in case we needed to replace it with new content from the wiki.
-            push @removelines, $headerfuncschunk{$fn};
+            push @removelines, $headersymschunk{$sym};
         }
 
         my $contentsref = $headers{$header};
@@ -1044,7 +1310,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
                 my $dent = $_;
                 if ($dent =~ /\A(.*?)\.md\Z/) {  # we only bridge Markdown files here.
                     next if $1 eq 'FrontPage';
-                    filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\r\n");
+                    filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\n");
                 }
             }
             closedir(DH);
@@ -1057,18 +1323,19 @@ if ($copy_direction == 1) {  # --copy-to-headers
         $wordwrap_mode = $changeformat;
     }
 
-    foreach (keys %headerfuncs) {
-        my $fn = $_;
-        next if not $headerfuncshasdoxygen{$fn};
-        my $origwikitype = defined $wikitypes{$fn} ? $wikitypes{$fn} : 'md';  # default to MarkDown for new stuff.
+    foreach (keys %headersyms) {
+        my $sym = $_;
+        next if not $headersymshasdoxygen{$sym};
+        my $symtype = $headersymstype{$sym};
+        my $origwikitype = defined $wikitypes{$sym} ? $wikitypes{$sym} : 'md';  # default to MarkDown for new stuff.
         my $wikitype = (defined $changeformat) ? $changeformat : $origwikitype;
-        die("Unexpected wikitype '$wikitype'\n") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage'));
+        die("Unexpected wikitype '$wikitype'") if (($wikitype ne 'mediawiki') and ($wikitype ne 'md') and ($wikitype ne 'manpage'));
 
-        #print("$fn\n"); next;
+        #print("$sym\n"); next;
 
         $wordwrap_mode = $wikitype;
 
-        my $raw = $headerfuncs{$fn};  # raw doxygen text with comment characters stripped from start/end and start of each line.
+        my $raw = $headersyms{$sym};  # raw doxygen text with comment characters stripped from start/end and start of each line.
         next if not defined $raw;
         $raw =~ s/\A\s*\\brief\s+//;  # Technically we don't need \brief (please turn on JAVADOC_AUTOBRIEF if you use Doxygen), so just in case one is present, strip it.
 
@@ -1084,27 +1351,20 @@ if ($copy_direction == 1) {  # --copy-to-headers
             $brief .= "$l ";
         }
 
+        $brief =~ s/\s+\Z//;
         $brief =~ s/\A(.*?\.) /$1\n\n/;  # \brief should only be one sentence, delimited by a period+space. Split if necessary.
         my @briefsplit = split /\n/, $brief;
+
+        next if not defined $briefsplit[0];  # No brief text? Probably a bogus Doxygen comment, skip it.
+
         $brief = wikify($wikitype, shift @briefsplit) . "\n";
         @doxygenlines = (@briefsplit, @doxygenlines);
 
         my $remarks = '';
-        # !!! FIXME: wordwrap and wikify might handle this, now.
         while (@doxygenlines) {
             last if $doxygenlines[0] =~ /\A\\/;  # some sort of doxygen command, assume we're past the general remarks.
             my $l = shift @doxygenlines;
-            if ($l =~ /\A\`\`\`/) {  # syntax highlighting, don't reformat.
-                $remarks .= "$l\n";
-                while ((@doxygenlines) && (not $l =~ /\`\`\`\Z/)) {
-                    $l = shift @doxygenlines;
-                    $remarks .= "$l\n";
-                }
-            } else {
-                $l =~ s/\A\s*//;
-                $l =~ s/\s*\Z//;
-                $remarks .= "$l\n";
-            }
+            $remarks .= "$l\n";
         }
 
         #print("REMARKS:\n\n $remarks\n\n");
@@ -1113,7 +1373,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
         $remarks =~ s/\A\s*//;
         $remarks =~ s/\s*\Z//;
 
-        my $decl = $headerdecls{$fn};
+        my $decl = $headerdecls{$sym};
         #$decl =~ s/\*\s+SDLCALL/ *SDLCALL/;  # Try to make "void * Function" become "void *Function"
         #$decl =~ s/\A\s*extern\s+(SDL_DEPRECATED\s+|)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL/$2$3/;
 
@@ -1122,7 +1382,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
             $syntax = "<syntaxhighlight lang='c'>\n$decl</syntaxhighlight>\n";
         } elsif ($wikitype eq 'md') {
             $syntax = "```c\n$decl\n```\n";
-        } else { die("Expected wikitype '$wikitype'\n"); }
+        } else { die("Expected wikitype '$wikitype'"); }
 
         my %sections = ();
         $sections{'[Brief]'} = $brief;  # include this section even if blank so we get a title line.
@@ -1133,9 +1393,10 @@ if ($copy_direction == 1) {  # --copy-to-headers
 
         while (@doxygenlines) {
             my $l = shift @doxygenlines;
-            if ($l =~ /\A\\param\s+(.*?)\s+(.*)\Z/) {
-                my $arg = $1;
-                my $desc = $2;
+            # We allow param/field/value interchangeably, even if it doesn't make sense. The next --copy-to-headers will correct it anyhow.
+            if ($l =~ /\A\\(param|field|value)\s+(.*?)\s+(.*)\Z/) {
+                my $arg = $2;
+                my $desc = $3;
                 while (@doxygenlines) {
                     my $subline = $doxygenlines[0];
                     $subline =~ s/\A\s*//;
@@ -1217,21 +1478,43 @@ if ($copy_direction == 1) {  # --copy-to-headers
             } elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
                 my $sa = $1;
                 $sa =~ s/\(\)\Z//;  # Convert "SDL_Func()" to "SDL_Func"
-                $sections{'Related Functions'} = '' if not defined $sections{'Related Functions'};
+                $sections{'See Also'} = '' if not defined $sections{'See Also'};
                 if ($wikitype eq 'mediawiki') {
-                    $sections{'Related Functions'} .= ":[[$sa]]\n";
+                    $sections{'See Also'} .= ":[[$sa]]\n";
                 } elsif ($wikitype eq 'md') {
-                    $sections{'Related Functions'} .= "* [$sa]($sa)\n";
-                } else { die("Expected wikitype '$wikitype'\n"); }
+                    $sections{'See Also'} .= "* [$sa]($sa)\n";
+                } else { die("Expected wikitype '$wikitype'"); }
             }
         }
 
         my $hfiletext = $wikiheaderfiletext;
-        $hfiletext =~ s/\%fname\%/$headerfuncslocation{$fn}/g;
+        $hfiletext =~ s/\%fname\%/$headersymslocation{$sym}/g;
         $sections{'Header File'} = "$hfiletext\n";
 
         # Make sure this ends with a double-newline.
-        $sections{'Related Functions'} .= "\n" if defined $sections{'Related Functions'};
+        $sections{'See Also'} .= "\n" if defined $sections{'See Also'};
+
+        if (0) {  # !!! FIXME: this was a useful hack, but this needs to be generalized if we're going to do this always.
+            # Plug in a \since section if one wasn't listed.
+            if (not defined $sections{'Version'}) {
+                my $symtypename;
+                if ($symtype == 1) {
+                    $symtypename = 'function';
+                } elsif ($symtype == 2) {
+                    $symtypename = 'macro';
+                } elsif ($symtype == 3) {
+                    $symtypename = 'struct';
+                } elsif ($symtype == 4) {
+                    $symtypename = 'enum';
+                } elsif ($symtype == 5) {
+                    $symtypename = 'datatype';
+                } else {
+                    die("Unexpected symbol type $symtype!");
+                }
+                my $str = "This $symtypename is available since SDL 3.0.0.";
+                $sections{'Version'} = wordwrap(wikify($wikitype, $str)) . "\n";
+            }
+        }
 
         # We can build the wiki table now that we have all the data.
         if (scalar(@params) > 0) {
@@ -1271,7 +1554,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
                     $str .= "| **$arg** " . (' ' x ($longest_arg - length($arg))) . "| $desc" . (' ' x ($longest_desc - length($desc))) . " |\n";
                 }
             } else {
-                die("Unexpected wikitype!\n");  # should have checked this elsewhere.
+                die("Unexpected wikitype!");  # should have checked this elsewhere.
             }
             $sections{'Function Parameters'} = $str;
         }
@@ -1279,7 +1562,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
         my $path = "$wikipath/$_.${wikitype}.tmp";
         open(FH, '>', $path) or die("Can't open '$path': $!\n");
 
-        my $sectionsref = $wikifuncs{$fn};
+        my $sectionsref = $wikisyms{$sym};
 
         foreach (@standard_wiki_sections) {
             # drop sections we either replaced or removed from the original wiki's contents.
@@ -1288,7 +1571,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
             }
         }
 
-        my $wikisectionorderref = $wikisectionorder{$fn};
+        my $wikisectionorderref = $wikisectionorder{$sym};
 
         # Make sure there's a footer in the wiki that puts this function in CategoryAPI...
         if (not $$sectionsref{'[footer]'}) {
@@ -1312,16 +1595,32 @@ if ($copy_direction == 1) {  # --copy-to-headers
             }
         }
 
-        # !!! FIXME: This won't be CategoryAPI if we eventually handle things other than functions.
         my $footer = $$sectionsref{'[footer]'};
 
+        my $symtypename;
+        if ($symtype == 1) {
+            $symtypename = 'Function';
+        } elsif ($symtype == 2) {
+            $symtypename = 'Macro';
+        } elsif ($symtype == 3) {
+            $symtypename = 'Struct';
+        } elsif ($symtype == 4) {
+            $symtypename = 'Enum';
+        } elsif ($symtype == 5) {
+            $symtypename = 'Datatype';
+        } else {
+            die("Unexpected symbol type $symtype!");
+        }
+
         if ($wikitype eq 'mediawiki') {
             $footer =~ s/\[\[CategoryAPI\]\],?\s*//g;
-            $footer = '[[CategoryAPI]]' . (($footer eq '') ? "\n" : ", $footer");
+            $footer =~ s/\[\[CategoryAPI${symtypename}\]\],?\s*//g;
+            $footer = "[[CategoryAPI]], [[CategoryAPI$symtypename]]" . (($footer eq '') ? "\n" : ", $footer");
         } elsif ($wikitype eq 'md') {
             $footer =~ s/\[CategoryAPI\]\(CategoryAPI\),?\s*//g;
-            $footer = '[CategoryAPI](CategoryAPI)' . (($footer eq '') ? '' : ', ') . $footer;
-        } else { die("Unexpected wikitype '$wikitype'\n"); }
+            $footer =~ s/\[CategoryAPI${symtypename}\]\(CategoryAPI${symtypename}\),?\s*//g;
+            $footer = "[CategoryAPI](CategoryAPI), [CategoryAPI$symtypename](CategoryAPI$symtypename)" . (($footer eq '') ? '' : ', ') . $footer;
+        } else { die("Unexpected wikitype '$wikitype'"); }
         $$sectionsref{'[footer]'} = $footer;
 
         if (defined $wikipreamble) {
@@ -1330,7 +1629,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
                 print FH "====== $wikified_preamble ======\n";
             } elsif ($wikitype eq 'md') {
                 print FH "###### $wikified_preamble\n";
-            } else { die("Unexpected wikitype '$wikitype'\n"); }
+            } else { die("Unexpected wikitype '$wikitype'"); }
         }
 
         my $prevsectstr = '';
@@ -1340,6 +1639,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
             next if $sect eq '[start]';
             next if (not defined $sections{$sect} and not defined $$sectionsref{$sect});
             my $section = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect};
+
             if ($sect eq '[footer]') {
                 # Make sure previous section ends with two newlines.
                 if (substr($prevsectstr, -1) ne "\n") {
@@ -1350,16 +1650,30 @@ if ($copy_direction == 1) {  # --copy-to-headers
                 print FH "----\n";   # It's the same in Markdown and MediaWiki.
             } elsif ($sect eq '[Brief]') {
                 if ($wikitype eq 'mediawiki') {
-                    print FH  "= $fn =\n\n";
+                    print FH  "= $sym =\n\n";
                 } elsif ($wikitype eq 'md') {
-                    print FH "# $fn\n\n";
-                } else { die("Unexpected wikitype '$wikitype'\n"); }
+                    print FH "# $sym\n\n";
+                } else { die("Unexpected wikitype '$wikitype'"); }
             } else {
+                my $sectname = $sect;
+                if ($sectname eq 'Function Parameters') {  # We use this same table for different things depending on what we're documenting, so rename it now.
+                    if (($symtype == 1) || ($symtype == 5)) {  # function (or typedef, in case it's a function pointer type).
+                    } elsif ($symtype == 2) {  # macro
+                        $sectname = 'Macro Parameters';
+                    } elsif ($symtype == 3) {  # struct/union
+                        $sectname = 'Fields';
+                    } elsif ($symtype == 4) {  # enum
+                        $sectname = 'Values';
+                    } else {
+                        die("Unexpected symtype $symtype");
+                    }
+                }
+
                 if ($wikitype eq 'mediawiki') {
-                    print FH  "\n== $sect ==\n\n";
+                    print FH  "\n== $sectname ==\n\n";
                 } elsif ($wikitype eq 'md') {
-                    print FH "\n## $sect\n\n";
-                } else { die("Unexpected wikitype '$wikitype'\n"); }
+                    print FH "\n## $sectname\n\n";
+                } else { die("Unexpected wikitype '$wikitype'"); }
             }
 
             my $sectstr = defined $sections{$sect} ? $sections{$sect} : $$sectionsref{$sect};
@@ -1422,10 +1736,8 @@ if ($copy_direction == 1) {  # --copy-to-headers
 } elsif ($copy_direction == -2) { # --copy-to-manpages
     # This only takes from the wiki data, since it has sections we omit from the headers, like code examples.
 
-    my $manpath = "$srcpath/man";
-    mkdir($manpath);
-    $manpath .= "/man3";
-    mkdir($manpath);
+    File::Path::make_path("$manpath/man3");
+    File::Path::make_path("$manpath/man3type");
 
     $dewikify_mode = 'manpage';
     $wordwrap_mode = 'manpage';
@@ -1440,8 +1752,10 @@ if ($copy_direction == 1) {  # --copy-to-headers
     close(FH);
     }
 
-    my $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`;
-    chomp($gitrev);
+    if (!$gitrev) {
+        $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`;
+        chomp($gitrev);
+    }
 
     # !!! FIXME
     open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n");
@@ -1461,25 +1775,38 @@ if ($copy_direction == 1) {  # --copy-to-headers
     close(FH);
     my $fullversion = "$majorver.$minorver.$patchver";
 
-    foreach (keys %headerfuncs) {
-        my $fn = $_;
-        next if not defined $wikifuncs{$fn};  # don't have a page for that function, skip it.
-        my $wikitype = $wikitypes{$fn};
-        my $sectionsref = $wikifuncs{$fn};
+    foreach (keys %headersyms) {
+        my $sym = $_;
+        next if not defined $wikisyms{$sym};  # don't have a page for that function, skip it.
+        my $symtype = $headersymstype{$sym};
+        my $wikitype = $wikitypes{$sym};
+        my $sectionsref = $wikisyms{$sym};
         my $remarks = $sectionsref->{'Remarks'};
         my $params = $sectionsref->{'Function Parameters'};
         my $returns = $sectionsref->{'Return Value'};
         my $version = $sectionsref->{'Version'};
         my $threadsafety = $sectionsref->{'Thread Safety'};
-        my $related = $sectionsref->{'Related Functions'};
+        my $related = $sectionsref->{'See Also'};
         my $examples = $sectionsref->{'Code Examples'};
         my $deprecated = $sectionsref->{'Deprecated'};
         my $headerfile = $manpageheaderfiletext;
-        $headerfile =~ s/\%fname\%/$headerfuncslocation{$fn}/g;
+        $headerfile =~ s/\%fname\%/$headersymslocation{$sym}/g;
         $headerfile .= "\n";
 
+        my $mansection;
+        my $mansectionname;
+        if (($symtype == 1) || ($symtype == 2)) {  # functions or macros
+            $mansection = '3';
+            $mansectionname = 'FUNCTIONS';
+        } elsif (($symtype >= 3) && ($symtype <= 5)) {  # struct/union/enum/typedef
+            $mansection = '3type';
+            $mansectionname = 'DATATYPES';
+        } else {
+            die("Unexpected symtype $symtype");
+        }
+
         my $brief = $sectionsref->{'[Brief]'};
-        my $decl = $headerdecls{$fn};
+        my $decl = $headerdecls{$sym};
         my $str = '';
 
         $brief = "$brief";
@@ -1499,14 +1826,14 @@ if ($copy_direction == 1) {  # --copy-to-headers
         $str .= ".\\\" This manpage content is licensed under Creative Commons\n";
         $str .= ".\\\"  Attribution 4.0 International (CC BY 4.0)\n";
         $str .= ".\\\"   https://creativecommons.org/licenses/by/4.0/\n";
-        $str .= ".\\\" This manpage was generated from ${projectshortname}'s wiki page for $fn:\n";
-        $str .= ".\\\"   $wikiurl/$fn\n";
+        $str .= ".\\\" This manpage was generated from ${projectshortname}'s wiki page for $sym:\n";
+        $str .= ".\\\"   $wikiurl/$sym\n";
         $str .= ".\\\" Generated with SDL/build-scripts/wikiheaders.pl\n";
         $str .= ".\\\"  revision $gitrev\n" if $gitrev ne '';
         $str .= ".\\\" Please report issues in this manpage's content at:\n";
         $str .= ".\\\"   $bugreporturl\n";
         $str .= ".\\\" Please report issues in the generation of this manpage from the wiki at:\n";
-        $str .= ".\\\"   https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$fn\n";
+        $str .= ".\\\"   https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20$sym\n";
         $str .= ".\\\" $projectshortname can be found at $projecturl\n";
 
         # Define a .URL macro. The "www.tmac" thing decides if we're using GNU roff (which has a .URL macro already), and if so, overrides the macro we just created.
@@ -1516,10 +1843,10 @@ if ($copy_direction == 1) {  # --copy-to-headers
         $str .= "..\n";
         $str .= '.if \n[.g] .mso www.tmac' . "\n";
 
-        $str .= ".TH $fn 3 \"$projectshortname $fullversion\" \"$projectfullname\" \"$projectshortname$majorver FUNCTIONS\"\n";
+        $str .= ".TH $sym $mansection \"$projectshortname $fullversion\" \"$projectfullname\" \"$projectshortname$majorver $mansectionname\"\n";
         $str .= ".SH NAME\n";
 
-        $str .= "$fn";
+        $str .= "$sym";
         $str .= " \\- $brief" if (defined $brief);
         $str .= "\n";
 
@@ -1550,7 +1877,18 @@ if ($copy_direction == 1) {  # --copy-to-headers
         }
 
         if (defined $params) {
-            $str .= ".SH FUNCTION PARAMETERS\n";
+            if (($symtype == 1) || ($symtype == 5)) {
+                $str .= ".SH FUNCTION PARAMETERS\n";
+            } elsif ($symtype == 2) {  # macro
+                $str .= ".SH MACRO PARAMETERS\n";
+            } elsif ($symtype == 3) {  # struct/union
+                $str .= ".SH FIELDS\n";
+            } elsif ($symtype == 4) {  # enum
+                $str .= ".SH VALUES\n";
+            } else {
+                die("Unexpected symtype $symtype");
+            }
+
             my @lines = split /\n/, $params;
             if ($wikitype eq 'mediawiki') {
                 die("Unexpected data parsing MediaWiki table") if (shift @lines ne '{|');  # Dump the '{|' start
@@ -1564,7 +1902,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
                     $name =~ s/\A\'\'\'(.*?)\'\'\'/$1/;
                     $desc =~ s/\A\|\s*//;
                     $desc = dewikify($wikitype, $desc);
-                    #print STDERR "FN: $fn   NAME: $name   DESC: $desc TERM: $terminator\n";
+                    #print STDERR "FN: $sym   NAME: $name   DESC: $desc TERM: $terminator\n";
 
                     $str .= ".TP\n";
                     $str .= ".I $name\n";
@@ -1651,7 +1989,7 @@ if ($copy_direction == 1) {  # --copy-to-headers
         $str .= ".UE\n";
         $str .= ".PP\n";
         $str .= "This manpage was generated from\n";
-        $str .= ".UR $wikiurl/$fn\n";
+        $str .= ".UR $wikiurl/$sym\n";
         $str .= "${projectshortname}'s wiki\n";
         $str .= ".UE\n";
         $str .= "using SDL/build-scripts/wikiheaders.pl";
@@ -1663,11 +2001,12 @@ if ($copy_direction == 1) {  # --copy-to-headers
         $str .= ".UE\n";
         }
 
-        my $path = "$manpath/$_.3.tmp";
-        open(FH, '>', $path) or die("Can't open '$path': $!\n");
+        my $path = "$manpath/man$mansection/$_.$mansection";
+        my $tmppath = "$path.tmp";
+        open(FH, '>', $tmppath) or die("Can't open '$tmppath': $!\n");
         print FH $str;
         close(FH);
-        rename($path, "$manpath/$_.3") or die("Can't rename '$path' to '$manpath/$_.3': $!\n");
+        rename($tmppath, $path) or die("Can't rename '$tmppath' to '$path': $!\n");
     }
 }
 

+ 483 - 483
docs/README-android.md

@@ -1,483 +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 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.
-
+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 - 163
docs/README-cmake.md

@@ -1,163 +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 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.
+# 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
docs/README-directfb.md

@@ -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
docs/README-dynapi.md

@@ -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.

+ 374 - 374
docs/README-emscripten.md

@@ -1,374 +1,374 @@
-# Emscripten
-
-## The state of things
-
-(As of September 2023, but things move quickly and we don't update this
-document often.)
-
-In modern times, all the browsers you probably care about (Chrome, Firefox,
-Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some
-reasonable base configurations:
-
-- WebAssembly (don't bother with asm.js any more)
-- WebGL (which will look like OpenGL ES 2 or 3 to your app).
-- Threads (see caveats, though!)
-- Game controllers
-- Autoupdating (so you can assume they have a recent version of the browser)
-
-All this to say we're at the point where you don't have to make a lot of
-concessions to get even a fairly complex SDL-based game up and running.
-
-
-## RTFM
-
-This document is a quick rundown of some high-level details. The
-documentation at [emscripten.org](https://emscripten.org/) is vast
-and extremely detailed for a wide variety of topics, and you should at
-least skim through it at some point.
-
-
-## Porting your app to Emscripten
-
-Many many things just need some simple adjustments and they'll compile
-like any other C/C++ code, as long as SDL was handling the platform-specific
-work for your program.
-
-First, you probably need this in at least one of your source files:
-
-```c
-#ifdef __EMSCRIPTEN__
-#include <emscripten.h>
-#endif
-```
-
-Second: assembly language code has to go. Replace it with C. You can even use
-[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)!
-
-Third: Middleware has to go. If you have a third-party library you link
-against, you either need an Emscripten port of it, or the source code to it
-to compile yourself, or you need to remove it.
-
-Fourth: You still start in a function called main(), but you need to get out of
-it and into a function that gets called repeatedly, and returns quickly,
-called a mainloop.
-
-Somewhere in your program, you probably have something that looks like a more
-complicated version of this:
-
-```c
-void main(void)
-{
-    initialize_the_game();
-    while (game_is_still_running) {
-        check_for_new_input();
-        think_about_stuff();
-        draw_the_next_frame();
-    }
-    deinitialize_the_game();
-}
-```
-
-This will not work on Emscripten, because the main thread needs to be free
-to do stuff and can't sit in this loop forever. So Emscripten lets you set up
-a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop).
-
-```c
-static void mainloop(void)   /* this will run often, possibly at the monitor's refresh rate */
-{
-    if (!game_is_still_running) {
-        deinitialize_the_game();
-        #ifdef __EMSCRIPTEN__
-        emscripten_cancel_main_loop();  /* this should "kill" the app. */
-        #else
-        exit(0);
-        #endif
-    }
-
-    check_for_new_input();
-    think_about_stuff();
-    draw_the_next_frame();
-}
-
-void main(void)
-{
-    initialize_the_game();
-    #ifdef __EMSCRIPTEN__
-    emscripten_set_main_loop(mainloop, 0, 1);
-    #else
-    while (1) { mainloop(); }
-    #endif
-}
-```
-
-Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run
-`mainloop` over and over until I end the program." The function will
-run, and return, freeing the main thread for other tasks, and then
-run again when it's time. The `1` parameter does some magic to make
-your main() function end immediately; this is useful because you
-don't want any shutdown code that might be sitting below this code
-to actually run if main() were to continue on, since we're just
-getting started.
-
-There's a lot of little details that are beyond the scope of this
-document, but that's the biggest intial set of hurdles to porting
-your app to the web.
-
-
-## Do you need threads?
-
-If you plan to use threads, they work on all major browsers now. HOWEVER,
-they bring with them a lot of careful considerations. Rendering _must_
-be done on the main thread. This is a general guideline for many
-platforms, but a hard requirement on the web.
-
-Many other things also must happen on the main thread; often times SDL
-and Emscripten make efforts to "proxy" work to the main thread that
-must be there, but you have to be careful (and read more detailed
-documentation than this for the finer points).
-
-Even when using threads, your main thread needs to set an Emscripten
-mainloop that runs quickly and returns, or things will fail to work
-correctly.
-
-You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html)
-for all the finer points. Mostly SDL's thread API will work as expected,
-but is built on pthreads, so it shares the same little incompatibilities
-that are documented there, such as where you can use a mutex, and when
-a thread will start running, etc.
-
-
-IMPORTANT: You have to decide to either build something that uses
-threads or something that doesn't; you can't have one build
-that works everywhere. This is an Emscripten (or maybe WebAssembly?
-Or just web browsers in general?) limitation. If you aren't using
-threads, it's easier to not enable them at all, at build time.
-
-If you use threads, you _have to_ run from a web server that has
-[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/)
-or your program will fail to start at all.
-
-If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined
-for checking with the C preprocessor, so you can build something
-different depending on what sort of build you're compiling.
-
-
-## Audio
-
-Audio works as expected at the API level, but not exactly like other
-platforms.
-
-You'll only see a single default audio device. Audio capture also works;
-if the browser pops up a prompt to ask for permission to access the
-microphone, the SDL_OpenAudioDevice call will succeed and start producing
-silence at a regular interval. Once the user approves the request, real
-audio data will flow. If the user denies it, the app is not informed and
-will just continue to receive silence.
-
-Modern web browsers will not permit web pages to produce sound before the
-user has interacted with them (clicked or tapped on them, usually); 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.
-
-SDL will allow you to open the audio device for playback in this
-circumstance, and your audio callback will fire, but SDL will throw the audio
-data away until the user interacts with the page. This helps apps that depend
-on the audio callback to make progress, and also keeps audio playback in sync
-once the app is finally allowed to make noise.
-
-There are two reasonable ways to deal with the silence at the app level:
-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, and the user can reasonably opt-in to listening.
-
-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.
-
-
-## Rendering
-
-If you use SDL's 2D render API, it will use GLES2 internally, which
-Emscripten will turn into WebGL calls. You can also use OpenGL ES 2
-directly by creating a GL context and drawing into it.
-
-Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
-present anything on the screen until your return from your mainloop
-function.
-
-
-## Building SDL/emscripten
-
-First: do you _really_ need to build SDL from source?
-
-If you aren't developing SDL itself, have a desire to mess with its source
-code, or need something on the bleeding edge, don't build SDL. Just use
-Emscripten's packaged version!
-
-Compile and link your app with `-sUSE_SDL=2` and it'll use a build of
-SDL packaged with Emscripten. This comes from the same source code and
-fixes the Emscripten project makes to SDL are generally merged into SDL's
-revision control, so often this is much easier for app developers.
-
-`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL
-1.2 instead; if you need SDL 1.2, this might be fine, but we generally
-recommend you don't use SDL 1.2 in modern times.
-
-
-If you want to build SDL, though...
-
-SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
-are likely to work, as well.
-
-
-Build:
-
-This works on Linux/Unix and macOS. Please send comments about Windows.
-
-Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html)
-first, and run `source emsdk_env.sh` at the command line so it finds the
-tools.
-
-(These configure options might be overkill, but this has worked for me.)
-
-```bash
-cd SDL
-mkdir build
-cd build
-emconfigure ../configure --host=wasm32-unknown-emscripten --disable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3"
-emmake make -j4
-```
-
-If you want to build with thread support, something like this works:
-
-```bash
-emconfigure ../configure --host=wasm32-unknown-emscripten --enable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3 -pthread" LDFLAGS="-pthread"
-```
-
-Or with cmake:
-
-```bash
-mkdir build
-cd build
-emcmake cmake ..
-emmake make -j4
-```
-
-To build one of the tests:
-
-```bash
-cd test/
-emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
-```
-
-## Building your app
-
-You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but
-mostly it uses the same command line arguments as Clang.
-
-Link against the SDL/build/.libs/libSDL2.a file you generated by building SDL,
-link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build.
-
-Usually you would produce a binary like this:
-
-```bash
-gcc -o mygame mygame.c  # or whatever
-```
-
-But for Emscripten, you want to output something else:
-
-```bash
-emcc -o index.html mygame.c
-```
-
-This will produce several files...support Javascript and WebAssembly (.wasm)
-files. The `-o index.html` will produce a simple HTML page that loads and
-runs your app. You will (probably) eventually want to replace or customize
-that file and do `-o index.js` instead to just build the code pieces.
-
-If you're working on a program of any serious size, you'll likely need to
-link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access
-to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb`
-or the app will fail to start on iOS browsers, but this might be a bug that
-goes away in the future.
-
-
-## Data files
-
-Your game probably has data files. Here's how to access them.
-
-Filesystem access works like a Unix filesystem; you have a single directory
-tree, possibly interpolated from several mounted locations, no drive letters,
-'/' for a path separator. You can access them with standard file APIs like
-open() or fopen() or SDL_RWops. You can read or write from the filesystem.
-
-By default, you probably have a "MEMFS" filesystem (all files are stored in
-memory, but access to them is immediate and doesn't need to block). There are
-other options, like "IDBFS" (files are stored in a local database, so they
-don't need to be in RAM all the time and they can persist between runs of the
-program, but access is not synchronous). You can mix and match these file
-systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc,
-but that's beyond the scope of this document. Please refer to Emscripten's
-[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html)
-for more info.
-
-The _easiest_ (but not the best) way to get at your data files is to embed
-them in the app itself. Emscripten's linker has support for automating this.
-
-```bash
-emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav
-```
-
-This will pack ../test/sample.wav in your app, and make it available at
-"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available
-before your main() function runs, and since it's in MEMFS, you can just
-read it like you do on other platforms. `--embed-file` can also accept a
-directory to pack an entire tree, and you can specify the argument multiple
-times to pack unrelated things into the final installation.
-
-Note that this is absolutely the best approach if you have a few small
-files to include and shouldn't worry about the issue further. However, if you
-have hundreds of megabytes and/or thousands of files, this is not so great,
-since the user will download it all every time they load your page, and it
-all has to live in memory at runtime.
-
-[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
-gives other options and details, and is worth a read.
-
-
-## Debugging
-
-Debugging web apps is a mixed bag. You should compile and link with
-`-gsource-map`, which embeds a ton of source-level debugging information into
-the build, and make sure _the app source code is available on the web server_,
-which is often a scary proposition for various reasons.
-
-When you debug from the browser's tools and hit a breakpoint, you can step
-through the actual C/C++ source code, though, which can be nice.
-
-If you try debugging in Firefox and it doesn't work well for no apparent
-reason, try Chrome, and vice-versa. These tools are still relatively new,
-and improving all the time.
-
-SDL_Log() (or even plain old printf) will write to the Javascript console,
-and honestly I find printf-style debugging to be easier than setting up a build
-for proper debugging, so use whatever tools work best for you.
-
-
-## Questions?
-
-Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues).
-If something is wrong or unclear, we want to know!
-
-
-
+# Emscripten
+
+## The state of things
+
+(As of September 2023, but things move quickly and we don't update this
+document often.)
+
+In modern times, all the browsers you probably care about (Chrome, Firefox,
+Edge, and Safari, on Windows, macOS, Linux, iOS and Android), support some
+reasonable base configurations:
+
+- WebAssembly (don't bother with asm.js any more)
+- WebGL (which will look like OpenGL ES 2 or 3 to your app).
+- Threads (see caveats, though!)
+- Game controllers
+- Autoupdating (so you can assume they have a recent version of the browser)
+
+All this to say we're at the point where you don't have to make a lot of
+concessions to get even a fairly complex SDL-based game up and running.
+
+
+## RTFM
+
+This document is a quick rundown of some high-level details. The
+documentation at [emscripten.org](https://emscripten.org/) is vast
+and extremely detailed for a wide variety of topics, and you should at
+least skim through it at some point.
+
+
+## Porting your app to Emscripten
+
+Many many things just need some simple adjustments and they'll compile
+like any other C/C++ code, as long as SDL was handling the platform-specific
+work for your program.
+
+First, you probably need this in at least one of your source files:
+
+```c
+#ifdef __EMSCRIPTEN__
+#include <emscripten.h>
+#endif
+```
+
+Second: assembly language code has to go. Replace it with C. You can even use
+[x86 SIMD intrinsic functions in Emscripten](https://emscripten.org/docs/porting/simd.html)!
+
+Third: Middleware has to go. If you have a third-party library you link
+against, you either need an Emscripten port of it, or the source code to it
+to compile yourself, or you need to remove it.
+
+Fourth: You still start in a function called main(), but you need to get out of
+it and into a function that gets called repeatedly, and returns quickly,
+called a mainloop.
+
+Somewhere in your program, you probably have something that looks like a more
+complicated version of this:
+
+```c
+void main(void)
+{
+    initialize_the_game();
+    while (game_is_still_running) {
+        check_for_new_input();
+        think_about_stuff();
+        draw_the_next_frame();
+    }
+    deinitialize_the_game();
+}
+```
+
+This will not work on Emscripten, because the main thread needs to be free
+to do stuff and can't sit in this loop forever. So Emscripten lets you set up
+a [mainloop](https://emscripten.org/docs/porting/emscripten-runtime-environment.html#browser-main-loop).
+
+```c
+static void mainloop(void)   /* this will run often, possibly at the monitor's refresh rate */
+{
+    if (!game_is_still_running) {
+        deinitialize_the_game();
+        #ifdef __EMSCRIPTEN__
+        emscripten_cancel_main_loop();  /* this should "kill" the app. */
+        #else
+        exit(0);
+        #endif
+    }
+
+    check_for_new_input();
+    think_about_stuff();
+    draw_the_next_frame();
+}
+
+void main(void)
+{
+    initialize_the_game();
+    #ifdef __EMSCRIPTEN__
+    emscripten_set_main_loop(mainloop, 0, 1);
+    #else
+    while (1) { mainloop(); }
+    #endif
+}
+```
+
+Basically, `emscripten_set_main_loop(mainloop, 0, 1);` says "run
+`mainloop` over and over until I end the program." The function will
+run, and return, freeing the main thread for other tasks, and then
+run again when it's time. The `1` parameter does some magic to make
+your main() function end immediately; this is useful because you
+don't want any shutdown code that might be sitting below this code
+to actually run if main() were to continue on, since we're just
+getting started.
+
+There's a lot of little details that are beyond the scope of this
+document, but that's the biggest intial set of hurdles to porting
+your app to the web.
+
+
+## Do you need threads?
+
+If you plan to use threads, they work on all major browsers now. HOWEVER,
+they bring with them a lot of careful considerations. Rendering _must_
+be done on the main thread. This is a general guideline for many
+platforms, but a hard requirement on the web.
+
+Many other things also must happen on the main thread; often times SDL
+and Emscripten make efforts to "proxy" work to the main thread that
+must be there, but you have to be careful (and read more detailed
+documentation than this for the finer points).
+
+Even when using threads, your main thread needs to set an Emscripten
+mainloop that runs quickly and returns, or things will fail to work
+correctly.
+
+You should definitely read [Emscripten's pthreads docs](https://emscripten.org/docs/porting/pthreads.html)
+for all the finer points. Mostly SDL's thread API will work as expected,
+but is built on pthreads, so it shares the same little incompatibilities
+that are documented there, such as where you can use a mutex, and when
+a thread will start running, etc.
+
+
+IMPORTANT: You have to decide to either build something that uses
+threads or something that doesn't; you can't have one build
+that works everywhere. This is an Emscripten (or maybe WebAssembly?
+Or just web browsers in general?) limitation. If you aren't using
+threads, it's easier to not enable them at all, at build time.
+
+If you use threads, you _have to_ run from a web server that has
+[COOP/COEP headers set correctly](https://web.dev/why-coop-coep/)
+or your program will fail to start at all.
+
+If building with threads, `__EMSCRIPTEN_PTHREADS__` will be defined
+for checking with the C preprocessor, so you can build something
+different depending on what sort of build you're compiling.
+
+
+## Audio
+
+Audio works as expected at the API level, but not exactly like other
+platforms.
+
+You'll only see a single default audio device. Audio capture also works;
+if the browser pops up a prompt to ask for permission to access the
+microphone, the SDL_OpenAudioDevice call will succeed and start producing
+silence at a regular interval. Once the user approves the request, real
+audio data will flow. If the user denies it, the app is not informed and
+will just continue to receive silence.
+
+Modern web browsers will not permit web pages to produce sound before the
+user has interacted with them (clicked or tapped on them, usually); 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.
+
+SDL will allow you to open the audio device for playback in this
+circumstance, and your audio callback will fire, but SDL will throw the audio
+data away until the user interacts with the page. This helps apps that depend
+on the audio callback to make progress, and also keeps audio playback in sync
+once the app is finally allowed to make noise.
+
+There are two reasonable ways to deal with the silence at the app level:
+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, and the user can reasonably opt-in to listening.
+
+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.
+
+
+## Rendering
+
+If you use SDL's 2D render API, it will use GLES2 internally, which
+Emscripten will turn into WebGL calls. You can also use OpenGL ES 2
+directly by creating a GL context and drawing into it.
+
+Calling SDL_RenderPresent (or SDL_GL_SwapWindow) will not actually
+present anything on the screen until your return from your mainloop
+function.
+
+
+## Building SDL/emscripten
+
+First: do you _really_ need to build SDL from source?
+
+If you aren't developing SDL itself, have a desire to mess with its source
+code, or need something on the bleeding edge, don't build SDL. Just use
+Emscripten's packaged version!
+
+Compile and link your app with `-sUSE_SDL=2` and it'll use a build of
+SDL packaged with Emscripten. This comes from the same source code and
+fixes the Emscripten project makes to SDL are generally merged into SDL's
+revision control, so often this is much easier for app developers.
+
+`-sUSE_SDL=1` will select Emscripten's JavaScript reimplementation of SDL
+1.2 instead; if you need SDL 1.2, this might be fine, but we generally
+recommend you don't use SDL 1.2 in modern times.
+
+
+If you want to build SDL, though...
+
+SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
+are likely to work, as well.
+
+
+Build:
+
+This works on Linux/Unix and macOS. Please send comments about Windows.
+
+Make sure you've [installed emsdk](https://emscripten.org/docs/getting_started/downloads.html)
+first, and run `source emsdk_env.sh` at the command line so it finds the
+tools.
+
+(These configure options might be overkill, but this has worked for me.)
+
+```bash
+cd SDL
+mkdir build
+cd build
+emconfigure ../configure --host=wasm32-unknown-emscripten --disable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3"
+emmake make -j4
+```
+
+If you want to build with thread support, something like this works:
+
+```bash
+emconfigure ../configure --host=wasm32-unknown-emscripten --enable-pthreads --disable-assembly --disable-cpuinfo CFLAGS="-sUSE_SDL=0 -O3 -pthread" LDFLAGS="-pthread"
+```
+
+Or with cmake:
+
+```bash
+mkdir build
+cd build
+emcmake cmake ..
+emmake make -j4
+```
+
+To build one of the tests:
+
+```bash
+cd test/
+emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html
+```
+
+## Building your app
+
+You need to compile with `emcc` instead of `gcc` or `clang` or whatever, but
+mostly it uses the same command line arguments as Clang.
+
+Link against the SDL/build/.libs/libSDL2.a file you generated by building SDL,
+link with `-sUSE_SDL=2` to use Emscripten's prepackaged SDL2 build.
+
+Usually you would produce a binary like this:
+
+```bash
+gcc -o mygame mygame.c  # or whatever
+```
+
+But for Emscripten, you want to output something else:
+
+```bash
+emcc -o index.html mygame.c
+```
+
+This will produce several files...support Javascript and WebAssembly (.wasm)
+files. The `-o index.html` will produce a simple HTML page that loads and
+runs your app. You will (probably) eventually want to replace or customize
+that file and do `-o index.js` instead to just build the code pieces.
+
+If you're working on a program of any serious size, you'll likely need to
+link with `-sALLOW_MEMORY_GROWTH=1 -sMAXIMUM_MEMORY=1gb` to get access
+to more memory. If using pthreads, you'll need the `-sMAXIMUM_MEMORY=1gb`
+or the app will fail to start on iOS browsers, but this might be a bug that
+goes away in the future.
+
+
+## Data files
+
+Your game probably has data files. Here's how to access them.
+
+Filesystem access works like a Unix filesystem; you have a single directory
+tree, possibly interpolated from several mounted locations, no drive letters,
+'/' for a path separator. You can access them with standard file APIs like
+open() or fopen() or SDL_RWops. You can read or write from the filesystem.
+
+By default, you probably have a "MEMFS" filesystem (all files are stored in
+memory, but access to them is immediate and doesn't need to block). There are
+other options, like "IDBFS" (files are stored in a local database, so they
+don't need to be in RAM all the time and they can persist between runs of the
+program, but access is not synchronous). You can mix and match these file
+systems, mounting a MEMFS filesystem at one place and idbfs elsewhere, etc,
+but that's beyond the scope of this document. Please refer to Emscripten's
+[page on the topic](https://emscripten.org/docs/porting/files/file_systems_overview.html)
+for more info.
+
+The _easiest_ (but not the best) way to get at your data files is to embed
+them in the app itself. Emscripten's linker has support for automating this.
+
+```bash
+emcc -o index.html loopwave.c --embed-file=../test/sample.wav@/sounds/sample.wav
+```
+
+This will pack ../test/sample.wav in your app, and make it available at
+"/sounds/sample.wav" at runtime. Emscripten makes sure this data is available
+before your main() function runs, and since it's in MEMFS, you can just
+read it like you do on other platforms. `--embed-file` can also accept a
+directory to pack an entire tree, and you can specify the argument multiple
+times to pack unrelated things into the final installation.
+
+Note that this is absolutely the best approach if you have a few small
+files to include and shouldn't worry about the issue further. However, if you
+have hundreds of megabytes and/or thousands of files, this is not so great,
+since the user will download it all every time they load your page, and it
+all has to live in memory at runtime.
+
+[Emscripten's documentation on the matter](https://emscripten.org/docs/porting/files/packaging_files.html)
+gives other options and details, and is worth a read.
+
+
+## Debugging
+
+Debugging web apps is a mixed bag. You should compile and link with
+`-gsource-map`, which embeds a ton of source-level debugging information into
+the build, and make sure _the app source code is available on the web server_,
+which is often a scary proposition for various reasons.
+
+When you debug from the browser's tools and hit a breakpoint, you can step
+through the actual C/C++ source code, though, which can be nice.
+
+If you try debugging in Firefox and it doesn't work well for no apparent
+reason, try Chrome, and vice-versa. These tools are still relatively new,
+and improving all the time.
+
+SDL_Log() (or even plain old printf) will write to the Javascript console,
+and honestly I find printf-style debugging to be easier than setting up a build
+for proper debugging, so use whatever tools work best for you.
+
+
+## Questions?
+
+Please give us feedback on this document at [the SDL bug tracker](https://github.com/libsdl-org/SDL/issues).
+If something is wrong or unclear, we want to know!
+
+
+

+ 176 - 176
docs/README-gdk.md

@@ -1,176 +1,176 @@
-GDK
-=====
-
-This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
-
-Windows (GDK) and  Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets.
-
-
-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))
-* For Xbox, you will need the corresponding GDKX version (licensed developers only)
-* 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).
-
-* Single-player games have some additional features available:
-  * Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
-  * `SDL_GetPrefPath` still works, but only for single-player titles.
-
-  These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!
-
-* 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.
-
-Xbox GDKX Setup
----------------------
-In general, the same process in the Windows GDK instructions work. There are just a few additional notes:
-* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target
-* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target
-* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define
-* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox)
-* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons)
-* To create a package, use:
-  `makepkg pack /f PackageLayout.xml /lt /d . /pd Package`
-* To install the package, use:
-  `xbapp install [PACKAGE].xvc`
-* For some reason, if you make changes that require SDL2.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again
-* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets
-
-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).
+GDK
+=====
+
+This port allows SDL applications to run via Microsoft's Game Development Kit (GDK).
+
+Windows (GDK) and  Xbox One/Xbox Series (GDKX) are both supported and all the required code is included in this public SDL release. However, only licensed Xbox developers have access to the GDKX libraries which will allow you to build the Xbox targets.
+
+
+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))
+* For Xbox, you will need the corresponding GDKX version (licensed developers only)
+* 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).
+
+* Single-player games have some additional features available:
+  * Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer.
+  * `SDL_GetPrefPath` still works, but only for single-player titles.
+
+  These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values!
+
+* 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.
+
+Xbox GDKX Setup
+---------------------
+In general, the same process in the Windows GDK instructions work. There are just a few additional notes:
+* For Xbox One consoles, use the Gaming.Xbox.XboxOne.x64 target
+* For Xbox Series consoles, use the Gaming.Xbox.Scarlett.x64 target
+* The Xbox One target sets the `__XBOXONE__` define and the Xbox Series target sets the `__XBOXSERIES__` define
+* You don't need to link against the Xbox.Services Thunks lib nor include that dll in your package (it doesn't exist for Xbox)
+* The shader blobs for Xbox are created in a pre-build step for the Xbox targets, rather than included in the source (due to NDA and version compatability reasons)
+* To create a package, use:
+  `makepkg pack /f PackageLayout.xml /lt /d . /pd Package`
+* To install the package, use:
+  `xbapp install [PACKAGE].xvc`
+* For some reason, if you make changes that require SDL2.dll to build, and you are running through the debugger (instead of a package), you have to rebuild your .exe target for the debugger to recognize the dll has changed and needs to be transferred to the console again
+* While there are successful releases of Xbox titles using this port, it is not as extensively tested as other targets
+
+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
docs/README-gesture.md

@@ -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
docs/README-git.md

@@ -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
docs/README-hg.md

@@ -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 - 307
docs/README-ios.md

@@ -1,307 +1,307 @@
-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 ...
-
-    #ifdef __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
+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 ...
+
+    #ifdef __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
docs/README-kmsbsd.md

@@ -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
docs/README-linux.md

@@ -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 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"
-
+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 - 285
docs/README-macos.md

@@ -1,285 +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.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!
-
+# 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!
+

+ 28 - 28
docs/README-n3ds.md

@@ -1,28 +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.
+# 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
docs/README-nacl.md

@@ -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 - 44
docs/README-ngage.md

@@ -1,44 +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.
+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
docs/README-os2.md

@@ -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 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
docs/README-pandora.md

@@ -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
docs/README-platforms.md

@@ -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
docs/README-porting.md

@@ -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 - 51
docs/README-ps2.md

@@ -1,51 +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
+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
docs/README-psp.md

@@ -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
docs/README-raspberrypi.md

@@ -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 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
docs/README-riscos.md

@@ -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
docs/README-touch.md

@@ -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 - 60
docs/README-versions.md

@@ -1,60 +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.
+# 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
docs/README-visualc.md

@@ -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
docs/README-vita.md

@@ -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
docs/README-wince.md

@@ -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
docs/README-windows.md

@@ -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.
+

+ 519 - 519
docs/README-winrt.md

@@ -1,519 +1,519 @@
-WinRT
-=====
-
-This port allows SDL applications to run on Microsoft's platforms that require
-use of "Windows Runtime", aka. "WinRT", APIs.  Microsoft may, in some cases,
-refer to them as either "Windows Store", or for Windows 10, "UWP" apps.
-
-In the past, SDL has supported Windows RT 8.x, Windows Phone, etc, but in
-modern times this port is focused on UWP apps, which run on Windows 10,
-and modern Xbox consoles.
-
-
-Requirements
-------------
-
-* Microsoft Visual C++ (aka Visual Studio) 2019.
-  - Free, "Community" or "Express" editions may be used, so long as they
-    include support for either "Windows Store" or "Windows Phone" apps.
-    "Express" versions marked as supporting "Windows Desktop" development
-    typically do not include support for creating WinRT apps, to note.
-    (The "Community" editions of Visual C++ do, however, support both
-    desktop/Win32 and WinRT development).
-* A valid Microsoft account - This requirement is not imposed by SDL, but
-  rather by Microsoft's Visual C++ toolchain.  This is required to launch or
-  debug apps.
-
-
-Status
-------
-
-Here is a rough list of what works, and what doesn't:
-
-* What works:
-  * compilation via Visual C++ 2019.
-  * compile-time platform detection for SDL programs.  The C/C++ #define,
-    `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT.
-  * GPU-accelerated 2D rendering, via SDL_Renderer.
-  * OpenGL ES 2, via the ANGLE library (included separately from SDL)
-  * software rendering, via either SDL_Surface (optionally in conjunction with
-    SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the
-    SDL_Renderer APIs
-  * threads
-  * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(),
-    SDL_GetPerformanceFrequency(), etc.)
-  * file I/O via SDL_RWops
-  * mouse input  (unsupported on Windows Phone)
-  * audio, via SDL's WASAPI backend (if you want to record, your app must
-    have "Microphone" capabilities enabled in its manifest, and the user must
-    not have blocked access. Otherwise, capture devices will fail to work,
-    presenting as a device disconnect shortly after opening it.)
-  * .DLL file loading.  Libraries *MUST* be packaged inside applications.  Loading
-    anything outside of the app is not supported.
-  * system path retrieval via SDL's filesystem APIs
-  * game controllers.  Support is provided via the SDL_Joystick and
-    SDL_GameController APIs, and is backed by Microsoft's XInput API.  Please
-    note, however, that Windows limits game-controller support in UWP apps to,
-    "Xbox compatible controllers" (many controllers that work in Win32 apps,
-    do not work in UWP, due to restrictions in UWP itself.)
-  * multi-touch input
-  * app events.  SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
-    appropriate.
-  * window events
-  * using Direct3D 11.x APIs outside of SDL.  Non-XAML / Direct3D-only apps can
-    choose to render content directly via Direct3D, using SDL to manage the
-    internal WinRT window, as well as input and audio.  (Use
-    SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into
-    IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.)
-
-* What partially works:
-  * keyboard input.  Most of WinRT's documented virtual keys are supported, as
-    well as many keys with documented hardware scancodes.  Converting
-    SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs
-    (MapVirtualKey()) in Microsoft's Windows Store / UWP APIs.
-  * SDLmain.  WinRT uses a different signature for each app's main() function.
-    SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
-    (in `SDL\src\main\winrt\`) directly in order for their C-style main()
-    functions to be called.
-
-* What doesn't work:
-  * compilation with anything other than Visual C++
-  * programmatically-created custom cursors.  These don't appear to be supported
-    by WinRT.  Different OS-provided cursors can, however, be created via
-    SDL_CreateSystemCursor() (unsupported on Windows Phone)
-  * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal().  This are not currently
-    supported by WinRT itself.
-  * joysticks and game controllers that either are not supported by
-    Microsoft's XInput API, or are not supported within UWP apps (many
-    controllers that work in Win32, do not work in UWP, due to restrictions in
-    UWP itself).
-  * turning off VSync when rendering on Windows Phone.  Attempts to turn VSync
-    off on Windows Phone result either in Direct3D not drawing anything, or it
-    forcing VSync back on.  As such, SDL_RENDERER_PRESENTVSYNC will always get
-    turned-on on Windows Phone.  This limitation is not present in non-Phone
-    WinRT (such as Windows 8.x), where turning off VSync appears to work.
-  * probably anything else that's not listed as supported
-
-
-
-Upgrade Notes
--------------
-
-#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3
-
-SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath().
-The fixes may affect older, SDL 2.0.3-based apps' save data.  Please note
-that these changes only apply to SDL-based WinRT apps, and not to apps for
-any other platform.
-
-1. SDL_GetPrefPath() would return an invalid path, one in which the path's
-   directory had not been created.  Attempts to create files there
-   (via fopen(), for example), would fail, unless that directory was
-   explicitly created beforehand.
-
-2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside
-   a WinRT 'Roaming' folder, the contents of which get automatically
-   synchronized across multiple devices.  This process can occur while an
-   application runs, and can cause existing save-data to be overwritten
-   at unexpected times, with data from other devices.  (Windows Phone apps
-   written with SDL 2.0.3 did not utilize a Roaming folder, due to API
-   restrictions in Windows Phone 8.0).
-
-
-SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by:
-
-1. making sure that SDL_GetPrefPath() returns a directory in which data
-   can be written to immediately, without first needing to create directories.
-
-2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the
-   contents of which do not automatically get synchronized across devices
-   (and which require less work to use safely, in terms of data integrity).
-
-Apps that wish to get their Roaming folder's path can do so either by using
-SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a
-UCS-2/wide-char string), or directly through the WinRT class,
-Windows.Storage.ApplicationData.
-
-
-
-Setup, High-Level Steps
------------------------
-
-The steps for setting up a project for an SDL/WinRT app looks like the
-following, at a high-level:
-
-1. create a new Visual C++ project using Microsoft's template for a,
-   "Direct3D App".
-2. remove most of the files from the project.
-3. make your app's project directly reference SDL/WinRT's own Visual C++
-   project file, via use of Visual C++'s "References" dialog.  This will setup
-   the linker, and will copy SDL's .dll files to your app's final output.
-4. adjust your app's build settings, at minimum, telling it where to find SDL's
-   header files.
-5. add files that contains a WinRT-appropriate main function, along with some
-   data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls)
-   work properly.
-6. add SDL-specific app code.
-7. build and run your app.
-
-
-Setup, Detailed Steps
----------------------
-
-### 1. Create a new project ###
-
-Create a new project using one of Visual C++'s templates for a plain, non-XAML,
-"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use).  If you
-don't see one of these templates, in Visual C++'s 'New Project' dialog, try
-using the textbox titled, 'Search Installed Templates' to look for one.
-
-
-### 2. Remove unneeded files from the project ###
-
-In the new project, delete any file that has one of the following extensions:
-
-- .cpp
-- .h
-- .hlsl
-
-When you are done, you should be left with a few files, each of which will be a
-necessary part of your app's project.  These files will consist of:
-
-- an .appxmanifest file, which contains metadata on your WinRT app.  This is
-  similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android.
-- a few .png files, one of which is a splash screen (displayed when your app
-  launches), others are app icons.
-- a .pfx file, used for code signing purposes.
-
-
-### 3. Add references to SDL's project files ###
-
-SDL/WinRT can be built in multiple variations, spanning across three different
-CPU architectures (x86, x64, and ARM) and two different configurations
-(Debug and Release).  WinRT and Visual C++ do not currently provide a means
-for combining multiple variations of one library into a single file.
-Furthermore, it does not provide an easy means for copying pre-built .dll files
-into your app's final output (via Post-Build steps, for example).  It does,
-however, provide a system whereby an app can reference the MSVC projects of
-libraries such that, when the app is built:
-
-1. each library gets built for the appropriate CPU architecture(s) and WinRT
-   platform(s).
-2. each library's output, such as .dll files, get copied to the app's build
-   output.
-
-To set this up for SDL/WinRT, you'll need to run through the following steps:
-
-1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then
-   "Solution Explorer")
-2. right click on your app's solution.
-3. navigate to "Add", then to "Existing Project..."
-4. find SDL/WinRT's Visual C++ project file and open it, in the `VisualC-WinRT`
-   directory.
-5. once the project has been added, right-click on your app's project and
-   select, "References..."
-6. click on the button titled, "Add New Reference..."
-7. check the box next to SDL
-8. click OK to close the dialog
-9. SDL will now show up in the list of references.  Click OK to close that
-   dialog.
-
-Your project is now linked to SDL's project, insofar that when the app is
-built, SDL will be built as well, with its build output getting included with
-your app.
-
-
-### 4. Adjust Your App's Build Settings ###
-
-Some build settings need to be changed in your app's project.  This guide will
-outline the following:
-
-- making sure that the compiler knows where to find SDL's header files
-- **Optional for C++, but NECESSARY for compiling C code:** telling the
-  compiler not to use Microsoft's C++ extensions for WinRT development.
-- **Optional:** telling the compiler not generate errors due to missing
-  precompiled header files.
-
-To change these settings:
-
-1. right-click on the project
-2. choose "Properties"
-3. in the drop-down box next to "Configuration", choose, "All Configurations"
-4. in the drop-down box next to "Platform", choose, "All Platforms"
-5. in the left-hand list, expand the "C/C++" section
-6. select "General"
-7. edit the "Additional Include Directories" setting, and add a path to SDL's
-   "include" directory
-8. **Optional: to enable compilation of C code:** change the setting for
-   "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No".  If you're
-   working with a completely C++ based project, this step can usually be
-   omitted.
-9. **Optional: to disable precompiled headers (which can produce
-   'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand
-   list, select "Precompiled Headers", then change the setting for "Precompiled
-   Header" from "Use (/Yu)" to "Not Using Precompiled Headers".
-10. close the dialog, saving settings, by clicking the "OK" button
-
-
-### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ###
-
-A few files should be included directly in your app's MSVC project, specifically:
-1. a WinRT-appropriate main function (which is different than main() functions on
-   other platforms)
-2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor
-   (if and when the app needs to do so).  *If this cursor resource is not
-   included, mouse-position reporting may fail if and when the cursor is
-   hidden, due to possible bugs/design-oddities in Windows itself.*
-
-To include these files for C/C++ projects:
-
-1. right-click on your project (again, in Visual C++'s Solution Explorer),
-   navigate to "Add", then choose "Existing Item...".
-2. navigate to the directory containing SDL's source code, then into its
-   subdirectory, 'src/main/winrt/'.  Select, then add, the following files:
-   - `SDL_winrt_main_NonXAML.cpp`
-   - `SDL2-WinRTResources.rc`
-   - `SDL2-WinRTResource_BlankCursor.cur`
-3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your
-   project), then click on "Properties...".
-4. in the drop-down box next to "Configuration", choose, "All Configurations"
-5. in the drop-down box next to "Platform", choose, "All Platforms"
-6. in the left-hand list, click on "C/C++"
-7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
-8. click the OK button.  This will close the dialog.
-
-**NOTE: C++/CX compilation is currently required in at least one file of your
-app's project.  This is to make sure that Visual C++'s linker builds a 'Windows
-Metadata' file (.winmd) for your app.  Not doing so can lead to build errors.**
-
-For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's
-main function, and generate SDL2-WinRTResources.res manually by using `rc` via
-the Developer Command Prompt and including it as a <Win32Resource> within the
-first <PropertyGroup> block in your Visual Studio project file.
-
-### 6. Add app code and assets ###
-
-At this point, you can add in SDL-specific source code.  Be sure to include a
-C-style main function (ie: `int main(int argc, char *argv[])`).  From there you
-should be able to create a single `SDL_Window` (WinRT apps can only have one
-window, at present), as well as an `SDL_Renderer`.  Direct3D will be used to
-draw content.  Events are received via SDL's usual event functions
-(`SDL_PollEvent`, etc.)  If you have a set of existing source files and assets,
-you can start adding them to the project now.  If not, or if you would like to
-make sure that you're setup correctly, some short and simple sample code is
-provided below.
-
-
-#### 6.A. ... when creating a new app ####
-
-If you are creating a new app (rather than porting an existing SDL-based app),
-or if you would just like a simple app to test SDL/WinRT with before trying to
-get existing code working, some working SDL/WinRT code is provided below.  To
-set this up:
-
-1. right click on your app's project
-2. select Add, then New Item.  An "Add New Item" dialog will show up.
-3. from the left-hand list, choose "Visual C++"
-4. from the middle/main list, choose "C++ File (.cpp)"
-5. near the bottom of the dialog, next to "Name:", type in a name for your
-source file, such as, "main.cpp".
-6. click on the Add button.  This will close the dialog, add the new file to
-your project, and open the file in Visual C++'s text editor.
-7. Copy and paste the following code into the new file, then save it.
-
-```c
-#include <SDL.h>
-
-int main(int argc, char **argv)
-{
-    SDL_DisplayMode mode;
-    SDL_Window * window = NULL;
-    SDL_Renderer * renderer = NULL;
-    SDL_Event evt;
-    SDL_bool keep_going = SDL_TRUE;
-
-    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
-        return 1;
-    } else if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
-        return 1;
-    } else if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
-        return 1;
-    }
-
-    while (keep_going) {
-        while (SDL_PollEvent(&evt)) {
-            if ((evt.type == SDL_KEYDOWN) && (evt.key.keysym.sym == SDLK_ESCAPE)) {
-                keep_going = SDL_FALSE;
-            }
-        }
-
-        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
-        SDL_RenderClear(renderer);
-        SDL_RenderPresent(renderer);
-    }
-
-    SDL_Quit();
-    return 0;
-}
-```
-
-#### 6.B. Adding code and assets ####
-
-If you have existing code and assets that you'd like to add, you should be able
-to add them now.  The process for adding a set of files is as such.
-
-1. right click on the app's project
-2. select Add, then click on "New Item..."
-3. open any source, header, or asset files as appropriate.  Support for C and
-C++ is available.
-
-Do note that WinRT only supports a subset of the APIs that are available to
-Win32-based apps.  Many portions of the Win32 API and the C runtime are not
-available.
-
-A list of unsupported C APIs can be found at
-<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
-
-General information on using the C runtime in WinRT can be found at
-<https://msdn.microsoft.com/en-us/library/hh972425.aspx>
-
-A list of supported Win32 APIs for WinRT apps can be found at
-<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>.  To note,
-the list of supported Win32 APIs for Windows Phone 8.0 is different.
-That list can be found at
-<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
-
-
-### 7. Build and run your app ###
-
-Your app project should now be setup, and you should be ready to build your app.
-To run it on the local machine, open the Debug menu and choose "Start
-Debugging".  This will build your app, then run your app full-screen.  To switch
-out of your app, press the Windows key.  Alternatively, you can choose to run
-your app in a window.  To do this, before building and running your app, find
-the drop-down menu in Visual C++'s toolbar that says, "Local Machine".  Expand
-this by clicking on the arrow on the right side of the list, then click on
-Simulator.  Once you do that, any time you build and run the app, the app will
-launch in window, rather than full-screen.
-
-
-#### 7.A. Running apps on older, ARM-based, "Windows RT" devices ####
-
-**These instructions do not include Windows Phone, despite Windows Phone
-typically running on ARM processors.**  They are specifically for devices
-that use the "Windows RT" operating system, which was a modified version of
-Windows 8.x that ran primarily on ARM-based tablet computers.
-
-To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
-
-- install Microsoft's "Remote Debugger" on the device.  Visual C++ installs and
-  debugs ARM-based apps via IP networks.
-- change a few options on the development machine, both to make sure it builds
-  for ARM (rather than x86 or x64), and to make sure it knows how to find the
-  Windows RT device (on the network).
-
-Microsoft's Remote Debugger can be found at
-<https://msdn.microsoft.com/en-us/library/hh441469.aspx>.  Please note
-that separate versions of this debugger exist for different versions of Visual
-C++, one each for MSVC 2015, 2013, and 2012.
-
-To setup Visual C++ to launch your app on an ARM device:
-
-1. make sure the Remote Debugger is running on your ARM device, and that it's on
-   the same IP network as your development machine.
-2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32".  Click
-   it, then change the value to "ARM".
-3. make sure Visual C++ knows the hostname or IP address of the ARM device.  To
-   do this:
-    1. open the app project's properties
-    2. select "Debugging"
-    3. next to "Machine Name", enter the hostname or IP address of the ARM
-       device
-    4. if, and only if, you've turned off authentication in the Remote Debugger,
-       then change the setting for "Require Authentication" to No
-    5. click "OK"
-4. build and run the app (from Visual C++).  The first time you do this, a
-   prompt will show up on the ARM device, asking for a Microsoft Account.  You
-   do, unfortunately, need to log in here, and will need to follow the
-   subsequent registration steps in order to launch the app.  After you do so,
-   if the app didn't already launch, try relaunching it again from within Visual
-   C++.
-
-
-Troubleshooting
----------------
-
-#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'"
-
-Try adding the following to your linker flags.  In MSVC, this can be done by
-right-clicking on the app project, navigating to Configuration Properties ->
-Linker -> Command Line, then adding them to the Additional Options
-section.
-
-* For Release builds / MSVC-Configurations, add:
-
-    /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib
-
-* For Debug builds / MSVC-Configurations, add:
-
-    /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib
-
-
-#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values
-
-This may be caused by a bug in Windows itself, whereby hiding the mouse
-cursor can cause mouse-position reporting to fail.
-
-SDL provides a workaround for this, but it requires that an app links to a
-set of Win32-style cursor image-resource files.  A copy of suitable resource
-files can be found in `src/main/winrt/`.  Adding them to an app's Visual C++
-project file should be sufficient to get the app to use them.
-
-
-#### SDL's Visual Studio project file fails to open, with message, "The system can't find the file specified."
-
-This can be caused for any one of a few reasons, which Visual Studio can
-report, but won't always do so in an up-front manner.
-
-To help determine why this error comes up:
-
-1. open a copy of Visual Studio without opening a project file.  This can be
-   accomplished via Windows' Start Menu, among other means.
-2. show Visual Studio's Output window.  This can be done by going to VS'
-   menu bar, then to View, and then to Output.
-3. try opening the SDL project file directly by going to VS' menu bar, then
-   to File, then to Open, then to Project/Solution.  When a File-Open dialog
-   appears, open the SDL project (such as the one in SDL's source code, in its
-   directory, VisualC-WinRT/UWP_VS2015/).
-4. after attempting to open SDL's Visual Studio project file, additional error
-   information will be output to the Output window.
-
-If Visual Studio reports (via its Output window) that the project:
-
-"could not be loaded because it's missing install components. To fix this launch Visual Studio setup with the following selections:
-Microsoft.VisualStudio.ComponentGroup.UWP.VC"
-
-... then you will need to re-launch Visual Studio's installer, and make sure that
-the workflow for "Universal Windows Platform development" is checked, and that its
-optional component, "C++ Universal Windows Platform tools" is also checked.  While
-you are there, if you are planning on targeting UWP / Windows 10, also make sure
-that you check the optional component, "Windows 10 SDK (10.0.10240.0)".  After
-making sure these items are checked as-appropriate, install them.
-
-Once you install these components, try re-launching Visual Studio, and re-opening
-the SDL project file.  If you still get the error dialog, try using the Output
-window, again, seeing what Visual Studio says about it.
-
-
-#### Game controllers / joysticks aren't working!
-
-Windows only permits certain game controllers and joysticks to work within
-WinRT / UWP apps.  Even if a game controller or joystick works in a Win32
-app, that device is not guaranteed to work inside a WinRT / UWP app.
-
-According to Microsoft, "Xbox compatible controllers" should work inside
-UWP apps, potentially with more working in the future.  This includes, but
-may not be limited to, Microsoft-made Xbox controllers and USB adapters.
-(Source: https://social.msdn.microsoft.com/Forums/en-US/9064838b-e8c3-4c18-8a83-19bf0dfe150d/xinput-fails-to-detect-game-controllers?forum=wpdevelop)
-
-
+WinRT
+=====
+
+This port allows SDL applications to run on Microsoft's platforms that require
+use of "Windows Runtime", aka. "WinRT", APIs.  Microsoft may, in some cases,
+refer to them as either "Windows Store", or for Windows 10, "UWP" apps.
+
+In the past, SDL has supported Windows RT 8.x, Windows Phone, etc, but in
+modern times this port is focused on UWP apps, which run on Windows 10,
+and modern Xbox consoles.
+
+
+Requirements
+------------
+
+* Microsoft Visual C++ (aka Visual Studio) 2019.
+  - Free, "Community" or "Express" editions may be used, so long as they
+    include support for either "Windows Store" or "Windows Phone" apps.
+    "Express" versions marked as supporting "Windows Desktop" development
+    typically do not include support for creating WinRT apps, to note.
+    (The "Community" editions of Visual C++ do, however, support both
+    desktop/Win32 and WinRT development).
+* A valid Microsoft account - This requirement is not imposed by SDL, but
+  rather by Microsoft's Visual C++ toolchain.  This is required to launch or
+  debug apps.
+
+
+Status
+------
+
+Here is a rough list of what works, and what doesn't:
+
+* What works:
+  * compilation via Visual C++ 2019.
+  * compile-time platform detection for SDL programs.  The C/C++ #define,
+    `__WINRT__`, will be set to 1 (by SDL) when compiling for WinRT.
+  * GPU-accelerated 2D rendering, via SDL_Renderer.
+  * OpenGL ES 2, via the ANGLE library (included separately from SDL)
+  * software rendering, via either SDL_Surface (optionally in conjunction with
+    SDL_GetWindowSurface() and SDL_UpdateWindowSurface()) or via the
+    SDL_Renderer APIs
+  * threads
+  * timers (via SDL_GetTicks(), SDL_AddTimer(), SDL_GetPerformanceCounter(),
+    SDL_GetPerformanceFrequency(), etc.)
+  * file I/O via SDL_RWops
+  * mouse input  (unsupported on Windows Phone)
+  * audio, via SDL's WASAPI backend (if you want to record, your app must
+    have "Microphone" capabilities enabled in its manifest, and the user must
+    not have blocked access. Otherwise, capture devices will fail to work,
+    presenting as a device disconnect shortly after opening it.)
+  * .DLL file loading.  Libraries *MUST* be packaged inside applications.  Loading
+    anything outside of the app is not supported.
+  * system path retrieval via SDL's filesystem APIs
+  * game controllers.  Support is provided via the SDL_Joystick and
+    SDL_GameController APIs, and is backed by Microsoft's XInput API.  Please
+    note, however, that Windows limits game-controller support in UWP apps to,
+    "Xbox compatible controllers" (many controllers that work in Win32 apps,
+    do not work in UWP, due to restrictions in UWP itself.)
+  * multi-touch input
+  * app events.  SDL_APP_WILLENTER* and SDL_APP_DIDENTER* events get sent out as
+    appropriate.
+  * window events
+  * using Direct3D 11.x APIs outside of SDL.  Non-XAML / Direct3D-only apps can
+    choose to render content directly via Direct3D, using SDL to manage the
+    internal WinRT window, as well as input and audio.  (Use
+    SDL_GetWindowWMInfo() to get the WinRT 'CoreWindow', and pass it into
+    IDXGIFactory2::CreateSwapChainForCoreWindow() as appropriate.)
+
+* What partially works:
+  * keyboard input.  Most of WinRT's documented virtual keys are supported, as
+    well as many keys with documented hardware scancodes.  Converting
+    SDL_Scancodes to or from SDL_Keycodes may not work, due to missing APIs
+    (MapVirtualKey()) in Microsoft's Windows Store / UWP APIs.
+  * SDLmain.  WinRT uses a different signature for each app's main() function.
+    SDL-based apps that use this port must compile in SDL_winrt_main_NonXAML.cpp
+    (in `SDL\src\main\winrt\`) directly in order for their C-style main()
+    functions to be called.
+
+* What doesn't work:
+  * compilation with anything other than Visual C++
+  * programmatically-created custom cursors.  These don't appear to be supported
+    by WinRT.  Different OS-provided cursors can, however, be created via
+    SDL_CreateSystemCursor() (unsupported on Windows Phone)
+  * SDL_WarpMouseInWindow() or SDL_WarpMouseGlobal().  This are not currently
+    supported by WinRT itself.
+  * joysticks and game controllers that either are not supported by
+    Microsoft's XInput API, or are not supported within UWP apps (many
+    controllers that work in Win32, do not work in UWP, due to restrictions in
+    UWP itself).
+  * turning off VSync when rendering on Windows Phone.  Attempts to turn VSync
+    off on Windows Phone result either in Direct3D not drawing anything, or it
+    forcing VSync back on.  As such, SDL_RENDERER_PRESENTVSYNC will always get
+    turned-on on Windows Phone.  This limitation is not present in non-Phone
+    WinRT (such as Windows 8.x), where turning off VSync appears to work.
+  * probably anything else that's not listed as supported
+
+
+
+Upgrade Notes
+-------------
+
+#### SDL_GetPrefPath() usage when upgrading WinRT apps from SDL 2.0.3
+
+SDL 2.0.4 fixes two bugs found in the WinRT version of SDL_GetPrefPath().
+The fixes may affect older, SDL 2.0.3-based apps' save data.  Please note
+that these changes only apply to SDL-based WinRT apps, and not to apps for
+any other platform.
+
+1. SDL_GetPrefPath() would return an invalid path, one in which the path's
+   directory had not been created.  Attempts to create files there
+   (via fopen(), for example), would fail, unless that directory was
+   explicitly created beforehand.
+
+2. SDL_GetPrefPath(), for non-WinPhone-based apps, would return a path inside
+   a WinRT 'Roaming' folder, the contents of which get automatically
+   synchronized across multiple devices.  This process can occur while an
+   application runs, and can cause existing save-data to be overwritten
+   at unexpected times, with data from other devices.  (Windows Phone apps
+   written with SDL 2.0.3 did not utilize a Roaming folder, due to API
+   restrictions in Windows Phone 8.0).
+
+
+SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by:
+
+1. making sure that SDL_GetPrefPath() returns a directory in which data
+   can be written to immediately, without first needing to create directories.
+
+2. basing SDL_GetPrefPath() off of a different, non-Roaming folder, the
+   contents of which do not automatically get synchronized across devices
+   (and which require less work to use safely, in terms of data integrity).
+
+Apps that wish to get their Roaming folder's path can do so either by using
+SDL_WinRTGetFSPathUTF8(), SDL_WinRTGetFSPathUNICODE() (which returns a
+UCS-2/wide-char string), or directly through the WinRT class,
+Windows.Storage.ApplicationData.
+
+
+
+Setup, High-Level Steps
+-----------------------
+
+The steps for setting up a project for an SDL/WinRT app looks like the
+following, at a high-level:
+
+1. create a new Visual C++ project using Microsoft's template for a,
+   "Direct3D App".
+2. remove most of the files from the project.
+3. make your app's project directly reference SDL/WinRT's own Visual C++
+   project file, via use of Visual C++'s "References" dialog.  This will setup
+   the linker, and will copy SDL's .dll files to your app's final output.
+4. adjust your app's build settings, at minimum, telling it where to find SDL's
+   header files.
+5. add files that contains a WinRT-appropriate main function, along with some
+   data to make sure mouse-cursor-hiding (via SDL_ShowCursor(SDL_DISABLE) calls)
+   work properly.
+6. add SDL-specific app code.
+7. build and run your app.
+
+
+Setup, Detailed Steps
+---------------------
+
+### 1. Create a new project ###
+
+Create a new project using one of Visual C++'s templates for a plain, non-XAML,
+"Direct3D App" (XAML support for SDL/WinRT is not yet ready for use).  If you
+don't see one of these templates, in Visual C++'s 'New Project' dialog, try
+using the textbox titled, 'Search Installed Templates' to look for one.
+
+
+### 2. Remove unneeded files from the project ###
+
+In the new project, delete any file that has one of the following extensions:
+
+- .cpp
+- .h
+- .hlsl
+
+When you are done, you should be left with a few files, each of which will be a
+necessary part of your app's project.  These files will consist of:
+
+- an .appxmanifest file, which contains metadata on your WinRT app.  This is
+  similar to an Info.plist file on iOS, or an AndroidManifest.xml on Android.
+- a few .png files, one of which is a splash screen (displayed when your app
+  launches), others are app icons.
+- a .pfx file, used for code signing purposes.
+
+
+### 3. Add references to SDL's project files ###
+
+SDL/WinRT can be built in multiple variations, spanning across three different
+CPU architectures (x86, x64, and ARM) and two different configurations
+(Debug and Release).  WinRT and Visual C++ do not currently provide a means
+for combining multiple variations of one library into a single file.
+Furthermore, it does not provide an easy means for copying pre-built .dll files
+into your app's final output (via Post-Build steps, for example).  It does,
+however, provide a system whereby an app can reference the MSVC projects of
+libraries such that, when the app is built:
+
+1. each library gets built for the appropriate CPU architecture(s) and WinRT
+   platform(s).
+2. each library's output, such as .dll files, get copied to the app's build
+   output.
+
+To set this up for SDL/WinRT, you'll need to run through the following steps:
+
+1. open up the Solution Explorer inside Visual C++ (under the "View" menu, then
+   "Solution Explorer")
+2. right click on your app's solution.
+3. navigate to "Add", then to "Existing Project..."
+4. find SDL/WinRT's Visual C++ project file and open it, in the `VisualC-WinRT`
+   directory.
+5. once the project has been added, right-click on your app's project and
+   select, "References..."
+6. click on the button titled, "Add New Reference..."
+7. check the box next to SDL
+8. click OK to close the dialog
+9. SDL will now show up in the list of references.  Click OK to close that
+   dialog.
+
+Your project is now linked to SDL's project, insofar that when the app is
+built, SDL will be built as well, with its build output getting included with
+your app.
+
+
+### 4. Adjust Your App's Build Settings ###
+
+Some build settings need to be changed in your app's project.  This guide will
+outline the following:
+
+- making sure that the compiler knows where to find SDL's header files
+- **Optional for C++, but NECESSARY for compiling C code:** telling the
+  compiler not to use Microsoft's C++ extensions for WinRT development.
+- **Optional:** telling the compiler not generate errors due to missing
+  precompiled header files.
+
+To change these settings:
+
+1. right-click on the project
+2. choose "Properties"
+3. in the drop-down box next to "Configuration", choose, "All Configurations"
+4. in the drop-down box next to "Platform", choose, "All Platforms"
+5. in the left-hand list, expand the "C/C++" section
+6. select "General"
+7. edit the "Additional Include Directories" setting, and add a path to SDL's
+   "include" directory
+8. **Optional: to enable compilation of C code:** change the setting for
+   "Consume Windows Runtime Extension" from "Yes (/ZW)" to "No".  If you're
+   working with a completely C++ based project, this step can usually be
+   omitted.
+9. **Optional: to disable precompiled headers (which can produce
+   'stdafx.h'-related build errors, if setup incorrectly:** in the left-hand
+   list, select "Precompiled Headers", then change the setting for "Precompiled
+   Header" from "Use (/Yu)" to "Not Using Precompiled Headers".
+10. close the dialog, saving settings, by clicking the "OK" button
+
+
+### 5. Add a WinRT-appropriate main function, and a blank-cursor image, to the app. ###
+
+A few files should be included directly in your app's MSVC project, specifically:
+1. a WinRT-appropriate main function (which is different than main() functions on
+   other platforms)
+2. a Win32-style cursor resource, used by SDL_ShowCursor() to hide the mouse cursor
+   (if and when the app needs to do so).  *If this cursor resource is not
+   included, mouse-position reporting may fail if and when the cursor is
+   hidden, due to possible bugs/design-oddities in Windows itself.*
+
+To include these files for C/C++ projects:
+
+1. right-click on your project (again, in Visual C++'s Solution Explorer),
+   navigate to "Add", then choose "Existing Item...".
+2. navigate to the directory containing SDL's source code, then into its
+   subdirectory, 'src/main/winrt/'.  Select, then add, the following files:
+   - `SDL_winrt_main_NonXAML.cpp`
+   - `SDL2-WinRTResources.rc`
+   - `SDL2-WinRTResource_BlankCursor.cur`
+3. right-click on the file `SDL_winrt_main_NonXAML.cpp` (as listed in your
+   project), then click on "Properties...".
+4. in the drop-down box next to "Configuration", choose, "All Configurations"
+5. in the drop-down box next to "Platform", choose, "All Platforms"
+6. in the left-hand list, click on "C/C++"
+7. change the setting for "Consume Windows Runtime Extension" to "Yes (/ZW)".
+8. click the OK button.  This will close the dialog.
+
+**NOTE: C++/CX compilation is currently required in at least one file of your
+app's project.  This is to make sure that Visual C++'s linker builds a 'Windows
+Metadata' file (.winmd) for your app.  Not doing so can lead to build errors.**
+
+For non-C++ projects, you will need to call SDL_WinRTRunApp from your language's
+main function, and generate SDL2-WinRTResources.res manually by using `rc` via
+the Developer Command Prompt and including it as a <Win32Resource> within the
+first <PropertyGroup> block in your Visual Studio project file.
+
+### 6. Add app code and assets ###
+
+At this point, you can add in SDL-specific source code.  Be sure to include a
+C-style main function (ie: `int main(int argc, char *argv[])`).  From there you
+should be able to create a single `SDL_Window` (WinRT apps can only have one
+window, at present), as well as an `SDL_Renderer`.  Direct3D will be used to
+draw content.  Events are received via SDL's usual event functions
+(`SDL_PollEvent`, etc.)  If you have a set of existing source files and assets,
+you can start adding them to the project now.  If not, or if you would like to
+make sure that you're setup correctly, some short and simple sample code is
+provided below.
+
+
+#### 6.A. ... when creating a new app ####
+
+If you are creating a new app (rather than porting an existing SDL-based app),
+or if you would just like a simple app to test SDL/WinRT with before trying to
+get existing code working, some working SDL/WinRT code is provided below.  To
+set this up:
+
+1. right click on your app's project
+2. select Add, then New Item.  An "Add New Item" dialog will show up.
+3. from the left-hand list, choose "Visual C++"
+4. from the middle/main list, choose "C++ File (.cpp)"
+5. near the bottom of the dialog, next to "Name:", type in a name for your
+source file, such as, "main.cpp".
+6. click on the Add button.  This will close the dialog, add the new file to
+your project, and open the file in Visual C++'s text editor.
+7. Copy and paste the following code into the new file, then save it.
+
+```c
+#include <SDL.h>
+
+int main(int argc, char **argv)
+{
+    SDL_DisplayMode mode;
+    SDL_Window * window = NULL;
+    SDL_Renderer * renderer = NULL;
+    SDL_Event evt;
+    SDL_bool keep_going = SDL_TRUE;
+
+    if (SDL_Init(SDL_INIT_VIDEO) != 0) {
+        return 1;
+    } else if (SDL_GetCurrentDisplayMode(0, &mode) != 0) {
+        return 1;
+    } else if (SDL_CreateWindowAndRenderer(mode.w, mode.h, SDL_WINDOW_FULLSCREEN, &window, &renderer) != 0) {
+        return 1;
+    }
+
+    while (keep_going) {
+        while (SDL_PollEvent(&evt)) {
+            if ((evt.type == SDL_KEYDOWN) && (evt.key.keysym.sym == SDLK_ESCAPE)) {
+                keep_going = SDL_FALSE;
+            }
+        }
+
+        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
+        SDL_RenderClear(renderer);
+        SDL_RenderPresent(renderer);
+    }
+
+    SDL_Quit();
+    return 0;
+}
+```
+
+#### 6.B. Adding code and assets ####
+
+If you have existing code and assets that you'd like to add, you should be able
+to add them now.  The process for adding a set of files is as such.
+
+1. right click on the app's project
+2. select Add, then click on "New Item..."
+3. open any source, header, or asset files as appropriate.  Support for C and
+C++ is available.
+
+Do note that WinRT only supports a subset of the APIs that are available to
+Win32-based apps.  Many portions of the Win32 API and the C runtime are not
+available.
+
+A list of unsupported C APIs can be found at
+<http://msdn.microsoft.com/en-us/library/windows/apps/jj606124.aspx>
+
+General information on using the C runtime in WinRT can be found at
+<https://msdn.microsoft.com/en-us/library/hh972425.aspx>
+
+A list of supported Win32 APIs for WinRT apps can be found at
+<http://msdn.microsoft.com/en-us/library/windows/apps/br205757.aspx>.  To note,
+the list of supported Win32 APIs for Windows Phone 8.0 is different.
+That list can be found at
+<http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662956(v=vs.105).aspx>
+
+
+### 7. Build and run your app ###
+
+Your app project should now be setup, and you should be ready to build your app.
+To run it on the local machine, open the Debug menu and choose "Start
+Debugging".  This will build your app, then run your app full-screen.  To switch
+out of your app, press the Windows key.  Alternatively, you can choose to run
+your app in a window.  To do this, before building and running your app, find
+the drop-down menu in Visual C++'s toolbar that says, "Local Machine".  Expand
+this by clicking on the arrow on the right side of the list, then click on
+Simulator.  Once you do that, any time you build and run the app, the app will
+launch in window, rather than full-screen.
+
+
+#### 7.A. Running apps on older, ARM-based, "Windows RT" devices ####
+
+**These instructions do not include Windows Phone, despite Windows Phone
+typically running on ARM processors.**  They are specifically for devices
+that use the "Windows RT" operating system, which was a modified version of
+Windows 8.x that ran primarily on ARM-based tablet computers.
+
+To build and run the app on ARM-based, "Windows RT" devices, you'll need to:
+
+- install Microsoft's "Remote Debugger" on the device.  Visual C++ installs and
+  debugs ARM-based apps via IP networks.
+- change a few options on the development machine, both to make sure it builds
+  for ARM (rather than x86 or x64), and to make sure it knows how to find the
+  Windows RT device (on the network).
+
+Microsoft's Remote Debugger can be found at
+<https://msdn.microsoft.com/en-us/library/hh441469.aspx>.  Please note
+that separate versions of this debugger exist for different versions of Visual
+C++, one each for MSVC 2015, 2013, and 2012.
+
+To setup Visual C++ to launch your app on an ARM device:
+
+1. make sure the Remote Debugger is running on your ARM device, and that it's on
+   the same IP network as your development machine.
+2. from Visual C++'s toolbar, find a drop-down menu that says, "Win32".  Click
+   it, then change the value to "ARM".
+3. make sure Visual C++ knows the hostname or IP address of the ARM device.  To
+   do this:
+    1. open the app project's properties
+    2. select "Debugging"
+    3. next to "Machine Name", enter the hostname or IP address of the ARM
+       device
+    4. if, and only if, you've turned off authentication in the Remote Debugger,
+       then change the setting for "Require Authentication" to No
+    5. click "OK"
+4. build and run the app (from Visual C++).  The first time you do this, a
+   prompt will show up on the ARM device, asking for a Microsoft Account.  You
+   do, unfortunately, need to log in here, and will need to follow the
+   subsequent registration steps in order to launch the app.  After you do so,
+   if the app didn't already launch, try relaunching it again from within Visual
+   C++.
+
+
+Troubleshooting
+---------------
+
+#### Build fails with message, "error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker'"
+
+Try adding the following to your linker flags.  In MSVC, this can be done by
+right-clicking on the app project, navigating to Configuration Properties ->
+Linker -> Command Line, then adding them to the Additional Options
+section.
+
+* For Release builds / MSVC-Configurations, add:
+
+    /nodefaultlib:vccorlib /nodefaultlib:msvcrt vccorlib.lib msvcrt.lib
+
+* For Debug builds / MSVC-Configurations, add:
+
+    /nodefaultlib:vccorlibd /nodefaultlib:msvcrtd vccorlibd.lib msvcrtd.lib
+
+
+#### Mouse-motion events fail to get sent, or SDL_GetMouseState() fails to return updated values
+
+This may be caused by a bug in Windows itself, whereby hiding the mouse
+cursor can cause mouse-position reporting to fail.
+
+SDL provides a workaround for this, but it requires that an app links to a
+set of Win32-style cursor image-resource files.  A copy of suitable resource
+files can be found in `src/main/winrt/`.  Adding them to an app's Visual C++
+project file should be sufficient to get the app to use them.
+
+
+#### SDL's Visual Studio project file fails to open, with message, "The system can't find the file specified."
+
+This can be caused for any one of a few reasons, which Visual Studio can
+report, but won't always do so in an up-front manner.
+
+To help determine why this error comes up:
+
+1. open a copy of Visual Studio without opening a project file.  This can be
+   accomplished via Windows' Start Menu, among other means.
+2. show Visual Studio's Output window.  This can be done by going to VS'
+   menu bar, then to View, and then to Output.
+3. try opening the SDL project file directly by going to VS' menu bar, then
+   to File, then to Open, then to Project/Solution.  When a File-Open dialog
+   appears, open the SDL project (such as the one in SDL's source code, in its
+   directory, VisualC-WinRT/UWP_VS2015/).
+4. after attempting to open SDL's Visual Studio project file, additional error
+   information will be output to the Output window.
+
+If Visual Studio reports (via its Output window) that the project:
+
+"could not be loaded because it's missing install components. To fix this launch Visual Studio setup with the following selections:
+Microsoft.VisualStudio.ComponentGroup.UWP.VC"
+
+... then you will need to re-launch Visual Studio's installer, and make sure that
+the workflow for "Universal Windows Platform development" is checked, and that its
+optional component, "C++ Universal Windows Platform tools" is also checked.  While
+you are there, if you are planning on targeting UWP / Windows 10, also make sure
+that you check the optional component, "Windows 10 SDK (10.0.10240.0)".  After
+making sure these items are checked as-appropriate, install them.
+
+Once you install these components, try re-launching Visual Studio, and re-opening
+the SDL project file.  If you still get the error dialog, try using the Output
+window, again, seeing what Visual Studio says about it.
+
+
+#### Game controllers / joysticks aren't working!
+
+Windows only permits certain game controllers and joysticks to work within
+WinRT / UWP apps.  Even if a game controller or joystick works in a Win32
+app, that device is not guaranteed to work inside a WinRT / UWP app.
+
+According to Microsoft, "Xbox compatible controllers" should work inside
+UWP apps, potentially with more working in the future.  This includes, but
+may not be limited to, Microsoft-made Xbox controllers and USB adapters.
+(Source: https://social.msdn.microsoft.com/Forums/en-US/9064838b-e8c3-4c18-8a83-19bf0dfe150d/xinput-fails-to-detect-game-controllers?forum=wpdevelop)
+
+

+ 3 - 2
include/SDL_atomic.h

@@ -257,8 +257,9 @@ typedef void (*SDL_KernelMemoryBarrierFunc)();
 
 
 /**
- * \brief A type representing an atomic integer value.  It is a struct
- *        so people don't accidentally use numeric operations on it.
+ * A type representing an atomic integer value.
+ *
+ * It is a struct so people don't accidentally use numeric operations on it.
  */
 typedef struct SDL_atomic_t {
     int value;

+ 26 - 22
include/SDL_audio.h

@@ -166,16 +166,19 @@ typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream,
                                             int len);
 
 /**
- *  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 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)
+ * 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 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
 {
@@ -196,11 +199,11 @@ typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt,
                                           SDL_AudioFormat format);
 
 /**
- *  \brief Upper limit of filters in SDL_AudioCVT
+ * Upper limit of filters in SDL_AudioCVT
  *
- *  The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
- *  currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers,
- *  one of which is the terminating NULL pointer.
+ * The maximum number of SDL_AudioFilter functions in SDL_AudioCVT is
+ * currently limited to 9. The SDL_AudioCVT.filters array has 10 pointers, one
+ * of which is the terminating NULL pointer.
  */
 #define SDL_AUDIOCVT_MAX_FILTERS 9
 
@@ -408,13 +411,13 @@ extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired,
                                           SDL_AudioSpec * obtained);
 
 /**
- *  SDL Audio Device IDs.
+ * SDL Audio Device IDs.
  *
- *  A successful call to SDL_OpenAudio() is always device id 1, and legacy
- *  SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
- *  always returns devices >= 2 on success. The legacy calls are good both
- *  for backwards compatibility and when you don't care about multiple,
- *  specific, or capture devices.
+ * A successful call to SDL_OpenAudio() is always device id 1, and legacy SDL
+ * audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
+ * always returns devices >= 2 on success. The legacy calls are good both for
+ * backwards compatibility and when you don't care about multiple, specific,
+ * or capture devices.
  */
 typedef Uint32 SDL_AudioDeviceID;
 
@@ -874,8 +877,9 @@ extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src,
                                                       Uint32 * audio_len);
 
 /**
- *  Loads a WAV from a file.
- *  Compatibility convenience function.
+ * Loads a WAV from a file.
+ *
+ * Compatibility convenience function.
  */
 #define SDL_LoadWAV(file, spec, audio_buf, audio_len) \
     SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len)

+ 6 - 0
include/SDL_bits.h

@@ -56,6 +56,12 @@ extern __inline int _SDL_bsr_watcom(Uint32);
     modify exact [eax] nomemory;
 #endif
 
+/**
+ * Use this function to get the index of the most significant (set) bit in a
+ *
+ * \param x the number to find the MSB of
+ * \returns the index of the most significant bit of x, or -1 if x is 0.
+ */
 SDL_FORCE_INLINE int
 SDL_MostSignificantBitIndex32(Uint32 x)
 {

+ 4 - 3
include/SDL_blendmode.h

@@ -35,7 +35,7 @@ extern "C" {
 #endif
 
 /**
- *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
+ * The blend mode used in SDL_RenderCopy() and drawing operations.
  */
 typedef enum SDL_BlendMode
 {
@@ -60,7 +60,8 @@ typedef enum SDL_BlendMode
 } SDL_BlendMode;
 
 /**
- *  \brief The blend operation used when combining source and destination pixel components
+ * The blend operation used when combining source and destination pixel
+ * components
  */
 typedef enum SDL_BlendOperation
 {
@@ -72,7 +73,7 @@ typedef enum SDL_BlendOperation
 } SDL_BlendOperation;
 
 /**
- *  \brief The normalized factor used to multiply pixel components
+ * The normalized factor used to multiply pixel components
  */
 typedef enum SDL_BlendFactor
 {

+ 39 - 0
include/SDL_endian.h

@@ -180,6 +180,16 @@ extern __inline Uint16 SDL_Swap16(Uint16);
   parm   [ax]   \
   modify [ax];
 #else
+
+/**
+ * Use this function to swap the byte order of a 16-bit value.
+ *
+ * \param x the value to be swapped
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapBE16
+ * \sa SDL_SwapLE16
+ */
 SDL_FORCE_INLINE Uint16
 SDL_Swap16(Uint16 x)
 {
@@ -231,6 +241,16 @@ extern __inline Uint32 SDL_Swap32(Uint32);
   parm   [eax] \
   modify [eax];
 #else
+
+/**
+ * Use this function to swap the byte order of a 32-bit value.
+ *
+ * \param x the value to be swapped
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapBE32
+ * \sa SDL_SwapLE32
+ */
 SDL_FORCE_INLINE Uint32
 SDL_Swap32(Uint32 x)
 {
@@ -276,6 +296,16 @@ extern __inline Uint64 SDL_Swap64(Uint64);
   parm [eax edx]  \
   modify [eax edx];
 #else
+
+/**
+ * Use this function to swap the byte order of a 64-bit value.
+ *
+ * \param x the value to be swapped
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapBE64
+ * \sa SDL_SwapLE64
+ */
 SDL_FORCE_INLINE Uint64
 SDL_Swap64(Uint64 x)
 {
@@ -293,6 +323,15 @@ SDL_Swap64(Uint64 x)
 #endif
 
 
+/**
+ * Use this function to swap the byte order of a floating point value.
+ *
+ * \param x the value to be swapped
+ * \returns the swapped value.
+ *
+ * \sa SDL_SwapFloatBE
+ * \sa SDL_SwapFloatLE
+ */
 SDL_FORCE_INLINE float
 SDL_SwapFloat(float x)
 {

+ 86 - 81
include/SDL_events.h

@@ -167,7 +167,7 @@ typedef enum SDL_EventType
     /* Internal events */
     SDL_POLLSENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
 
-    /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use,
+    /** Events SDL_USEREVENT through SDL_LASTEVENT are for your use,
      *  and should be allocated with SDL_RegisterEvents()
      */
     SDL_USEREVENT    = 0x8000,
@@ -179,7 +179,7 @@ typedef enum SDL_EventType
 } SDL_EventType;
 
 /**
- *  \brief Fields shared by every event
+ * Fields shared by every event
  */
 typedef struct SDL_CommonEvent
 {
@@ -188,14 +188,14 @@ typedef struct SDL_CommonEvent
 } SDL_CommonEvent;
 
 /**
- *  \brief Display state change event data (event.display.*)
+ * Display state change event data (event.display.*)
  */
 typedef struct SDL_DisplayEvent
 {
-    Uint32 type;        /**< ::SDL_DISPLAYEVENT */
+    Uint32 type;        /**< SDL_DISPLAYEVENT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 display;     /**< The associated display index */
-    Uint8 event;        /**< ::SDL_DisplayEventID */
+    Uint8 event;        /**< SDL_DisplayEventID */
     Uint8 padding1;
     Uint8 padding2;
     Uint8 padding3;
@@ -203,14 +203,14 @@ typedef struct SDL_DisplayEvent
 } SDL_DisplayEvent;
 
 /**
- *  \brief Window state change event data (event.window.*)
+ * Window state change event data (event.window.*)
  */
 typedef struct SDL_WindowEvent
 {
-    Uint32 type;        /**< ::SDL_WINDOWEVENT */
+    Uint32 type;        /**< SDL_WINDOWEVENT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The associated window */
-    Uint8 event;        /**< ::SDL_WindowEventID */
+    Uint8 event;        /**< SDL_WindowEventID */
     Uint8 padding1;
     Uint8 padding2;
     Uint8 padding3;
@@ -219,14 +219,14 @@ typedef struct SDL_WindowEvent
 } SDL_WindowEvent;
 
 /**
- *  \brief Keyboard button event structure (event.key.*)
+ * Keyboard button event structure (event.key.*)
  */
 typedef struct SDL_KeyboardEvent
 {
-    Uint32 type;        /**< ::SDL_KEYDOWN or ::SDL_KEYUP */
+    Uint32 type;        /**< SDL_KEYDOWN or SDL_KEYUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with keyboard focus, if any */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 padding2;
     Uint8 padding3;
@@ -234,12 +234,13 @@ typedef struct SDL_KeyboardEvent
 } SDL_KeyboardEvent;
 
 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
+
 /**
- *  \brief Keyboard text editing event structure (event.edit.*)
+ * Keyboard text editing event structure (event.edit.*)
  */
 typedef struct SDL_TextEditingEvent
 {
-    Uint32 type;                                /**< ::SDL_TEXTEDITING */
+    Uint32 type;                                /**< SDL_TEXTEDITING */
     Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;                            /**< The window with keyboard focus, if any */
     char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];  /**< The editing text */
@@ -248,12 +249,12 @@ typedef struct SDL_TextEditingEvent
 } SDL_TextEditingEvent;
 
 /**
- *  \brief Extended keyboard text editing event structure (event.editExt.*) when text would be
- *  truncated if stored in the text buffer SDL_TextEditingEvent
+ * Extended keyboard text editing event structure (event.editExt.*) when text
+ * would be truncated if stored in the text buffer SDL_TextEditingEvent
  */
 typedef struct SDL_TextEditingExtEvent
 {
-    Uint32 type;                                /**< ::SDL_TEXTEDITING_EXT */
+    Uint32 type;                                /**< SDL_TEXTEDITING_EXT */
     Uint32 timestamp;                           /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;                            /**< The window with keyboard focus, if any */
     char* text;                                 /**< The editing text, which should be freed with SDL_free(), and will not be NULL */
@@ -262,23 +263,24 @@ typedef struct SDL_TextEditingExtEvent
 } SDL_TextEditingExtEvent;
 
 #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
+
 /**
- *  \brief Keyboard text input event structure (event.text.*)
+ * Keyboard text input event structure (event.text.*)
  */
 typedef struct SDL_TextInputEvent
 {
-    Uint32 type;                              /**< ::SDL_TEXTINPUT */
+    Uint32 type;                              /**< SDL_TEXTINPUT */
     Uint32 timestamp;                         /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;                          /**< The window with keyboard focus, if any */
     char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];  /**< The input text */
 } SDL_TextInputEvent;
 
 /**
- *  \brief Mouse motion event structure (event.motion.*)
+ * Mouse motion event structure (event.motion.*)
  */
 typedef struct SDL_MouseMotionEvent
 {
-    Uint32 type;        /**< ::SDL_MOUSEMOTION */
+    Uint32 type;        /**< SDL_MOUSEMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
@@ -290,16 +292,16 @@ typedef struct SDL_MouseMotionEvent
 } SDL_MouseMotionEvent;
 
 /**
- *  \brief Mouse button event structure (event.button.*)
+ * Mouse button event structure (event.button.*)
  */
 typedef struct SDL_MouseButtonEvent
 {
-    Uint32 type;        /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */
+    Uint32 type;        /**< SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
     Uint8 button;       /**< The mouse button index */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 clicks;       /**< 1 for single-click, 2 for double-click, etc. */
     Uint8 padding1;
     Sint32 x;           /**< X coordinate, relative to window */
@@ -307,11 +309,11 @@ typedef struct SDL_MouseButtonEvent
 } SDL_MouseButtonEvent;
 
 /**
- *  \brief Mouse wheel event structure (event.wheel.*)
+ * Mouse wheel event structure (event.wheel.*)
  */
 typedef struct SDL_MouseWheelEvent
 {
-    Uint32 type;        /**< ::SDL_MOUSEWHEEL */
+    Uint32 type;        /**< SDL_MOUSEWHEEL */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The window with mouse focus, if any */
     Uint32 which;       /**< The mouse instance id, or SDL_TOUCH_MOUSEID */
@@ -325,11 +327,11 @@ typedef struct SDL_MouseWheelEvent
 } SDL_MouseWheelEvent;
 
 /**
- *  \brief Joystick axis motion event structure (event.jaxis.*)
+ * Joystick axis motion event structure (event.jaxis.*)
  */
 typedef struct SDL_JoyAxisEvent
 {
-    Uint32 type;        /**< ::SDL_JOYAXISMOTION */
+    Uint32 type;        /**< SDL_JOYAXISMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 axis;         /**< The joystick axis index */
@@ -341,11 +343,11 @@ typedef struct SDL_JoyAxisEvent
 } SDL_JoyAxisEvent;
 
 /**
- *  \brief Joystick trackball motion event structure (event.jball.*)
+ * Joystick trackball motion event structure (event.jball.*)
  */
 typedef struct SDL_JoyBallEvent
 {
-    Uint32 type;        /**< ::SDL_JOYBALLMOTION */
+    Uint32 type;        /**< SDL_JOYBALLMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 ball;         /**< The joystick trackball index */
@@ -357,18 +359,18 @@ typedef struct SDL_JoyBallEvent
 } SDL_JoyBallEvent;
 
 /**
- *  \brief Joystick hat position change event structure (event.jhat.*)
+ * Joystick hat position change event structure (event.jhat.*)
  */
 typedef struct SDL_JoyHatEvent
 {
-    Uint32 type;        /**< ::SDL_JOYHATMOTION */
+    Uint32 type;        /**< SDL_JOYHATMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 hat;          /**< The joystick hat index */
     Uint8 value;        /**< The hat position value.
-                         *   \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
-                         *   \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
-                         *   \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
+                         *   \sa SDL_HAT_LEFTUP SDL_HAT_UP SDL_HAT_RIGHTUP
+                         *   \sa SDL_HAT_LEFT SDL_HAT_CENTERED SDL_HAT_RIGHT
+                         *   \sa SDL_HAT_LEFTDOWN SDL_HAT_DOWN SDL_HAT_RIGHTDOWN
                          *
                          *   Note that zero means the POV is centered.
                          */
@@ -377,46 +379,46 @@ typedef struct SDL_JoyHatEvent
 } SDL_JoyHatEvent;
 
 /**
- *  \brief Joystick button event structure (event.jbutton.*)
+ * Joystick button event structure (event.jbutton.*)
  */
 typedef struct SDL_JoyButtonEvent
 {
-    Uint32 type;        /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */
+    Uint32 type;        /**< SDL_JOYBUTTONDOWN or SDL_JOYBUTTONUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 button;       /**< The joystick button index */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 padding1;
     Uint8 padding2;
 } SDL_JoyButtonEvent;
 
 /**
- *  \brief Joystick device event structure (event.jdevice.*)
+ * Joystick device event structure (event.jdevice.*)
  */
 typedef struct SDL_JoyDeviceEvent
 {
-    Uint32 type;        /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */
+    Uint32 type;        /**< SDL_JOYDEVICEADDED or SDL_JOYDEVICEREMOVED */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     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.*)
+ * Joysick battery level change event structure (event.jbattery.*)
  */
 typedef struct SDL_JoyBatteryEvent
 {
-    Uint32 type;        /**< ::SDL_JOYBATTERYUPDATED */
+    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.*)
+ * Game controller axis motion event structure (event.caxis.*)
  */
 typedef struct SDL_ControllerAxisEvent
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERAXISMOTION */
+    Uint32 type;        /**< SDL_CONTROLLERAXISMOTION */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 axis;         /**< The controller axis (SDL_GameControllerAxis) */
@@ -429,36 +431,36 @@ typedef struct SDL_ControllerAxisEvent
 
 
 /**
- *  \brief Game controller button event structure (event.cbutton.*)
+ * Game controller button event structure (event.cbutton.*)
  */
 typedef struct SDL_ControllerButtonEvent
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */
+    Uint32 type;        /**< SDL_CONTROLLERBUTTONDOWN or SDL_CONTROLLERBUTTONUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Uint8 button;       /**< The controller button (SDL_GameControllerButton) */
-    Uint8 state;        /**< ::SDL_PRESSED or ::SDL_RELEASED */
+    Uint8 state;        /**< SDL_PRESSED or SDL_RELEASED */
     Uint8 padding1;
     Uint8 padding2;
 } SDL_ControllerButtonEvent;
 
 
 /**
- *  \brief Controller device event structure (event.cdevice.*)
+ * Controller device event structure (event.cdevice.*)
  */
 typedef struct SDL_ControllerDeviceEvent
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, ::SDL_CONTROLLERDEVICEREMAPPED, or ::SDL_CONTROLLERSTEAMHANDLEUPDATED */
+    Uint32 type;        /**< SDL_CONTROLLERDEVICEADDED, SDL_CONTROLLERDEVICEREMOVED, SDL_CONTROLLERDEVICEREMAPPED, or SDL_CONTROLLERSTEAMHANDLEUPDATED */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Sint32 which;       /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */
 } SDL_ControllerDeviceEvent;
 
 /**
- *  \brief Game controller touchpad event structure (event.ctouchpad.*)
+ * Game controller touchpad event structure (event.ctouchpad.*)
  */
 typedef struct SDL_ControllerTouchpadEvent
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERTOUCHPADDOWN or ::SDL_CONTROLLERTOUCHPADMOTION or ::SDL_CONTROLLERTOUCHPADUP */
+    Uint32 type;        /**< SDL_CONTROLLERTOUCHPADDOWN or SDL_CONTROLLERTOUCHPADMOTION or SDL_CONTROLLERTOUCHPADUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
     Sint32 touchpad;    /**< The index of the touchpad */
@@ -469,24 +471,24 @@ typedef struct SDL_ControllerTouchpadEvent
 } SDL_ControllerTouchpadEvent;
 
 /**
- *  \brief Game controller sensor event structure (event.csensor.*)
+ * Game controller sensor event structure (event.csensor.*)
  */
 typedef struct SDL_ControllerSensorEvent
 {
-    Uint32 type;        /**< ::SDL_CONTROLLERSENSORUPDATE */
+    Uint32 type;        /**< SDL_CONTROLLERSENSORUPDATE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_JoystickID which; /**< The joystick instance id */
-    Sint32 sensor;      /**< The type of the sensor, one of the values of ::SDL_SensorType */
+    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;
 
 /**
- *  \brief Audio device event structure (event.adevice.*)
+ * Audio device event structure (event.adevice.*)
  */
 typedef struct SDL_AudioDeviceEvent
 {
-    Uint32 type;        /**< ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED */
+    Uint32 type;        /**< SDL_AUDIODEVICEADDED, or SDL_AUDIODEVICEREMOVED */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 which;       /**< The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event */
     Uint8 iscapture;    /**< zero if an output device, non-zero if a capture device. */
@@ -497,11 +499,11 @@ typedef struct SDL_AudioDeviceEvent
 
 
 /**
- *  \brief Touch finger event structure (event.tfinger.*)
+ * Touch finger event structure (event.tfinger.*)
  */
 typedef struct SDL_TouchFingerEvent
 {
-    Uint32 type;        /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */
+    Uint32 type;        /**< SDL_FINGERMOTION or SDL_FINGERDOWN or SDL_FINGERUP */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_FingerID fingerId;
@@ -515,11 +517,11 @@ typedef struct SDL_TouchFingerEvent
 
 
 /**
- *  \brief Multiple Finger Gesture Event (event.mgesture.*)
+ * Multiple Finger Gesture Event (event.mgesture.*)
  */
 typedef struct SDL_MultiGestureEvent
 {
-    Uint32 type;        /**< ::SDL_MULTIGESTURE */
+    Uint32 type;        /**< SDL_MULTIGESTURE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_TouchID touchId; /**< The touch device id */
     float dTheta;
@@ -532,11 +534,11 @@ typedef struct SDL_MultiGestureEvent
 
 
 /**
- * \brief Dollar Gesture Event (event.dgesture.*)
+ * Dollar Gesture Event (event.dgesture.*)
  */
 typedef struct SDL_DollarGestureEvent
 {
-    Uint32 type;        /**< ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD */
+    Uint32 type;        /**< SDL_DOLLARGESTURE or SDL_DOLLARRECORD */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_TouchID touchId; /**< The touch device id */
     SDL_GestureID gestureId;
@@ -548,13 +550,15 @@ typedef struct SDL_DollarGestureEvent
 
 
 /**
- *  \brief An event used to request a file open by the system (event.drop.*)
- *         This event is enabled by default, you can disable it with SDL_EventState().
- *  \note If this event is enabled, you must free the filename in the event.
+ * An event used to request a file open by the system (event.drop.*)
+ *
+ * This event is enabled by default, you can disable it with SDL_EventState().
+ *
+ * If this event is enabled, you must free the filename in the event.
  */
 typedef struct SDL_DropEvent
 {
-    Uint32 type;        /**< ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE */
+    Uint32 type;        /**< SDL_DROPBEGIN or SDL_DROPFILE or SDL_DROPTEXT or SDL_DROPCOMPLETE */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     char *file;         /**< The file name, which should be freed with SDL_free(), is NULL on begin/complete */
     Uint32 windowID;    /**< The window that was dropped on, if any */
@@ -562,11 +566,11 @@ typedef struct SDL_DropEvent
 
 
 /**
- *  \brief Sensor event structure (event.sensor.*)
+ * Sensor event structure (event.sensor.*)
  */
 typedef struct SDL_SensorEvent
 {
-    Uint32 type;        /**< ::SDL_SENSORUPDATE */
+    Uint32 type;        /**< SDL_SENSORUPDATE */
     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() */
@@ -574,20 +578,20 @@ typedef struct SDL_SensorEvent
 } SDL_SensorEvent;
 
 /**
- *  \brief The "quit requested" event
+ * The "quit requested" event
  */
 typedef struct SDL_QuitEvent
 {
-    Uint32 type;        /**< ::SDL_QUIT */
+    Uint32 type;        /**< SDL_QUIT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
 } SDL_QuitEvent;
 
 /**
- *  \brief A user-defined event type (event.user.*)
+ * A user-defined event type (event.user.*)
  */
 typedef struct SDL_UserEvent
 {
-    Uint32 type;        /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */
+    Uint32 type;        /**< SDL_USEREVENT through SDL_LASTEVENT-1 */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     Uint32 windowID;    /**< The associated window if any */
     Sint32 code;        /**< User defined event code */
@@ -600,20 +604,21 @@ struct SDL_SysWMmsg;
 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
 
 /**
- *  \brief A video driver dependent system event (event.syswm.*)
- *         This event is disabled by default, you can enable it with SDL_EventState()
+ * A video driver dependent system event (event.syswm.*)
+ *
+ * This event is disabled by default, you can enable it with SDL_EventState()
  *
- *  \note If you want to use this event, you should include SDL_syswm.h.
+ * If you want to use this event, you should include SDL_syswm.h.
  */
 typedef struct SDL_SysWMEvent
 {
-    Uint32 type;        /**< ::SDL_SYSWMEVENT */
+    Uint32 type;        /**< SDL_SYSWMEVENT */
     Uint32 timestamp;   /**< In milliseconds, populated using SDL_GetTicks() */
     SDL_SysWMmsg *msg;  /**< driver dependent data, defined in SDL_syswm.h */
 } SDL_SysWMEvent;
 
 /**
- *  \brief General event structure
+ * General event structure
  */
 typedef union SDL_Event
 {
@@ -961,11 +966,11 @@ extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
 /**
  * A function pointer used for callbacks that watch the event queue.
  *
- * \param userdata what was passed as `userdata` to SDL_SetEventFilter()
- *        or SDL_AddEventWatch, etc
+ * \param userdata what was passed as `userdata` to SDL_SetEventFilter() or
+ *                 SDL_AddEventWatch, etc
  * \param event the event that triggered the callback
- * \returns 1 to permit event to be added to the queue, and 0 to disallow
- *          it. When used with SDL_AddEventWatch, the return value is ignored.
+ * \returns 1 to permit event to be added to the queue, and 0 to disallow it.
+ *          When used with SDL_AddEventWatch, the return value is ignored.
  *
  * \sa SDL_SetEventFilter
  * \sa SDL_AddEventWatch
@@ -988,7 +993,7 @@ typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
  * interrupt signal (e.g. pressing Ctrl-C), it will be delivered to the
  * application at the next event poll.
  *
- * There is one caveat when dealing with the ::SDL_QuitEvent event type. The
+ * There is one caveat when dealing with the SDL_QuitEvent event type. The
  * event filter is only called when the window manager desires to close the
  * application window. If the event filter returns 1, then the window will be
  * closed, otherwise the window will remain open if possible.

+ 15 - 12
include/SDL_gamecontroller.h

@@ -44,7 +44,7 @@ extern "C" {
  *  \file SDL_gamecontroller.h
  *
  *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_GAMECONTROLLER flag.  This causes SDL to scan the system
+ *  with the SDL_INIT_GAMECONTROLLER flag.  This causes SDL to scan the system
  *  for game controllers, and load appropriate drivers.
  *
  *  If you would like to receive controller updates while the application
@@ -86,7 +86,7 @@ typedef enum SDL_GameControllerBindType
 } SDL_GameControllerBindType;
 
 /**
- *  Get the SDL joystick layer binding for this controller button/axis mapping
+ * Get the SDL joystick layer binding for this controller button/axis mapping
  */
 typedef struct SDL_GameControllerButtonBind
 {
@@ -166,9 +166,10 @@ typedef struct SDL_GameControllerButtonBind
 extern DECLSPEC int SDLCALL SDL_GameControllerAddMappingsFromRW(SDL_RWops * rw, int freerw);
 
 /**
- *  Load a set of mappings from a file, filtered by the current SDL_GetPlatform()
+ * Load a set of mappings from a file, filtered by the current
+ * SDL_GetPlatform()
  *
- *  Convenience macro.
+ * Convenience macro.
  */
 #define SDL_GameControllerAddMappingsFromFile(file)   SDL_GameControllerAddMappingsFromRW(SDL_RWFromFile(file, "rb"), 1)
 
@@ -607,15 +608,17 @@ extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void);
 
 
 /**
- *  The list of axes available from a controller
+ * The list of axes available from a controller
  *
- *  Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX,
- *  and are centered within ~8000 of zero, though advanced UI will allow users to set
- *  or autodetect the dead zone, which varies between controllers.
+ * Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to
+ * SDL_JOYSTICK_AXIS_MAX, and are centered within ~8000 of zero, though
+ * advanced UI will allow users to set or autodetect the dead zone, which
+ * varies between controllers.
  *
- *  Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX
- *  (fully pressed) when reported by SDL_GameControllerGetAxis(). Note that this is not the
- *  same range that will be reported by the lower-level SDL_GetJoystickAxis().
+ * Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX (fully
+ * pressed) when reported by SDL_GameControllerGetAxis(). Note that this is
+ * not the same range that will be reported by the lower-level
+ * SDL_GetJoystickAxis().
  */
 typedef enum SDL_GameControllerAxis
 {
@@ -724,7 +727,7 @@ extern DECLSPEC Sint16 SDLCALL
 SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
 
 /**
- *  The list of buttons available from a controller
+ * The list of buttons available from a controller
  */
 typedef enum SDL_GameControllerButton
 {

+ 16 - 16
include/SDL_guid.h

@@ -22,7 +22,7 @@
 /**
  *  \file SDL_guid.h
  *
- *  Include file for handling ::SDL_GUID values.
+ *  Include file for handling SDL_GUID values.
  */
 
 #ifndef SDL_guid_h_
@@ -38,19 +38,19 @@ 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.
+ * 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.
  *
- * 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.
+ * 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 may be platform-dependent (i.e., the same device may report
- *   different GUIDs on different operating systems).
+ * 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 SDL_GUID {
     Uint8 data[16];
@@ -59,11 +59,11 @@ typedef struct SDL_GUID {
 /* Function prototypes */
 
 /**
- * Get an ASCII string representation for a given ::SDL_GUID.
+ * 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 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
  *
@@ -74,14 +74,14 @@ typedef struct SDL_GUID {
 extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
 
 /**
- * Convert a GUID string into a ::SDL_GUID structure.
+ * 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.
+ * \returns a SDL_GUID structure.
  *
  * \since This function is available since SDL 2.24.0.
  *

+ 318 - 306
include/SDL_haptic.h

@@ -26,18 +26,19 @@
  *         devices.
  *
  *  The basic usage is as follows:
- *   - Initialize the subsystem (::SDL_INIT_HAPTIC).
+ *   - Initialize the subsystem (SDL_INIT_HAPTIC).
  *   - Open a haptic device.
  *    - SDL_HapticOpen() to open from index.
  *    - SDL_HapticOpenFromJoystick() to open from an existing joystick.
- *   - Create an effect (::SDL_HapticEffect).
+ *   - Create an effect (SDL_HapticEffect).
  *   - Upload the effect with SDL_HapticNewEffect().
  *   - Run the effect with SDL_HapticRunEffect().
  *   - (optional) Free the effect with SDL_HapticDestroyEffect().
  *   - Close the haptic device with SDL_HapticClose().
  *
  * \par Simple rumble example:
- * \code
+ *
+ * ```c
  *    SDL_Haptic *haptic;
  *
  *    // Open the device
@@ -56,10 +57,11 @@
  *
  *    // Clean up
  *    SDL_HapticClose( haptic );
- * \endcode
+ * ```
+ *
+ * Complete example:
  *
- * \par Complete example:
- * \code
+ * ```c
  * int test_haptic( SDL_Joystick * joystick ) {
  *    SDL_Haptic *haptic;
  *    SDL_HapticEffect effect;
@@ -101,7 +103,7 @@
  *
  *    return 0; // Success
  * }
- * \endcode
+ * ```
  */
 
 #ifndef SDL_haptic_h_
@@ -154,31 +156,29 @@ typedef struct _SDL_Haptic SDL_Haptic;
 /* @{ */
 
 /**
- *  \brief Constant effect supported.
+ * Constant effect supported.
  *
- *  Constant haptic effect.
+ * Constant haptic effect.
  *
- *  \sa SDL_HapticCondition
+ * \sa SDL_HapticCondition
  */
 #define SDL_HAPTIC_CONSTANT   (1u<<0)
 
 /**
- *  \brief Sine wave effect supported.
+ * Sine wave effect supported.
  *
- *  Periodic haptic effect that simulates sine waves.
+ * Periodic haptic effect that simulates sine waves.
  *
- *  \sa SDL_HapticPeriodic
+ * \sa SDL_HapticPeriodic
  */
 #define SDL_HAPTIC_SINE       (1u<<1)
 
 /**
- *  \brief Left/Right effect supported.
+ * Left/Right effect supported.
  *
- *  Haptic effect for direct control over high/low frequency motors.
+ * Haptic effect for direct control over high/low frequency motors.
  *
- *  \sa SDL_HapticLeftRight
- * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry,
- *          we ran out of bits, and this is important for XInput devices.
+ * \sa SDL_HapticLeftRight
  */
 #define SDL_HAPTIC_LEFTRIGHT     (1u<<2)
 
@@ -186,85 +186,85 @@ typedef struct _SDL_Haptic SDL_Haptic;
 /* #define SDL_HAPTIC_SQUARE     (1<<2) */
 
 /**
- *  \brief Triangle wave effect supported.
+ * Triangle wave effect supported.
  *
- *  Periodic haptic effect that simulates triangular waves.
+ * Periodic haptic effect that simulates triangular waves.
  *
- *  \sa SDL_HapticPeriodic
+ * \sa SDL_HapticPeriodic
  */
 #define SDL_HAPTIC_TRIANGLE   (1u<<3)
 
 /**
- *  \brief Sawtoothup wave effect supported.
+ * Sawtoothup wave effect supported.
  *
- *  Periodic haptic effect that simulates saw tooth up waves.
+ * Periodic haptic effect that simulates saw tooth up waves.
  *
- *  \sa SDL_HapticPeriodic
+ * \sa SDL_HapticPeriodic
  */
 #define SDL_HAPTIC_SAWTOOTHUP (1u<<4)
 
 /**
- *  \brief Sawtoothdown wave effect supported.
+ * Sawtoothdown wave effect supported.
  *
- *  Periodic haptic effect that simulates saw tooth down waves.
+ * Periodic haptic effect that simulates saw tooth down waves.
  *
- *  \sa SDL_HapticPeriodic
+ * \sa SDL_HapticPeriodic
  */
 #define SDL_HAPTIC_SAWTOOTHDOWN (1u<<5)
 
 /**
- *  \brief Ramp effect supported.
+ * Ramp effect supported.
  *
- *  Ramp haptic effect.
+ * Ramp haptic effect.
  *
- *  \sa SDL_HapticRamp
+ * \sa SDL_HapticRamp
  */
 #define SDL_HAPTIC_RAMP       (1u<<6)
 
 /**
- *  \brief Spring effect supported - uses axes position.
+ * Spring effect supported - uses axes position.
  *
- *  Condition haptic effect that simulates a spring.  Effect is based on the
- *  axes position.
+ * Condition haptic effect that simulates a spring. Effect is based on the
+ * axes position.
  *
- *  \sa SDL_HapticCondition
+ * \sa SDL_HapticCondition
  */
 #define SDL_HAPTIC_SPRING     (1u<<7)
 
 /**
- *  \brief Damper effect supported - uses axes velocity.
+ * Damper effect supported - uses axes velocity.
  *
- *  Condition haptic effect that simulates dampening.  Effect is based on the
- *  axes velocity.
+ * Condition haptic effect that simulates dampening. Effect is based on the
+ * axes velocity.
  *
- *  \sa SDL_HapticCondition
+ * \sa SDL_HapticCondition
  */
 #define SDL_HAPTIC_DAMPER     (1u<<8)
 
 /**
- *  \brief Inertia effect supported - uses axes acceleration.
+ * Inertia effect supported - uses axes acceleration.
  *
- *  Condition haptic effect that simulates inertia.  Effect is based on the axes
- *  acceleration.
+ * Condition haptic effect that simulates inertia. Effect is based on the axes
+ * acceleration.
  *
- *  \sa SDL_HapticCondition
+ * \sa SDL_HapticCondition
  */
 #define SDL_HAPTIC_INERTIA    (1u<<9)
 
 /**
- *  \brief Friction effect supported - uses axes movement.
+ * Friction effect supported - uses axes movement.
  *
- *  Condition haptic effect that simulates friction.  Effect is based on the
- *  axes movement.
+ * Condition haptic effect that simulates friction. Effect is based on the
+ * axes movement.
  *
- *  \sa SDL_HapticCondition
+ * \sa SDL_HapticCondition
  */
 #define SDL_HAPTIC_FRICTION   (1u<<10)
 
 /**
- *  \brief Custom effect is supported.
+ * Custom effect is supported.
  *
- *  User defined custom haptic effect.
+ * User defined custom haptic effect.
  */
 #define SDL_HAPTIC_CUSTOM     (1u<<11)
 
@@ -273,39 +273,39 @@ typedef struct _SDL_Haptic SDL_Haptic;
 /* These last few are features the device has, not effects */
 
 /**
- *  \brief Device can set global gain.
+ * Device can set global gain.
  *
- *  Device supports setting the global gain.
+ * Device supports setting the global gain.
  *
- *  \sa SDL_HapticSetGain
+ * \sa SDL_HapticSetGain
  */
 #define SDL_HAPTIC_GAIN       (1u<<12)
 
 /**
- *  \brief Device can set autocenter.
+ * Device can set autocenter.
  *
- *  Device supports setting autocenter.
+ * Device supports setting autocenter.
  *
- *  \sa SDL_HapticSetAutocenter
+ * \sa SDL_HapticSetAutocenter
  */
 #define SDL_HAPTIC_AUTOCENTER (1u<<13)
 
 /**
- *  \brief Device can be queried for effect status.
+ * Device can be queried for effect status.
  *
- *  Device supports querying effect status.
+ * Device supports querying effect status.
  *
- *  \sa SDL_HapticGetEffectStatus
+ * \sa SDL_HapticGetEffectStatus
  */
 #define SDL_HAPTIC_STATUS     (1u<<14)
 
 /**
- *  \brief Device can be paused.
+ * Device can be paused.
  *
- *  Devices supports being paused.
+ * Devices supports being paused.
  *
- *  \sa SDL_HapticPause
- *  \sa SDL_HapticUnpause
+ * \sa SDL_HapticPause
+ * \sa SDL_HapticUnpause
  */
 #define SDL_HAPTIC_PAUSE      (1u<<15)
 
@@ -316,31 +316,33 @@ typedef struct _SDL_Haptic SDL_Haptic;
 /* @{ */
 
 /**
- *  \brief Uses polar coordinates for the direction.
+ * Uses polar coordinates for the direction.
  *
- *  \sa SDL_HapticDirection
+ * \sa SDL_HapticDirection
  */
 #define SDL_HAPTIC_POLAR      0
 
 /**
- *  \brief Uses cartesian coordinates for the direction.
+ * Uses cartesian coordinates for the direction.
  *
- *  \sa SDL_HapticDirection
+ * \sa SDL_HapticDirection
  */
 #define SDL_HAPTIC_CARTESIAN  1
 
 /**
- *  \brief Uses spherical coordinates for the direction.
+ * Uses spherical coordinates for the direction.
  *
- *  \sa SDL_HapticDirection
+ * \sa SDL_HapticDirection
  */
 #define SDL_HAPTIC_SPHERICAL  2
 
 /**
- *  \brief Use this value to play an effect on the steering wheel axis. This 
- *  provides better compatibility across platforms and devices as SDL will guess 
- *  the correct axis.
- *  \sa SDL_HapticDirection
+ * Use this value to play an effect on the steering wheel axis.
+ *
+ * This provides better compatibility across platforms and devices as SDL will
+ * guess the correct axis.
+ *
+ * \sa SDL_HapticDirection
  */
 #define SDL_HAPTIC_STEERING_AXIS 3
 
@@ -353,7 +355,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
  */
 
 /**
- * \brief Used to play a device an infinite number of times.
+ * Used to play a device an infinite number of times.
  *
  * \sa SDL_HapticRunEffect
  */
@@ -361,77 +363,82 @@ typedef struct _SDL_Haptic SDL_Haptic;
 
 
 /**
- *  \brief Structure that represents a haptic direction.
- *
- *  This is the direction where the force comes from,
- *  instead of the direction in which the force is exerted.
- *
- *  Directions can be specified by:
- *   - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
- *   - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
- *   - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
- *
- *  Cardinal directions of the haptic device are relative to the positioning
- *  of the device.  North is considered to be away from the user.
- *
- *  The following diagram represents the cardinal directions:
- *  \verbatim
-                 .--.
-                 |__| .-------.
-                 |=.| |.-----.|
-                 |--| ||     ||
-                 |  | |'-----'|
-                 |__|~')_____('
-                   [ COMPUTER ]
-
-
-                     North (0,-1)
-                         ^
-                         |
-                         |
-   (-1,0)  West <----[ HAPTIC ]----> East (1,0)
-                         |
-                         |
-                         v
-                      South (0,1)
-
-
-                      [ USER ]
-                        \|||/
-                        (o o)
-                  ---ooO-(_)-Ooo---
-    \endverbatim
- *
- *  If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
- *  degree starting north and turning clockwise.  ::SDL_HAPTIC_POLAR only uses
- *  the first \c dir parameter.  The cardinal directions would be:
- *   - North: 0 (0 degrees)
- *   - East: 9000 (90 degrees)
- *   - South: 18000 (180 degrees)
- *   - West: 27000 (270 degrees)
- *
- *  If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
- *  (X axis, Y axis and Z axis (with 3 axes)).  ::SDL_HAPTIC_CARTESIAN uses
- *  the first three \c dir parameters.  The cardinal directions would be:
- *   - North:  0,-1, 0
- *   - East:   1, 0, 0
- *   - South:  0, 1, 0
- *   - West:  -1, 0, 0
- *
- *  The Z axis represents the height of the effect if supported, otherwise
- *  it's unused.  In cartesian encoding (1, 2) would be the same as (2, 4), you
- *  can use any multiple you want, only the direction matters.
- *
- *  If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
- *  The first two \c dir parameters are used.  The \c dir parameters are as
- *  follows (all values are in hundredths of degrees):
- *   - Degrees from (1, 0) rotated towards (0, 1).
- *   - Degrees towards (0, 0, 1) (device needs at least 3 axes).
- *
- *
- *  Example of force coming from the south with all encodings (force coming
- *  from the south means the user will have to pull the stick to counteract):
- *  \code
+ * Structure that represents a haptic direction.
+ *
+ * This is the direction where the force comes from, instead of the direction
+ * in which the force is exerted.
+ *
+ * Directions can be specified by:
+ *
+ * - SDL_HAPTIC_POLAR : Specified by polar coordinates.
+ * - SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
+ * - SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
+ *
+ * Cardinal directions of the haptic device are relative to the positioning of
+ * the device. North is considered to be away from the user.
+ *
+ * The following diagram represents the cardinal directions:
+ *
+ * ```
+ *                .--.
+ *                |__| .-------.
+ *                |=.| |.-----.|
+ *                |--| ||     ||
+ *                |  | |'-----'|
+ *                |__|~')_____('
+ *                  [ COMPUTER ]
+ *
+ *
+ *                    North (0,-1)
+ *                        ^
+ *                        |
+ *                        |
+ *  (-1,0)  West <----[ HAPTIC ]----> East (1,0)
+ *                        |
+ *                        |
+ *                        v
+ *                     South (0,1)
+ *
+ *
+ *                     [ USER ]
+ *                       \|||/
+ *                       (o o)
+ *                 ---ooO-(_)-Ooo---
+ * ```
+ *
+ * If type is SDL_HAPTIC_POLAR, direction is encoded by hundredths of a degree
+ * starting north and turning clockwise. SDL_HAPTIC_POLAR only uses the first
+ * `dir` parameter. The cardinal directions would be:
+ *
+ * - North: 0 (0 degrees)
+ * - East: 9000 (90 degrees)
+ * - South: 18000 (180 degrees)
+ * - West: 27000 (270 degrees)
+ *
+ * If type is SDL_HAPTIC_CARTESIAN, direction is encoded by three positions (X
+ * axis, Y axis and Z axis (with 3 axes)). SDL_HAPTIC_CARTESIAN uses the first
+ * three `dir` parameters. The cardinal directions would be:
+ *
+ * - North: 0,-1, 0
+ * - East: 1, 0, 0
+ * - South: 0, 1, 0
+ * - West: -1, 0, 0
+ *
+ * The Z axis represents the height of the effect if supported, otherwise it's
+ * unused. In cartesian encoding (1, 2) would be the same as (2, 4), you can
+ * use any multiple you want, only the direction matters.
+ *
+ * If type is SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. The
+ * first two `dir` parameters are used. The `dir` parameters are as follows
+ * (all values are in hundredths of degrees):
+ *
+ * - Degrees from (1, 0) rotated towards (0, 1).
+ * - Degrees towards (0, 0, 1) (device needs at least 3 axes).
+ *
+ * Example of force coming from the south with all encodings (force coming
+ * from the south means the user will have to pull the stick to counteract):
+ *
+ * ```c
  *  SDL_HapticDirection direction;
  *
  *  // Cartesian directions
@@ -447,14 +454,14 @@ typedef struct _SDL_Haptic SDL_Haptic;
  *  // Spherical coordinates
  *  direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding
  *  direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters.
- *  \endcode
+ * ```
  *
- *  \sa SDL_HAPTIC_POLAR
- *  \sa SDL_HAPTIC_CARTESIAN
- *  \sa SDL_HAPTIC_SPHERICAL
- *  \sa SDL_HAPTIC_STEERING_AXIS
- *  \sa SDL_HapticEffect
- *  \sa SDL_HapticNumAxes
+ * \sa SDL_HAPTIC_POLAR
+ * \sa SDL_HAPTIC_CARTESIAN
+ * \sa SDL_HAPTIC_SPHERICAL
+ * \sa SDL_HAPTIC_STEERING_AXIS
+ * \sa SDL_HapticEffect
+ * \sa SDL_HapticNumAxes
  */
 typedef struct SDL_HapticDirection
 {
@@ -464,20 +471,20 @@ typedef struct SDL_HapticDirection
 
 
 /**
- *  \brief A structure containing a template for a Constant effect.
+ * A structure containing a template for a Constant effect.
  *
- *  This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect.
+ * This struct is exclusively for the SDL_HAPTIC_CONSTANT effect.
  *
- *  A constant effect applies a constant force in the specified direction
- *  to the joystick.
+ * A constant effect applies a constant force in the specified direction to
+ * the joystick.
  *
- *  \sa SDL_HAPTIC_CONSTANT
- *  \sa SDL_HapticEffect
+ * \sa SDL_HAPTIC_CONSTANT
+ * \sa SDL_HapticEffect
  */
 typedef struct SDL_HapticConstant
 {
     /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_CONSTANT */
+    Uint16 type;            /**< SDL_HAPTIC_CONSTANT */
     SDL_HapticDirection direction;  /**< Direction of the effect. */
 
     /* Replay */
@@ -499,68 +506,71 @@ typedef struct SDL_HapticConstant
 } SDL_HapticConstant;
 
 /**
- *  \brief A structure containing a template for a Periodic effect.
- *
- *  The struct handles the following effects:
- *   - ::SDL_HAPTIC_SINE
- *   - ::SDL_HAPTIC_LEFTRIGHT
- *   - ::SDL_HAPTIC_TRIANGLE
- *   - ::SDL_HAPTIC_SAWTOOTHUP
- *   - ::SDL_HAPTIC_SAWTOOTHDOWN
- *
- *  A periodic effect consists in a wave-shaped effect that repeats itself
- *  over time.  The type determines the shape of the wave and the parameters
- *  determine the dimensions of the wave.
- *
- *  Phase is given by hundredth of a degree meaning that giving the phase a value
- *  of 9000 will displace it 25% of its period.  Here are sample values:
- *   -     0: No phase displacement.
- *   -  9000: Displaced 25% of its period.
- *   - 18000: Displaced 50% of its period.
- *   - 27000: Displaced 75% of its period.
- *   - 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
- *
- *  Examples:
- *  \verbatim
-    SDL_HAPTIC_SINE
-      __      __      __      __
-     /  \    /  \    /  \    /
-    /    \__/    \__/    \__/
-
-    SDL_HAPTIC_SQUARE
-     __    __    __    __    __
-    |  |  |  |  |  |  |  |  |  |
-    |  |__|  |__|  |__|  |__|  |
-
-    SDL_HAPTIC_TRIANGLE
-      /\    /\    /\    /\    /\
-     /  \  /  \  /  \  /  \  /
-    /    \/    \/    \/    \/
-
-    SDL_HAPTIC_SAWTOOTHUP
-      /|  /|  /|  /|  /|  /|  /|
-     / | / | / | / | / | / | / |
-    /  |/  |/  |/  |/  |/  |/  |
-
-    SDL_HAPTIC_SAWTOOTHDOWN
-    \  |\  |\  |\  |\  |\  |\  |
-     \ | \ | \ | \ | \ | \ | \ |
-      \|  \|  \|  \|  \|  \|  \|
-    \endverbatim
- *
- *  \sa SDL_HAPTIC_SINE
- *  \sa SDL_HAPTIC_LEFTRIGHT
- *  \sa SDL_HAPTIC_TRIANGLE
- *  \sa SDL_HAPTIC_SAWTOOTHUP
- *  \sa SDL_HAPTIC_SAWTOOTHDOWN
- *  \sa SDL_HapticEffect
+ * A structure containing a template for a Periodic effect.
+ *
+ * The struct handles the following effects:
+ *
+ * - SDL_HAPTIC_SINE
+ * - SDL_HAPTIC_SQUARE
+ * - SDL_HAPTIC_TRIANGLE
+ * - SDL_HAPTIC_SAWTOOTHUP
+ * - SDL_HAPTIC_SAWTOOTHDOWN
+ *
+ * A periodic effect consists in a wave-shaped effect that repeats itself over
+ * time. The type determines the shape of the wave and the parameters
+ * determine the dimensions of the wave.
+ *
+ * Phase is given by hundredth of a degree meaning that giving the phase a
+ * value of 9000 will displace it 25% of its period. Here are sample values:
+ *
+ * - 0: No phase displacement.
+ * - 9000: Displaced 25% of its period.
+ * - 18000: Displaced 50% of its period.
+ * - 27000: Displaced 75% of its period.
+ * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
+ *
+ * Examples:
+ *
+ * ```
+ *   SDL_HAPTIC_SINE
+ *     __      __      __      __
+ *    /  \    /  \    /  \    /
+ *   /    \__/    \__/    \__/
+ *
+ *   SDL_HAPTIC_SQUARE
+ *    __    __    __    __    __
+ *   |  |  |  |  |  |  |  |  |  |
+ *   |  |__|  |__|  |__|  |__|  |
+ *
+ *   SDL_HAPTIC_TRIANGLE
+ *     /\    /\    /\    /\    /\
+ *    /  \  /  \  /  \  /  \  /
+ *   /    \/    \/    \/    \/
+ *
+ *   SDL_HAPTIC_SAWTOOTHUP
+ *     /|  /|  /|  /|  /|  /|  /|
+ *    / | / | / | / | / | / | / |
+ *   /  |/  |/  |/  |/  |/  |/  |
+ *
+ *   SDL_HAPTIC_SAWTOOTHDOWN
+ *   \  |\  |\  |\  |\  |\  |\  |
+ *    \ | \ | \ | \ | \ | \ | \ |
+ *     \|  \|  \|  \|  \|  \|  \|
+ * ```
+ *
+ * \sa SDL_HAPTIC_SINE
+ * \sa SDL_HAPTIC_LEFTRIGHT
+ * \sa SDL_HAPTIC_TRIANGLE
+ * \sa SDL_HAPTIC_SAWTOOTHUP
+ * \sa SDL_HAPTIC_SAWTOOTHDOWN
+ * \sa SDL_HapticEffect
  */
 typedef struct SDL_HapticPeriodic
 {
     /* Header */
-    Uint16 type;        /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT,
-                             ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
-                             ::SDL_HAPTIC_SAWTOOTHDOWN */
+    Uint16 type;        /**< SDL_HAPTIC_SINE, SDL_HAPTIC_LEFTRIGHT,
+                             SDL_HAPTIC_TRIANGLE, SDL_HAPTIC_SAWTOOTHUP or
+                             SDL_HAPTIC_SAWTOOTHDOWN */
     SDL_HapticDirection direction;  /**< Direction of the effect. */
 
     /* Replay */
@@ -585,34 +595,35 @@ typedef struct SDL_HapticPeriodic
 } SDL_HapticPeriodic;
 
 /**
- *  \brief A structure containing a template for a Condition effect.
+ * A structure containing a template for a Condition effect.
+ *
+ * The struct handles the following effects:
  *
- *  The struct handles the following effects:
- *   - ::SDL_HAPTIC_SPRING: Effect based on axes position.
- *   - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
- *   - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
- *   - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
+ * - SDL_HAPTIC_SPRING: Effect based on axes position.
+ * - SDL_HAPTIC_DAMPER: Effect based on axes velocity.
+ * - SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
+ * - SDL_HAPTIC_FRICTION: Effect based on axes movement.
  *
- *  Direction is handled by condition internals instead of a direction member.
- *  The condition effect specific members have three parameters.  The first
- *  refers to the X axis, the second refers to the Y axis and the third
- *  refers to the Z axis.  The right terms refer to the positive side of the
- *  axis and the left terms refer to the negative side of the axis.  Please
- *  refer to the ::SDL_HapticDirection diagram for which side is positive and
- *  which is negative.
+ * Direction is handled by condition internals instead of a direction member.
+ * The condition effect specific members have three parameters. The first
+ * refers to the X axis, the second refers to the Y axis and the third refers
+ * to the Z axis. The right terms refer to the positive side of the axis and
+ * the left terms refer to the negative side of the axis. Please refer to the
+ * SDL_HapticDirection diagram for which side is positive and which is
+ * negative.
  *
- *  \sa SDL_HapticDirection
- *  \sa SDL_HAPTIC_SPRING
- *  \sa SDL_HAPTIC_DAMPER
- *  \sa SDL_HAPTIC_INERTIA
- *  \sa SDL_HAPTIC_FRICTION
- *  \sa SDL_HapticEffect
+ * \sa SDL_HapticDirection
+ * \sa SDL_HAPTIC_SPRING
+ * \sa SDL_HAPTIC_DAMPER
+ * \sa SDL_HAPTIC_INERTIA
+ * \sa SDL_HAPTIC_FRICTION
+ * \sa SDL_HapticEffect
  */
 typedef struct SDL_HapticCondition
 {
     /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
-                                 ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */
+    Uint16 type;            /**< SDL_HAPTIC_SPRING, SDL_HAPTIC_DAMPER,
+                                 SDL_HAPTIC_INERTIA or SDL_HAPTIC_FRICTION */
     SDL_HapticDirection direction;  /**< Direction of the effect - Not used ATM. */
 
     /* Replay */
@@ -633,22 +644,22 @@ typedef struct SDL_HapticCondition
 } SDL_HapticCondition;
 
 /**
- *  \brief A structure containing a template for a Ramp effect.
+ * A structure containing a template for a Ramp effect.
  *
- *  This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
+ * This struct is exclusively for the SDL_HAPTIC_RAMP effect.
  *
- *  The ramp effect starts at start strength and ends at end strength.
- *  It augments in linear fashion.  If you use attack and fade with a ramp
- *  the effects get added to the ramp effect making the effect become
- *  quadratic instead of linear.
+ * The ramp effect starts at start strength and ends at end strength. It
+ * augments in linear fashion. If you use attack and fade with a ramp the
+ * effects get added to the ramp effect making the effect become quadratic
+ * instead of linear.
  *
- *  \sa SDL_HAPTIC_RAMP
- *  \sa SDL_HapticEffect
+ * \sa SDL_HAPTIC_RAMP
+ * \sa SDL_HapticEffect
  */
 typedef struct SDL_HapticRamp
 {
     /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_RAMP */
+    Uint16 type;            /**< SDL_HAPTIC_RAMP */
     SDL_HapticDirection direction;  /**< Direction of the effect. */
 
     /* Replay */
@@ -671,9 +682,9 @@ typedef struct SDL_HapticRamp
 } SDL_HapticRamp;
 
 /**
- * \brief A structure containing a template for a Left/Right effect.
+ * A structure containing a template for a Left/Right effect.
  *
- * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
+ * This struct is exclusively for the SDL_HAPTIC_LEFTRIGHT effect.
  *
  * The Left/Right effect is used to explicitly control the large and small
  * motors, commonly found in modern game controllers. The small (right) motor
@@ -685,7 +696,7 @@ typedef struct SDL_HapticRamp
 typedef struct SDL_HapticLeftRight
 {
     /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_LEFTRIGHT */
+    Uint16 type;            /**< SDL_HAPTIC_LEFTRIGHT */
 
     /* Replay */
     Uint32 length;          /**< Duration of the effect in milliseconds. */
@@ -696,24 +707,24 @@ typedef struct SDL_HapticLeftRight
 } SDL_HapticLeftRight;
 
 /**
- *  \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
+ * A structure containing a template for the SDL_HAPTIC_CUSTOM effect.
  *
- *  This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect.
+ * This struct is exclusively for the SDL_HAPTIC_CUSTOM effect.
  *
- *  A custom force feedback effect is much like a periodic effect, where the
- *  application can define its exact shape.  You will have to allocate the
- *  data yourself.  Data should consist of channels * samples Uint16 samples.
+ * A custom force feedback effect is much like a periodic effect, where the
+ * application can define its exact shape. You will have to allocate the data
+ * yourself. Data should consist of channels * samples Uint16 samples.
  *
- *  If channels is one, the effect is rotated using the defined direction.
- *  Otherwise it uses the samples in data for the different axes.
+ * If channels is one, the effect is rotated using the defined direction.
+ * Otherwise it uses the samples in data for the different axes.
  *
- *  \sa SDL_HAPTIC_CUSTOM
- *  \sa SDL_HapticEffect
+ * \sa SDL_HAPTIC_CUSTOM
+ * \sa SDL_HapticEffect
  */
 typedef struct SDL_HapticCustom
 {
     /* Header */
-    Uint16 type;            /**< ::SDL_HAPTIC_CUSTOM */
+    Uint16 type;            /**< SDL_HAPTIC_CUSTOM */
     SDL_HapticDirection direction;  /**< Direction of the effect. */
 
     /* Replay */
@@ -738,27 +749,28 @@ typedef struct SDL_HapticCustom
 } SDL_HapticCustom;
 
 /**
- *  \brief The generic template for any haptic effect.
+ * The generic template for any haptic effect.
+ *
+ * All values max at 32767 (0x7FFF). Signed values also can be negative. Time
+ * values unless specified otherwise are in milliseconds.
  *
- *  All values max at 32767 (0x7FFF).  Signed values also can be negative.
- *  Time values unless specified otherwise are in milliseconds.
+ * You can also pass SDL_HAPTIC_INFINITY to length instead of a 0-32767 value.
+ * Neither delay, interval, attack_length nor fade_length support
+ * SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends.
  *
- *  You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767
- *  value.  Neither delay, interval, attack_length nor fade_length support
- *  ::SDL_HAPTIC_INFINITY.  Fade will also not be used since effect never ends.
+ * Additionally, the SDL_HAPTIC_RAMP effect does not support a duration of
+ * SDL_HAPTIC_INFINITY.
  *
- *  Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
- *  ::SDL_HAPTIC_INFINITY.
+ * Button triggers may not be supported on all devices, it is advised to not
+ * use them if possible. Buttons start at index 1 instead of index 0 like the
+ * joystick.
  *
- *  Button triggers may not be supported on all devices, it is advised to not
- *  use them if possible.  Buttons start at index 1 instead of index 0 like
- *  the joystick.
+ * If both attack_length and fade_level are 0, the envelope is not used,
+ * otherwise both values are used.
  *
- *  If both attack_length and fade_level are 0, the envelope is not used,
- *  otherwise both values are used.
+ * Common parts:
  *
- *  Common parts:
- *  \code
+ * ```c
  *  // Replay - All effects have this
  *  Uint32 length;        // Duration of effect (ms).
  *  Uint16 delay;         // Delay before starting effect.
@@ -772,39 +784,39 @@ typedef struct SDL_HapticCustom
  *  Uint16 attack_level;  // Level at the start of the attack.
  *  Uint16 fade_length;   // Duration of the fade out (ms).
  *  Uint16 fade_level;    // Level at the end of the fade.
- *  \endcode
- *
- *
- *  Here we have an example of a constant effect evolution in time:
- *  \verbatim
-    Strength
-    ^
-    |
-    |    effect level -->  _________________
-    |                     /                 \
-    |                    /                   \
-    |                   /                     \
-    |                  /                       \
-    | attack_level --> |                        \
-    |                  |                        |  <---  fade_level
-    |
-    +--------------------------------------------------> Time
-                       [--]                 [---]
-                       attack_length        fade_length
-
-    [------------------][-----------------------]
-    delay               length
-    \endverbatim
- *
- *  Note either the attack_level or the fade_level may be above the actual
- *  effect level.
- *
- *  \sa SDL_HapticConstant
- *  \sa SDL_HapticPeriodic
- *  \sa SDL_HapticCondition
- *  \sa SDL_HapticRamp
- *  \sa SDL_HapticLeftRight
- *  \sa SDL_HapticCustom
+ * ```
+ *
+ * Here we have an example of a constant effect evolution in time:
+ *
+ * ```
+ *  Strength
+ *  ^
+ *  |
+ *  |    effect level -->  _________________
+ *  |                     /                 \
+ *  |                    /                   \
+ *  |                   /                     \
+ *  |                  /                       \
+ *  | attack_level --> |                        \
+ *  |                  |                        |  <---  fade_level
+ *  |
+ *  +--------------------------------------------------> Time
+ *                     [--]                 [---]
+ *                     attack_length        fade_length
+ *
+ *  [------------------][-----------------------]
+ *  delay               length
+ * ```
+ *
+ * Note either the attack_level or the fade_level may be above the actual
+ * effect level.
+ *
+ * \sa SDL_HapticConstant
+ * \sa SDL_HapticPeriodic
+ * \sa SDL_HapticCondition
+ * \sa SDL_HapticRamp
+ * \sa SDL_HapticLeftRight
+ * \sa SDL_HapticCustom
  */
 typedef union SDL_HapticEffect
 {

+ 3 - 2
include/SDL_hidapi.h

@@ -71,14 +71,15 @@ extern "C" {
 #endif
 
 /**
- *  \brief  A handle representing an open HID device
+ * A handle representing an open HID device
  */
 struct SDL_hid_device_;
 typedef struct SDL_hid_device_ SDL_hid_device; /**< opaque hidapi structure */
 
 /** hidapi info structure */
+
 /**
- *  \brief  Information about a connected HID device
+ * Information about a connected HID device
  */
 typedef struct SDL_hid_device_info
 {

+ 1691 - 1311
include/SDL_hints.h

@@ -48,110 +48,132 @@ extern "C" {
 #endif
 
 /**
- *  \brief  A variable controlling whether the Android / iOS built-in
- *  accelerometer should be listed as a joystick device.
+ * A variable controlling whether the Android / iOS built-in accelerometer
+ * should be listed as a joystick device.
  *
- *  This variable can be set to the following values:
- *    "0"       - The accelerometer is not listed as a joystick
- *    "1"       - The accelerometer is available as a 3 axis joystick (the default).
+ * This variable can be set to the following values:
+ *
+ * - "0": The accelerometer is not listed as a joystick
+ * - "1": The accelerometer is available as a 3 axis joystick (the default).
  */
 #define SDL_HINT_ACCELEROMETER_AS_JOYSTICK "SDL_ACCELEROMETER_AS_JOYSTICK"
 
 /**
- *  \brief Specify the behavior of Alt+Tab while the keyboard is grabbed.
+ * Specify the behavior of Alt+Tab while the keyboard is grabbed.
  *
- * By default, SDL emulates Alt+Tab functionality while the keyboard is grabbed
- * and your window is full-screen. This prevents the user from getting stuck in
- * your application if you've enabled keyboard grab.
+ * By default, SDL emulates Alt+Tab functionality while the keyboard is
+ * grabbed and your window is full-screen. This prevents the user from getting
+ * stuck in your application if you've enabled keyboard grab.
  *
  * The variable can be set to the following values:
- *   "0"       - SDL will not handle Alt+Tab. Your application is responsible
-                 for handling Alt+Tab while the keyboard is grabbed.
- *   "1"       - SDL will minimize your window when Alt+Tab is pressed (default)
-*/
+ *
+ * - "0": SDL will not handle Alt+Tab. Your application is responsible for
+ *   handling Alt+Tab while the keyboard is grabbed.
+ * - "1": SDL will minimize your window when Alt+Tab is pressed (default)
+ */
 #define SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
 
 /**
- *  \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
- *      This is a debugging aid for developers and not expected to be used by end users. The default is "1"
+ * If set to "0" then never set the top most bit on a SDL Window, even if the
+ * video mode expects it.
+ *
+ * This is a debugging aid for developers and not expected to be used by end
+ * users. The default is "1"
  *
- *  This variable can be set to the following values:
- *    "0"       - don't allow topmost
- *    "1"       - allow topmost
+ * This variable can be set to the following values:
+ *
+ * - "0": don't allow topmost
+ * - "1": allow topmost
  */
 #define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST"
 
 /**
- * \brief Android APK expansion main file version. Should be a string number like "1", "2" etc.
+ * Android APK expansion main file version.
+ *
+ * Should be a string number like "1", "2" etc.
  *
- * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.
+ * Must be set together with
+ * SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION.
  *
  * If both hints were set then SDL_RWFromFile() will look into expansion files
- * after a given relative path was not found in the internal storage and assets.
+ * after a given relative path was not found in the internal storage and
+ * assets.
  *
- * By default this hint is not set and the APK expansion files are not searched.
+ * 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.
+ * Android APK expansion patch file version.
+ *
+ * Should be a string number like "1", "2" etc.
  *
  * Must be set together with SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION.
  *
  * If both hints were set then SDL_RWFromFile() will look into expansion files
- * after a given relative path was not found in the internal storage and assets.
+ * after a given relative path was not found in the internal storage and
+ * assets.
  *
- * By default this hint is not set and the APK expansion files are not searched.
+ * By default this hint is not set and the APK expansion files are not
+ * searched.
  */
 #define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
 
 /**
- * \brief A variable to control whether the event loop will block itself when the app is paused.
+ * A variable to control whether the event loop will block itself when the app
+ * is paused.
  *
  * The variable can be set to the following values:
- *   "0"       - Non blocking.
- *   "1"       - Blocking. (default)
+ *
+ * - "0": Non blocking.
+ * - "1": Blocking. (default)
  *
  * The value should be set before SDL is initialized.
  */
 #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE"
 
 /**
- * \brief A variable to control whether SDL will pause audio in background
- *        (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking")
+ * A variable to control whether SDL will pause audio in background (Requires
+ * SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking")
  *
  * The variable can be set to the following values:
- *   "0"       - Non paused.
- *   "1"       - Paused. (default)
+ *
+ * - "0": Non paused.
+ * - "1": Paused. (default)
  *
  * The value should be set before SDL is initialized.
  */
 #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
 
 /**
- * \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
- *        SDL_SCANCODE_AC_BACK.
+ * 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 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
- *               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.
+ * - "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 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.
  */
 #define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON"
 
 /**
- *  \brief Specify an application name.
+ * 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
- * screensaver.  You should use a string that describes your program ("My Game
+ * screensaver. You should use a string that describes your program ("My Game
  * 2: The Revenge")
  *
  * Setting this to "" or leaving it unset will have SDL use a reasonable
@@ -166,48 +188,51 @@ extern "C" {
 #define SDL_HINT_APP_NAME "SDL_APP_NAME"
 
 /**
- *  \brief  A variable controlling whether controllers used with the Apple TV
- *  generate UI events.
+ * A variable controlling whether controllers used with the Apple TV generate
+ * UI events.
  *
  * When UI events are generated by controller input, the app will be
- * backgrounded when the Apple TV remote's menu button is pressed, and when the
- * pause or B buttons on gamepads are pressed.
+ * backgrounded when the Apple TV remote's menu button is pressed, and when
+ * the pause or B buttons on gamepads are pressed.
  *
  * More information about properly making use of controllers for the Apple TV
  * can be found here:
  * https://developer.apple.com/tvos/human-interface-guidelines/remote-and-controllers/
  *
- *  This variable can be set to the following values:
- *    "0"       - Controller input does not generate UI events (the default).
- *    "1"       - Controller input generates UI events.
+ * This variable can be set to the following values:
+ *
+ * - "0": Controller input does not generate UI events (the default).
+ * - "1": Controller input generates UI events.
  */
 #define SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
 
 /**
- * \brief  A variable controlling whether the Apple TV remote's joystick axes
- *         will automatically match the rotation of the remote.
+ * A variable controlling whether the Apple TV remote's joystick axes will
+ * automatically match the rotation of the remote.
  *
- *  This variable can be set to the following values:
- *    "0"       - Remote orientation does not affect joystick axes (the default).
- *    "1"       - Joystick axes are based on the orientation of the remote.
+ * This variable can be set to the following values:
+ *
+ * - "0": Remote orientation does not affect joystick axes (the default).
+ * - "1": Joystick axes are based on the orientation of the remote.
  */
 #define SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
 
 /**
- *  \brief  A variable controlling the audio category on iOS and Mac OS X
+ * A variable controlling the audio category on iOS and Mac OS X
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "ambient"     - Use the AVAudioSessionCategoryAmbient audio category, will be muted by the phone mute switch (default)
- *    "playback"    - Use the AVAudioSessionCategoryPlayback category
+ * - "ambient": Use the AVAudioSessionCategoryAmbient audio category, will be
+ *   muted by the phone mute switch (default)
+ * - "playback": Use the AVAudioSessionCategoryPlayback category
  *
- *  For more information, see Apple's documentation:
- *  https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
+ * For more information, see Apple's documentation:
+ * https://developer.apple.com/library/content/documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategoriesandModes/AudioSessionCategoriesandModes.html
  */
 #define SDL_HINT_AUDIO_CATEGORY   "SDL_AUDIO_CATEGORY"
 
 /**
- *  \brief Specify an application name for an audio device.
+ * Specify an application name for an audio device.
  *
  * Some audio backends (such as PulseAudio) allow you to describe your audio
  * stream. Among other things, this description might show up in a system
@@ -228,7 +253,7 @@ extern "C" {
 #define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME"
 
 /**
- *  \brief Specify an application name for an audio device.
+ * Specify an application name for an audio device.
  *
  * Some audio backends (such as PulseAudio) allow you to describe your audio
  * stream. Among other things, this description might show up in a system
@@ -249,11 +274,11 @@ extern "C" {
 #define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME"
 
 /**
- *  \brief Specify an application role for an audio device.
+ * Specify an application role for an audio device.
  *
  * Some audio backends (such as Pipewire) allow you to describe the role of
- * your audio stream. Among other things, this description might show up in
- * a system control panel or software for displaying and manipulating media
+ * your audio stream. Among other things, this description might show up in a
+ * system control panel or software for displaying and manipulating media
  * playback/capture graphs.
  *
  * This hints lets you transmit that information to the OS. The contents of
@@ -269,1487 +294,1746 @@ extern "C" {
 #define SDL_HINT_AUDIO_DEVICE_STREAM_ROLE "SDL_AUDIO_DEVICE_STREAM_ROLE"
 
 /**
- *  \brief  A variable controlling speed/quality tradeoff of audio resampling.
+ * A variable controlling speed/quality tradeoff of audio resampling.
  *
- *  If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
- *  to handle audio resampling. There are different resampling modes available
- *  that produce different levels of quality, using more CPU.
+ * If available, SDL can use libsamplerate ( http://www.mega-nerd.com/SRC/ )
+ * to handle audio resampling. There are different resampling modes available
+ * that produce different levels of quality, using more CPU.
  *
- *  If this hint isn't specified to a valid setting, or libsamplerate isn't
- *  available, SDL will use the default, internal resampling algorithm.
+ * If this hint isn't specified to a valid setting, or libsamplerate isn't
+ * available, SDL will use the default, internal resampling algorithm.
  *
- *  As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is available.
+ * As of SDL 2.26, SDL_ConvertAudio() respects this hint when libsamplerate is
+ * available.
  *
- *  This hint is currently only checked at audio subsystem initialization.
+ * This hint is currently only checked at audio subsystem initialization.
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "0" or "default" - Use SDL's internal resampling (Default when not set - low quality, fast)
- *    "1" or "fast"    - Use fast, slightly higher quality resampling, if available
- *    "2" or "medium"  - Use medium quality resampling, if available
- *    "3" or "best"    - Use high quality resampling, if available
+ * - "0" or "default": Use SDL's internal resampling (Default when not set -
+ *   low quality, fast)
+ * - "1" or "fast": Use fast, slightly higher quality resampling, if available
+ * - "2" or "medium": Use medium quality resampling, if available
+ * - "3" or "best": Use high quality resampling, if available
  */
 #define SDL_HINT_AUDIO_RESAMPLING_MODE   "SDL_AUDIO_RESAMPLING_MODE"
 
 /**
- *  \brief  A variable controlling whether SDL updates joystick state when getting input events
+ * A variable controlling whether SDL updates joystick state when getting
+ * input events
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "0"     - You'll call SDL_JoystickUpdate() manually
- *    "1"     - SDL will automatically call SDL_JoystickUpdate() (default)
+ * - "0": You'll call SDL_JoystickUpdate() manually
+ * - "1": SDL will automatically call SDL_JoystickUpdate() (default)
  *
- *  This hint can be toggled on and off at runtime.
+ * This hint can be toggled on and off at runtime.
  */
 #define SDL_HINT_AUTO_UPDATE_JOYSTICKS  "SDL_AUTO_UPDATE_JOYSTICKS"
 
 /**
- *  \brief  A variable controlling whether SDL updates sensor state when getting input events
+ * A variable controlling whether SDL updates sensor state when getting input
+ * events
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "0"     - You'll call SDL_SensorUpdate() manually
- *    "1"     - SDL will automatically call SDL_SensorUpdate() (default)
+ * - "0": You'll call SDL_SensorUpdate() manually
+ * - "1": SDL will automatically call SDL_SensorUpdate() (default)
  *
- *  This hint can be toggled on and off at runtime.
+ * This hint can be toggled on and off at runtime.
  */
 #define SDL_HINT_AUTO_UPDATE_SENSORS    "SDL_AUTO_UPDATE_SENSORS"
 
 /**
- *  \brief Prevent SDL from using version 4 of the bitmap header when saving BMPs.
+ * Prevent SDL from using version 4 of the bitmap header when saving BMPs.
  *
- * The bitmap header version 4 is required for proper alpha channel support and
- * SDL will use it when required. Should this not be desired, this hint can
- * force the use of the 40 byte header version which is supported everywhere.
+ * The bitmap header version 4 is required for proper alpha channel support
+ * and SDL will use it when required. Should this not be desired, this hint
+ * can force the use of the 40 byte header version which is supported
+ * everywhere.
  *
  * The variable can be set to the following values:
- *   "0"       - Surfaces with a colorkey or an alpha channel are saved to a
- *               32-bit BMP file with an alpha mask. SDL will use the bitmap
- *               header version 4 and set the alpha mask accordingly.
- *   "1"       - Surfaces with a colorkey or an alpha channel are saved to a
- *               32-bit BMP file without an alpha mask. The alpha channel data
- *               will be in the file, but applications are going to ignore it.
+ *
+ * - "0": Surfaces with a colorkey or an alpha channel are saved to a 32-bit
+ *   BMP file with an alpha mask. SDL will use the bitmap header version 4 and
+ *   set the alpha mask accordingly.
+ * - "1": Surfaces with a colorkey or an alpha channel are saved to a 32-bit
+ *   BMP file without an alpha mask. The alpha channel data will be in the
+ *   file, but applications are going to ignore it.
  *
  * The default value is "0".
  */
 #define SDL_HINT_BMP_SAVE_LEGACY_FORMAT "SDL_BMP_SAVE_LEGACY_FORMAT"
 
 /**
- *  \brief Override for SDL_GetDisplayUsableBounds()
+ * Override for SDL_GetDisplayUsableBounds()
  *
- *  If set, this hint will override the expected results for
- *  SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
- *  to do this, but this allows an embedded system to request that some of the
- *  screen be reserved for other uses when paired with a well-behaved
- *  application.
+ * If set, this hint will override the expected results for
+ * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
+ * to do this, but this allows an embedded system to request that some of the
+ * screen be reserved for other uses when paired with a well-behaved
+ * application.
  *
- *  The contents of this hint must be 4 comma-separated integers, the first
- *  is the bounds x, then y, width and height, in that order.
+ * The contents of this hint must be 4 comma-separated integers, the first is
+ * the bounds x, then y, width and height, in that order.
  */
 #define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
 
 /**
- *  \brief Disable giving back control to the browser automatically
- *  when running with asyncify
+ * Disable giving back control to the browser automatically when running with
+ * asyncify
  *
- * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations
- * such as refreshing the screen or polling events.
+ * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations such as
+ * refreshing the screen or polling events.
  *
  * This hint only applies to the emscripten platform
  *
  * The variable can be set to the following values:
- *    "0"       - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes)
- *    "1"       - Enable emscripten_sleep calls (the default)
+ *
+ * - "0": Disable emscripten_sleep calls (if you give back browser control
+ *   manually or use asyncify for other purposes)
+ * - "1": Enable emscripten_sleep calls (the default)
  */
 #define SDL_HINT_EMSCRIPTEN_ASYNCIFY   "SDL_EMSCRIPTEN_ASYNCIFY"
 
 /**
- *  \brief override the binding element for keyboard inputs for Emscripten builds
+ * override the binding element for keyboard inputs for Emscripten builds
  *
- * This hint only applies to the emscripten platform
+ * This hint only applies to the emscripten platform.
+ *
+ * The variable can be one of:
  *
- * The variable can be one of
- *    "#window"      - The javascript window object (this is the default)
- *    "#document"    - The javascript document object
- *    "#screen"      - the javascript window.screen object
- *    "#canvas"      - the WebGL canvas element
- *    any other string without a leading # sign applies to the element on the page with that ID.
+ * - "#window": the javascript window object (this is the default)
+ * - "#document": the javascript document object
+ * - "#screen": the javascript window.screen object
+ * - "#canvas": the WebGL canvas element
+ *
+ * Any other string without a leading # sign applies to the element on the
+ * page with that ID.
  */
 #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
+ * 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:
  *
- *  The variable can be set to the following values:
- *    "0"       - Do not show the on-screen keyboard
- *    "1"       - Show the on-screen keyboard
+ * - "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.
+ * 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
+ * A variable that controls whether Steam Controllers should be exposed using
+ * the SDL joystick and game controller APIs
+ *
+ * The variable can be set to the following values:
  *
- *  The variable can be set to the following values:
- *    "0"       - Do not scan for Steam Controllers
- *    "1"       - Scan for Steam Controllers (the default)
+ * - "0": Do not scan for Steam Controllers
+ * - "1": Scan for Steam Controllers (the default)
  *
- *  The default value is "1".  This hint must be set before initializing the joystick subsystem.
+ * The default value is "1". This hint must be set before initializing the
+ * joystick subsystem.
  */
 #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
 
 /**
- *  \brief  A variable controlling verbosity of the logging of SDL events pushed onto the internal queue.
+ * A variable controlling verbosity of the logging of SDL events pushed onto
+ * the internal queue.
  *
- *  This variable can be set to the following values, from least to most verbose:
+ * This variable can be set to the following values, from least to most
+ * verbose:
  *
- *    "0"     - Don't log any events (default)
- *    "1"     - Log most events (other than the really spammy ones).
- *    "2"     - Include mouse and finger motion events.
- *    "3"     - Include SDL_SysWMEvent events.
+ * - "0": Don't log any events (default)
+ * - "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
- *  on in the event queue. Logged events are sent through SDL_Log(), which
- *  means by default they appear on stdout on most platforms or maybe
- *  OutputDebugString() on Windows, and can be funneled by the app with
- *  SDL_LogSetOutputFunction(), etc.
+ * 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
+ * on in the event queue. Logged events are sent through SDL_Log(), which
+ * means by default they appear on stdout on most platforms or maybe
+ * OutputDebugString() on Windows, and can be funneled by the app with
+ * SDL_LogSetOutputFunction(), etc.
  *
- *  This hint can be toggled on and off at runtime, if you only need to log
- *  events for a small subset of program execution.
+ * This hint can be toggled on and off at runtime, if you only need to log
+ * events for a small subset of program execution.
  */
 #define SDL_HINT_EVENT_LOGGING   "SDL_EVENT_LOGGING"
 
 /**
- *  \brief  A variable controlling whether raising the window should be done more forcefully
+ * A variable controlling whether raising the window should be done more
+ * forcefully
  *
- *  This variable can be set to the following values:
- *    "0"       - No forcing (the default)
- *    "1"       - Extra level of forcing
+ * This variable can be set to the following values:
+ *
+ * - "0": No forcing (the default)
+ * - "1": Extra level of forcing
  *
- *  At present, this is only an issue under MS Windows, which makes it nearly impossible to
- *  programmatically move a window to the foreground, for "security" reasons. See
- *  http://stackoverflow.com/a/34414846 for a discussion.
+ * At present, this is only an issue under MS Windows, which makes it nearly
+ * impossible to programmatically move a window to the foreground, for
+ * "security" reasons. See http://stackoverflow.com/a/34414846 for a
+ * discussion.
  */
 #define SDL_HINT_FORCE_RAISEWINDOW    "SDL_HINT_FORCE_RAISEWINDOW"
 
 /**
- *  \brief  A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
+ * A variable controlling how 3D acceleration is used to accelerate the SDL
+ * screen surface.
  *
- *  SDL can try to accelerate the SDL screen surface by using streaming
- *  textures with a 3D rendering engine.  This variable controls whether and
- *  how this is done.
+ * SDL can try to accelerate the SDL screen surface by using streaming
+ * textures with a 3D rendering engine. This variable controls whether and how
+ * this is done.
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable 3D acceleration
- *    "1"       - Enable 3D acceleration, using the default renderer.
- *    "X"       - Enable 3D acceleration, using X where X is one of the valid rendering drivers.  (e.g. "direct3d", "opengl", etc.)
+ * This variable can be set to the following values:
  *
- *  By default SDL tries to make a best guess for each platform whether
- *  to use acceleration or not.
+ * - "0": Disable 3D acceleration
+ * - "1": Enable 3D acceleration, using the default renderer.
+ * - "X": Enable 3D acceleration, using X where X is one of the valid
+ *   rendering drivers. (e.g. "direct3d", "opengl", etc.)
+ *
+ * By default SDL tries to make a best guess for each platform whether to use
+ * acceleration or not.
  */
 #define SDL_HINT_FRAMEBUFFER_ACCELERATION   "SDL_FRAMEBUFFER_ACCELERATION"
 
 /**
- *  \brief  A variable that lets you manually hint extra gamecontroller db entries.
+ * A variable that lets you manually hint extra gamecontroller db entries.
  *
- *  The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h
+ * The variable should be newline delimited rows of gamecontroller config
+ * data, see SDL_gamecontroller.h
  *
- *  This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
- *  You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
+ * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) You
+ * can update mappings after the system is initialized with
+ * SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
  */
 #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
 
 /**
- *  \brief  A variable that lets you provide a file with extra gamecontroller db entries.
+ * A variable that lets you provide a file with extra gamecontroller db
+ * entries.
  *
- *  The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h
+ * The file should contain lines of gamecontroller config data, see
+ * SDL_gamecontroller.h
  *
- *  This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
- *  You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
+ * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) You
+ * can update mappings after the system is initialized with
+ * SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
  */
 #define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE"
 
 /**
- *  \brief  A variable that overrides the automatic controller type detection
+ * A variable that overrides the automatic controller type detection
  *
- *  The variable should be comma separated entries, in the form: VID/PID=type
+ * The variable should be comma separated entries, in the form: VID/PID=type
  *
- *  The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
+ * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
  *
- *  The type should be one of:
- *      Xbox360
- *      XboxOne
- *      PS3
- *      PS4
- *      PS5
- *      SwitchPro
+ * The type should be one of: Xbox360 XboxOne PS3 PS4 PS5 SwitchPro
  *
- *  This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
+ * This hint affects what driver is used, and must be set before calling
+ * SDL_Init(SDL_INIT_GAMECONTROLLER)
  */
 #define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE"
 
 /**
- *  \brief  A variable containing a list of devices to skip when scanning for game controllers.
+ * A variable containing a list of devices to skip when scanning for game
+ * controllers.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES "SDL_GAMECONTROLLER_IGNORE_DEVICES"
 
 /**
- *  \brief  If set, all devices will be skipped when scanning for game controllers except for the ones listed in this variable.
+ * If set, all devices will be skipped when scanning for game controllers
+ * except for the ones listed in this variable.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
 
 /**
- *  \brief  If set, game controller face buttons report their values according to their labels instead of their positional layout.
+ * 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:
+ * For example, on Nintendo Switch controllers, normally you'd get:
  *
+ * ```
  *      (Y)
  *  (X)     (B)
  *      (A)
+ * ```
  *
- *  but if this hint is set, you'll get:
+ * but if this hint is set, you'll get:
  *
+ * ```
  *      (X)
  *  (Y)     (A)
  *      (B)
+ * ```
+ *
+ * The variable can be set to the following values:
  *
- *  The variable can be set to the following values:
- *    "0"       - Report the face buttons by position, as though they were on an Xbox controller.
- *    "1"       - Report the face buttons by label instead of position
+ * - "0": Report the face buttons by position, as though they were on an Xbox
+ *   controller.
+ * - "1": Report the face buttons by label instead of position
  *
- *  The default value is "1".  This hint may be set at any time.
+ * The default value is "1". This hint may be set at any time.
  */
 #define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
 
 /**
- *  \brief  A variable controlling whether grabbing input grabs the keyboard
+ * A variable controlling whether grabbing input grabs the keyboard
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Grab will affect only the mouse
- *    "1"       - Grab will affect mouse and keyboard
+ * - "0": Grab will affect only the mouse
+ * - "1": Grab will affect mouse and keyboard
  *
- *  By default SDL will not grab the keyboard so system shortcuts still work.
+ * By default SDL will not grab the keyboard so system shortcuts still work.
  */
 #define SDL_HINT_GRAB_KEYBOARD              "SDL_GRAB_KEYBOARD"
 
 /**
- *  \brief  A variable containing a list of devices to ignore in SDL_hid_enumerate()
+ * 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"
+ * 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.
+ * A variable controlling whether the idle timer is disabled on iOS.
  *
- *  When an iOS app does not receive touches for some time, the screen is
- *  dimmed automatically. For games where the accelerometer is the only input
- *  this is problematic. This functionality can be disabled by setting this
- *  hint.
+ * When an iOS app does not receive touches for some time, the screen is
+ * dimmed automatically. For games where the accelerometer is the only input
+ * this is problematic. This functionality can be disabled by setting this
+ * hint.
  *
- *  As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver()
- *  accomplish the same thing on iOS. They should be preferred over this hint.
+ * As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver()
+ * accomplish the same thing on iOS. They should be preferred over this hint.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Enable idle timer
- *    "1"       - Disable idle timer
+ * - "0": Enable idle timer
+ * - "1": Disable idle timer
  */
 #define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
 
 /**
- * \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
+ * A variable to control whether certain IMEs should handle text editing
+ * internally instead of sending SDL_TEXTEDITING events.
  *
  * 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
- *               differentiate it somehow from committed text. (default)
- *   "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.
+ *
+ * - "0": SDL_TEXTEDITING events are sent, and it is the application's
+ *   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,
+ *   and text that is being composed will be rendered in its own UI.
  */
 #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
 
 /**
- * \brief A variable to control whether certain IMEs should show native UI components (such as the Candidate List) instead of suppressing them.
+ * A variable to control whether certain IMEs should show native UI components
+ * (such as the Candidate List) instead of suppressing them.
  *
  * The variable can be set to the following values:
- *   "0"       - Native UI components are not display. (default)
- *   "1"       - Native UI components are displayed.
+ *
+ * - "0": Native UI components are not display. (default)
+ * - "1": Native UI components are displayed.
  */
 #define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI"
 
 /**
- * \brief A variable to control if extended IME text support is enabled.
- * If enabled then SDL_TextEditingExtEvent will be issued if the text would be truncated otherwise.
- * Additionally SDL_TextInputEvent will be dispatched multiple times so that it is not truncated.
+ * A variable to control if extended IME text support is enabled.
+ *
+ * If enabled then SDL_TextEditingExtEvent will be issued if the text would be
+ * truncated otherwise. Additionally SDL_TextInputEvent will be dispatched
+ * multiple times so that it is not truncated.
  *
  * The variable can be set to the following values:
- *   "0"       - Legacy behavior. Text can be truncated, no heap allocations. (default)
- *   "1"       - Modern behavior.
+ *
+ * - "0": Legacy behavior. Text can be truncated, no heap allocations.
+ *   (default)
+ * - "1": Modern behavior.
  */
 #define SDL_HINT_IME_SUPPORT_EXTENDED_TEXT "SDL_IME_SUPPORT_EXTENDED_TEXT"
 
 /**
- * \brief  A variable controlling whether the home indicator bar on iPhone X
- *         should be hidden.
+ * A variable controlling whether the home indicator bar on iPhone X should be
+ * hidden.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - The indicator bar is not hidden (default for windowed applications)
- *    "1"       - The indicator bar is hidden and is shown when the screen is touched (useful for movie playback applications)
- *    "2"       - The indicator bar is dim and the first swipe makes it visible and the second swipe performs the "home" action (default for fullscreen applications)
+ * - "0": The indicator bar is not hidden (default for windowed applications)
+ * - "1": The indicator bar is hidden and is shown when the screen is touched
+ *   (useful for movie playback applications)
+ * - "2": The indicator bar is dim and the first swipe makes it visible and
+ *   the second swipe performs the "home" action (default for fullscreen
+ *   applications)
  */
 #define SDL_HINT_IOS_HIDE_HOME_INDICATOR "SDL_IOS_HIDE_HOME_INDICATOR"
 
 /**
- *  \brief  A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
+ * A variable that lets you enable joystick (and gamecontroller) events even
+ * when your app is in the background.
  *
- *  The variable can be set to the following values:
- *    "0"       - Disable joystick & gamecontroller input events when the
- *                application is in the background.
- *    "1"       - Enable joystick & gamecontroller input events when the
- *                application is in the background.
+ * The variable can be set to the following values:
+ *
+ * - "0": Disable joystick & gamecontroller input events when the application
+ *   is in the background.
+ * - "1": Enable joystick & gamecontroller input events when the application
+ *   is in the background.
  *
- *  The default value is "0".  This hint may be set at any time.
+ * The default value is "0". This hint may be set at any time.
  */
 #define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
 
 /**
- *  A variable containing a list of arcade stick style controllers.
+ * A variable containing a list of arcade stick style controllers.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES "SDL_JOYSTICK_ARCADESTICK_DEVICES"
 
 /**
- *  A variable containing a list of devices that are not arcade stick style controllers. This will override SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES and the built in device list.
+ * A variable containing a list of devices that are not arcade stick style
+ * controllers.
+ *
+ * This will override SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES and the built in
+ * device list.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED"
 
 /**
- *  A variable containing a list of devices that should not be considerd joysticks.
+ * A variable containing a list of devices that should not be considerd
+ * joysticks.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES "SDL_JOYSTICK_BLACKLIST_DEVICES"
 
 /**
- *  A variable containing a list of devices that should be considered joysticks. This will override SDL_HINT_JOYSTICK_BLACKLIST_DEVICES and the built in device list.
+ * A variable containing a list of devices that should be considered
+ * joysticks.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * This will override SDL_HINT_JOYSTICK_BLACKLIST_DEVICES and the built in
+ * device list.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ *
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED "SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED"
 
 /**
- *  A variable containing a list of flightstick style controllers.
+ * A variable containing a list of flightstick style controllers.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES "SDL_JOYSTICK_FLIGHTSTICK_DEVICES"
 
 /**
- *  A variable containing a list of devices that are not flightstick style controllers. This will override SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES and the built in device list.
+ * A variable containing a list of devices that are not flightstick style
+ * controllers.
+ *
+ * This will override SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES and the built in
+ * device list.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED "SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED"
 
 /**
- *  A variable containing a list of devices known to have a GameCube form factor.
+ * A variable containing a list of devices known to have a GameCube form
+ * factor.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES "SDL_JOYSTICK_GAMECUBE_DEVICES"
 
 /**
- *  A variable containing a list of devices known not to have a GameCube form factor. This will override SDL_HINT_JOYSTICK_GAMECUBE_DEVICES and the built in device list.
+ * A variable containing a list of devices known not to have a GameCube form
+ * factor.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * This will override SDL_HINT_JOYSTICK_GAMECUBE_DEVICES and the built in
+ * device list.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ *
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED "SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI joystick drivers should be used.
+ * A variable controlling whether the HIDAPI joystick drivers should be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI drivers are not used
- *    "1"       - HIDAPI drivers are used (the default)
+ * - "0": HIDAPI drivers are not used
+ * - "1": HIDAPI drivers are used (the default)
  *
- *  This variable is the default for all drivers, but can be overridden by the hints for specific drivers below.
+ * This variable is the default for all drivers, but can be overridden by the
+ * hints for specific drivers below.
  */
 #define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
+ * A variable controlling whether the HIDAPI driver for Nintendo GameCube
+ * controllers should be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI driver is not used
- *    "1"       - HIDAPI driver is used
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE"
 
 /**
- *  \brief  A variable controlling whether "low_frequency_rumble" and "high_frequency_rumble" is used to implement
- *          the GameCube controller's 3 rumble modes, Stop(0), Rumble(1), and StopHard(2)
- *          this is useful for applications that need full compatibility for things like ADSR envelopes.
- *          Stop is implemented by setting "low_frequency_rumble" to "0" and "high_frequency_rumble" ">0"
- *          Rumble is both at any arbitrary value,
- *          StopHard is implemented by setting both "low_frequency_rumble" and "high_frequency_rumble" to "0"
+ * A variable controlling whether "low_frequency_rumble" and
+ * "high_frequency_rumble" is used to implement the GameCube controller's 3
+ * rumble modes, Stop(0), Rumble(1), and StopHard(2) this is useful for
+ * applications that need full compatibility for things like ADSR envelopes.
  *
- *  This variable can be set to the following values:
- *    "0"       - Normal rumble behavior is behavior is used (default)
- *    "1"       - Proper GameCube controller rumble behavior is used
+ * Stop is implemented by setting "low_frequency_rumble" to "0" and
+ * "high_frequency_rumble" ">0" Rumble is both at any arbitrary value,
+ * StopHard is implemented by setting both "low_frequency_rumble" and
+ * "high_frequency_rumble" to "0"
  *
+ * This variable can be set to the following values:
+ *
+ * - "0": Normal rumble behavior is behavior is used (default)
+ * - "1": Proper GameCube controller rumble behavior is used
  */
 #define SDL_HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
 
 /**
-  *  \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"       - HIDAPI driver is not used
-  *    "1"       - HIDAPI driver is used
-  *
-  *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
-  */
+ * 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": 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_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)
-  */
+ * 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)
-  */
+ * 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:
-  *    "0"       - HIDAPI driver is not used
-  *    "1"       - HIDAPI driver is used
-  *
-  *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
-  */
+ * 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:
+ *
+ * - "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_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
-  */
+ * 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
-  */
+ * 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.
+ * 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
+ * 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.
+ * 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.
+ * 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.
+ * A variable controlling whether the HIDAPI driver for PS4 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 variable can be set to the following values:
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * - "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_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
 
 /**
- *  \brief  A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
+ * A variable controlling whether extended input reports should be used for
+ * PS4 controllers when using the HIDAPI driver.
  *
- *  This variable can be set to the following values:
- *    "0"       - extended reports are not enabled (the default)
- *    "1"       - extended reports
+ * This variable can be set to the following values:
  *
- *  Extended input reports allow rumble on Bluetooth PS4 controllers, but
- *  break DirectInput handling for applications that don't use SDL.
+ * - "0": extended reports are not enabled (the default)
+ * - "1": extended reports
  *
- *  Once extended reports are enabled, they can not be disabled without
- *  power cycling the controller.
+ * Extended input reports allow rumble on Bluetooth PS4 controllers, but break
+ * DirectInput handling for applications that don't use SDL.
  *
- *  For compatibility with applications written for versions of SDL prior
- *  to the introduction of PS5 controller support, this value will also
- *  control the state of extended reports on PS5 controllers when the
- *  SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set.
+ * Once extended reports are enabled, they can not be disabled without power
+ * cycling the controller.
+ *
+ * For compatibility with applications written for versions of SDL prior to
+ * the introduction of PS5 controller support, this value will also control
+ * the state of extended reports on PS5 controllers when the
+ * SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE hint is not explicitly set.
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI driver for PS5 controllers should be used.
+ * A variable controlling whether the HIDAPI driver for PS5 controllers should
+ * be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI driver is not used
- *    "1"       - HIDAPI driver is used
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5"
 
 /**
- *  \brief  A variable controlling whether the player LEDs should be lit to indicate which player is associated with a PS5 controller.
+ * A variable controlling whether the player LEDs should be lit to indicate
+ * which player is associated with a PS5 controller.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - player LEDs are not enabled
- *    "1"       - player LEDs are enabled (the default)
+ * - "0": player LEDs are not enabled
+ * - "1": player LEDs are enabled (the default)
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"
 
 /**
- *  \brief  A variable controlling whether extended input reports should be used for PS5 controllers when using the HIDAPI driver.
+ * A variable controlling whether extended input reports should be used for
+ * PS5 controllers when using the HIDAPI driver.
  *
- *  This variable can be set to the following values:
- *    "0"       - extended reports are not enabled (the default)
- *    "1"       - extended reports
+ * This variable can be set to the following values:
+ *
+ * - "0": extended reports are not enabled (the default)
+ * - "1": extended reports
  *
- *  Extended input reports allow rumble on Bluetooth PS5 controllers, but
- *  break DirectInput handling for applications that don't use SDL.
+ * Extended input reports allow rumble on Bluetooth PS5 controllers, but break
+ * DirectInput handling for applications that don't use SDL.
  *
- *  Once extended reports are enabled, they can not be disabled without
- *  power cycling the controller.
+ * Once extended reports are enabled, they can not be disabled without power
+ * cycling the controller.
  *
- *  For compatibility with applications written for versions of SDL prior
- *  to the introduction of PS5 controller support, this value defaults to
- *  the value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.
+ * For compatibility with applications written for versions of SDL prior to
+ * the introduction of PS5 controller support, this value defaults to the
+ * value of SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE.
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_PS5_RUMBLE "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI driver for Google Stadia controllers should be used.
+ * A variable controlling whether the HIDAPI driver for Google Stadia
+ * 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 variable can be set to the following values:
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * - "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_STADIA "SDL_JOYSTICK_HIDAPI_STADIA"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI driver for Bluetooth Steam Controllers should be used.
+ * 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
- *    "1"       - HIDAPI driver is used for Steam Controllers, which requires Bluetooth access
- *                and may prompt the user for permission on iOS and Android.
+ * This variable can be set to the following values:
  *
- *  The default is "0"
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used for Steam Controllers, which requires
+ *   Bluetooth access and may prompt the user for permission on iOS and
+ *   Android.
+ *
+ * The default is "0"
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_STEAM "SDL_JOYSTICK_HIDAPI_STEAM"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI driver for the Steam Deck builtin controller should be used.
+ * A variable controlling whether the HIDAPI driver for the Steam Deck builtin
+ * controller should be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI driver is not used
- *    "1"       - HIDAPI driver is used
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
  */
 #define SDL_HINT_JOYSTICK_HIDAPI_STEAMDECK "SDL_JOYSTICK_HIDAPI_STEAMDECK"
 
 /**
- *  \brief  A variable controlling whether the HIDAPI driver for Nintendo Switch controllers should be used.
+ * A variable controlling whether the HIDAPI driver for Nintendo Switch
+ * controllers should be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI driver is not used
- *    "1"       - HIDAPI driver is used
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
  */
 #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 Pro controller is opened
+ * 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
+ * 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.
+ * 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
+ * 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
+ * This variable can be set to the following values:
  *
- *  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.
+ * - "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.
+ * 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:
  *
- *  This variable can be set to the following values:
- *    "0"       - player LEDs are not enabled
- *    "1"       - player LEDs are enabled (the default)
+ * - "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.
+ * 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:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI driver is not used
- *    "1"       - HIDAPI driver is used
+ * - "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.
+ * 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.
+ * 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:
  *
- *  This variable can be set to the following values:
- *    "0"       - player LEDs are not enabled
- *    "1"       - player LEDs are enabled (the default)
+ * - "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.
+ * A variable controlling whether the HIDAPI driver for XBox 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 variable can be set to the following values:
+ *
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used
  *
- *  The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI
+ * The default is "0" on Windows, otherwise the value of
+ * SDL_HINT_JOYSTICK_HIDAPI
  */
 #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.
+ * 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
+ * This variable can be set to the following values:
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX
+ * - "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.
+ * 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:
  *
- *  This variable can be set to the following values:
- *    "0"       - player LEDs are not enabled
- *    "1"       - player LEDs are enabled (the default)
+ * - "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.
+ * A variable controlling whether the HIDAPI driver for XBox 360 wireless
+ * controllers should be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - HIDAPI driver is not used
- *    "1"       - HIDAPI driver is used
+ * - "0": HIDAPI driver is not used
+ * - "1": HIDAPI driver is used
  *
- *  The default is the value of SDL_HINT_JOYSTICK_HIDAPI_XBOX_360
+ * 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.
+ * 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
+ * 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
+ * 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
+ * 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
+ * This variable can be set to the following values:
  *
- *  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.
+ * - "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"
 
 /**
-  *  A variable controlling whether IOKit should be used for controller handling.
-  *
-  *  This variable can be set to the following values:
-  *    "0"       - IOKit is not used
-  *    "1"       - IOKit is used (the default)
-  */
+ * A variable controlling whether IOKit should be used for controller
+ * handling.
+ *
+ * This variable can be set to the following values:
+ *
+ * - "0": IOKit is not used
+ * - "1": IOKit is used (the default)
+ */
 #define SDL_HINT_JOYSTICK_IOKIT "SDL_JOYSTICK_IOKIT"
 
 /**
-  *  A variable controlling whether GCController should be used for controller handling.
-  *
-  *  This variable can be set to the following values:
-  *    "0"       - GCController is not used
-  *    "1"       - GCController is used (the default)
-  */
+ * A variable controlling whether GCController should be used for controller
+ * handling.
+ *
+ * This variable can be set to the following values:
+ *
+ * - "0": GCController is not used
+ * - "1": GCController is used (the default)
+ */
 #define SDL_HINT_JOYSTICK_MFI "SDL_JOYSTICK_MFI"
 
 /**
-  *  \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:
-  *    "0"       - RAWINPUT drivers are not used
-  *    "1"       - RAWINPUT drivers are used (the default)
-  */
+ * 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:
+ *
+ * - "0": RAWINPUT drivers are not used
+ * - "1": RAWINPUT drivers are used (the default)
+ */
 #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:
-  *    "0"       - RAWINPUT driver will only use data from raw input APIs
-  *    "1"       - RAWINPUT driver will also pull data from XInput, providing
-  *                better trigger axes, guide button presses, and rumble support
-  *                for Xbox controllers
-  *
-  *  The default is "1".  This hint applies to any joysticks opened after setting the hint.
-  */
+ * A variable controlling whether the RAWINPUT driver should pull correlated
+ * data from XInput.
+ *
+ * This variable can be set to the following values:
+ *
+ * - "0": RAWINPUT driver will only use data from raw input APIs
+ * - "1": RAWINPUT driver will also pull data from XInput, providing better
+ *   trigger axes, guide button presses, and rumble support for Xbox
+ *   controllers
+ *
+ * The default is "1". This hint applies to any joysticks opened after setting
+ * the hint.
+ */
 #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:
-  *    "0"       - ROG Chakram mice do not show up as joysticks (the default)
-  *    "1"       - ROG Chakram mice show up as joysticks
-  */
+ * A variable controlling whether the ROG Chakram mice should show up as
+ * joysticks
+ *
+ * This variable can be set to the following values:
+ *
+ * - "0": ROG Chakram mice do not show up as joysticks (the default)
+ * - "1": ROG Chakram mice show up as joysticks
+ */
 #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
-  *
-  *  This variable can be set to the following values:
-  *    "0"       - A separate thread is not used (the default)
-  *    "1"       - A separate thread is used for handling raw input messages
-  *
-  */
+ * A variable controlling whether a separate thread should be used for
+ * handling joystick detection and raw input messages on Windows
+ *
+ * This variable can be set to the following values:
+ *
+ * - "0": A separate thread is not used (the default)
+ * - "1": A separate thread is used for handling raw input messages
+ */
 #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD"
 
 /**
- *  A variable containing a list of throttle style controllers.
+ * A variable containing a list of throttle style controllers.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_THROTTLE_DEVICES "SDL_JOYSTICK_THROTTLE_DEVICES"
 
 /**
- *  A variable containing a list of devices that are not throttle style controllers. This will override SDL_HINT_JOYSTICK_THROTTLE_DEVICES and the built in device list.
+ * A variable containing a list of devices that are not throttle style
+ * controllers.
+ *
+ * This will override SDL_HINT_JOYSTICK_THROTTLE_DEVICES and the built in
+ * device list.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED "SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED"
 
 /**
-  *  \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)
-  */
+ * 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"
 
 /**
- *  A variable containing a list of wheel style controllers.
+ * A variable containing a list of wheel style controllers.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_WHEEL_DEVICES "SDL_JOYSTICK_WHEEL_DEVICES"
 
 /**
- *  A variable containing a list of devices that are not wheel style controllers. This will override SDL_HINT_JOYSTICK_WHEEL_DEVICES and the built in device list.
+ * A variable containing a list of devices that are not wheel style
+ * controllers.
+ *
+ * This will override SDL_HINT_JOYSTICK_WHEEL_DEVICES and the built in device
+ * list.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED "SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED"
 
 /**
- *  A variable containing a list of devices known to have all axes centered at zero.
+ * A variable containing a list of devices known to have all axes centered at
+ * zero.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
 
 /**
- * \brief Determines whether SDL enforces that DRM master is required in order
- *        to initialize the KMSDRM video backend.
+ * Determines whether SDL enforces that DRM master is required in order to
+ * initialize the KMSDRM video backend.
  *
- * The DRM subsystem has a concept of a "DRM master" which is a DRM client that
- * has the ability to set planes, set cursor, etc. When SDL is DRM master, it
- * can draw to the screen using the SDL rendering APIs. Without DRM master, SDL
- * is still able to process input and query attributes of attached displays,
- * but it cannot change display state or draw to the screen directly.
+ * The DRM subsystem has a concept of a "DRM master" which is a DRM client
+ * that has the ability to set planes, set cursor, etc. When SDL is DRM
+ * master, it can draw to the screen using the SDL rendering APIs. Without DRM
+ * master, SDL is still able to process input and query attributes of attached
+ * displays, but it cannot change display state or draw to the screen
+ * directly.
  *
- * In some cases, it can be useful to have the KMSDRM backend even if it cannot
- * be used for rendering. An app may want to use SDL for input processing while
- * using another rendering API (such as an MMAL overlay on Raspberry Pi) or
- * using its own code to render to DRM overlays that SDL doesn't support.
+ * In some cases, it can be useful to have the KMSDRM backend even if it
+ * cannot be used for rendering. An app may want to use SDL for input
+ * processing while using another rendering API (such as an MMAL overlay on
+ * Raspberry Pi) or using its own code to render to DRM overlays that SDL
+ * doesn't support.
  *
  * This hint must be set before initializing the video subsystem.
  *
  * This variable can be set to the following values:
- *    "0"       - SDL will allow usage of the KMSDRM backend without DRM master
- *    "1"       - SDL Will require DRM master to use the KMSDRM backend (default)
+ *
+ * - "0": SDL will allow usage of the KMSDRM backend without DRM master
+ * - "1": SDL Will require DRM master to use the KMSDRM backend (default)
  */
 #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.
-  */
+ * 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
-  */
+ * 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)
-  */
+ * 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:
-  *    "0"       - Use /dev/input/event*
-  *    "1"       - Use /dev/input/js*
-  *
-  *  By default the /dev/input/event* interfaces are used
-  */
+ * 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:
+ *
+ * - "0": Use /dev/input/event*
+ * - "1": Use /dev/input/js*
+ *
+ * By default the /dev/input/event* interfaces are used
+ */
 #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:
-  *    "0"       - Return unfiltered joystick axis values (the default)
-  *    "1"       - Return axis values with deadzones taken into account
-  */
+ * 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:
+ *
+ * - "0": Return unfiltered joystick axis values (the default)
+ * - "1": Return axis values with deadzones taken into account
+ */
 #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES"
 
 /**
- *  \brief A variable controlling the default SDL log levels.
+ * A variable controlling the default SDL log levels.
  *
- *  This variable is a comma separated set of category=level tokens that define the default logging levels for SDL applications.
+ * This variable is a comma separated set of category=level tokens that define
+ * the default logging levels for SDL applications.
  *
- *  The category can be a numeric category, one of "app", "error", "assert", "system", "audio", "video", "render", "input", "test", or `*` for any unspecified category.
+ * The category can be a numeric category, one of "app", "error", "assert",
+ * "system", "audio", "video", "render", "input", "test", or `*` for any
+ * unspecified category.
  *
- *  The level can be a numeric level, one of "verbose", "debug", "info", "warn", "error", "critical", or "quiet" to disable that category.
+ * The level can be a numeric level, one of "verbose", "debug", "info",
+ * "warn", "error", "critical", or "quiet" to disable that category.
  *
- *  You can omit the category if you want to set the logging level for all categories.
+ * You can omit the category if you want to set the logging level for all
+ * categories.
  *
- *  If this hint isn't set, the default log levels are equivalent to:
- *  "app=info,assert=warn,test=verbose,*=error"
+ * If this hint isn't set, the default log levels are equivalent to:
+ * "app=info,assert=warn,test=verbose,*=error"
  */
 #define SDL_HINT_LOGGING   "SDL_LOGGING"
 
 /**
-*  \brief  When set don't force the SDL app to become a foreground process
-*
-*  This hint only applies to Mac OS X.
-*
-*/
+ * When set don't force the SDL app to become a foreground process
+ *
+ * This hint only applies to Mac OS X.
+ */
 #define SDL_HINT_MAC_BACKGROUND_APP    "SDL_MAC_BACKGROUND_APP"
 
 /**
- *  \brief A variable that determines whether ctrl+click should generate a right-click event on Mac
+ * A variable that determines whether ctrl+click should generate a right-click
+ * event on Mac
  *
- *  If present, holding ctrl while left clicking will generate a right click
- *  event when on Mac.
+ * If present, holding ctrl while left clicking will generate a right click
+ * event when on Mac.
  */
 #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
+ * 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.
+ * This variable can be set to the following values:
  *
- *  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.
+ * - "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.
  *
- *  This hint only applies to macOS.
+ * 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 is available since SDL 2.24.0.
+ * 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.
+ * A variable setting the double click radius, in pixels.
  */
 #define SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS    "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
 
 /**
- *  \brief  A variable setting the double click time, in milliseconds.
+ * A variable setting the double click time, in milliseconds.
  */
 #define SDL_HINT_MOUSE_DOUBLE_CLICK_TIME    "SDL_MOUSE_DOUBLE_CLICK_TIME"
 
 /**
- *  \brief Allow mouse click events when clicking to focus an SDL window
+ * Allow mouse click events when clicking to focus an SDL window
  *
- *  This variable can be set to the following values:
- *    "0"       - Ignore mouse clicks that activate a window
- *    "1"       - Generate events for mouse clicks that activate a window
+ * This variable can be set to the following values:
+ *
+ * - "0": Ignore mouse clicks that activate a window
+ * - "1": Generate events for mouse clicks that activate a window
  *
- *  By default SDL will ignore mouse clicks that activate a window
+ * By default SDL will ignore mouse clicks that activate a window
  */
 #define SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH "SDL_MOUSE_FOCUS_CLICKTHROUGH"
 
 /**
- *  \brief  A variable setting the speed scale for mouse motion, in floating point, when the mouse is not in relative mode
+ * A variable setting the speed scale for mouse motion, in floating point,
+ * when the mouse is not in relative mode
  */
 #define SDL_HINT_MOUSE_NORMAL_SPEED_SCALE    "SDL_MOUSE_NORMAL_SPEED_SCALE"
 
 /**
- *  \brief  A variable controlling whether relative mouse mode constrains the mouse to the center of the window
+ * A variable controlling whether relative mouse mode constrains the mouse to
+ * the center of the window
  *
- *  This variable can be set to the following values:
- *    "0"       - Relative mouse mode constrains the mouse to the window
- *    "1"       - Relative mouse mode constrains the mouse to the center of the window
+ * This variable can be set to the following values:
  *
- *  Constraining to the center of the window works better for FPS games and when the
- *  application is running over RDP. Constraining to the whole window works better
- *  for 2D games and increases the chance that the mouse will be in the correct
- *  position when using high DPI mice.
+ * - "0": Relative mouse mode constrains the mouse to the window
+ * - "1": Relative mouse mode constrains the mouse to the center of the window
  *
- *  By default SDL will constrain the mouse to the center of the window
+ * Constraining to the center of the window works better for FPS games and
+ * when the application is running over RDP. Constraining to the whole window
+ * works better for 2D games and increases the chance that the mouse will be
+ * in the correct position when using high DPI mice.
+ *
+ * By default SDL will constrain the mouse to the center of the window
  */
 #define SDL_HINT_MOUSE_RELATIVE_MODE_CENTER    "SDL_MOUSE_RELATIVE_MODE_CENTER"
 
 /**
- *  \brief  A variable controlling whether relative mouse mode is implemented using mouse warping
+ * A variable controlling whether relative mouse mode is implemented using
+ * mouse warping
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Relative mouse mode uses raw input
- *    "1"       - Relative mouse mode uses mouse warping
+ * - "0": Relative mouse mode uses raw input
+ * - "1": Relative mouse mode uses mouse warping
  *
- *  By default SDL will use raw input for relative mouse mode
+ * By default SDL will use raw input for relative mouse mode
  */
 #define SDL_HINT_MOUSE_RELATIVE_MODE_WARP    "SDL_MOUSE_RELATIVE_MODE_WARP"
 
 /**
- *  \brief  A variable controlling whether relative mouse motion is affected by renderer scaling
+ * A variable controlling whether relative mouse motion is affected by
+ * renderer scaling
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Relative motion is unaffected by DPI or renderer's logical size
- *    "1"       - Relative motion is scaled according to DPI scaling and logical size
+ * - "0": Relative motion is unaffected by DPI or renderer's logical size
+ * - "1": Relative motion is scaled according to DPI scaling and logical size
  *
- *  By default relative mouse deltas are affected by DPI and renderer scaling
+ * By default relative mouse deltas are affected by DPI and renderer scaling
  */
 #define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING"
 
 /**
- *  \brief  A variable setting the scale for mouse motion, in floating point, when the mouse is in relative mode
+ * A variable setting the scale for mouse motion, in floating point, when the
+ * mouse is in relative mode
  */
 #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.
+ * A variable controlling whether the system mouse acceleration curve is used
+ * for relative mouse motion.
+ *
+ * This variable can be set to the following values:
  *
- *  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.
+ * - "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.
+ * 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.
+ * 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
+ * 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.
+ * 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
+ * A variable controlling whether mouse events should generate synthetic touch
+ * events
  *
- *  This variable can be set to the following values:
- *    "0"       - Mouse events will not generate touch events (default for desktop platforms)
- *    "1"       - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
+ * This variable can be set to the following values:
+ *
+ * - "0": Mouse events will not generate touch events (default for desktop
+ *   platforms)
+ * - "1": Mouse events will generate touch events (default for mobile
+ *   platforms, such as Android and iOS)
  */
 #define SDL_HINT_MOUSE_TOUCH_EVENTS    "SDL_MOUSE_TOUCH_EVENTS"
 
 /**
- *  \brief  A variable controlling whether the mouse is captured while mouse buttons are pressed
+ * A variable controlling whether the mouse is captured while mouse buttons
+ * are pressed
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - The mouse is not captured while mouse buttons are pressed
- *    "1"       - The mouse is captured while mouse buttons are pressed
+ * - "0": The mouse is not captured while mouse buttons are pressed
+ * - "1": The mouse is captured while mouse buttons are pressed
  *
- *  By default the mouse is captured while mouse buttons are pressed so if the mouse is dragged
- *  outside the window, the application continues to receive mouse events until the button is
- *  released.
+ * By default the mouse is captured while mouse buttons are pressed so if the
+ * mouse is dragged outside the window, the application continues to receive
+ * mouse events until the button is released.
  */
 #define SDL_HINT_MOUSE_AUTO_CAPTURE    "SDL_MOUSE_AUTO_CAPTURE"
 
 /**
- *  \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
+ * Tell SDL not to catch the SIGINT or SIGTERM signals.
  *
- * This hint only applies to Unix-like platforms, and should set before
- * any calls to SDL_Init()
+ * This hint only applies to Unix-like platforms, and should set before any
+ * calls to SDL_Init()
  *
  * The variable can be set to the following values:
- *   "0"       - SDL will install a SIGINT and SIGTERM handler, and when it
- *               catches a signal, convert it into an SDL_QUIT event.
- *   "1"       - SDL will not install a signal handler at all.
+ *
+ * - "0": SDL will install a SIGINT and SIGTERM handler, and when it catches a
+ *   signal, convert it into an SDL_QUIT event.
+ * - "1": SDL will not install a signal handler at all.
  */
 #define SDL_HINT_NO_SIGNAL_HANDLERS   "SDL_NO_SIGNAL_HANDLERS"
 
 /**
- *  \brief  A variable controlling what driver to use for OpenGL ES contexts.
+ * A variable controlling what driver to use for OpenGL ES contexts.
  *
- *  On some platforms, currently Windows and X11, OpenGL drivers may support
- *  creating contexts with an OpenGL ES profile. By default SDL uses these
- *  profiles, when available, otherwise it attempts to load an OpenGL ES
- *  library, e.g. that provided by the ANGLE project. This variable controls
- *  whether SDL follows this default behaviour or will always load an
- *  OpenGL ES library.
+ * On some platforms, currently Windows and X11, OpenGL drivers may support
+ * creating contexts with an OpenGL ES profile. By default SDL uses these
+ * profiles, when available, otherwise it attempts to load an OpenGL ES
+ * library, e.g. that provided by the ANGLE project. This variable controls
+ * whether SDL follows this default behaviour or will always load an OpenGL ES
+ * library.
  *
- *  Circumstances where this is useful include
- *  - Testing an app with a particular OpenGL ES implementation, e.g ANGLE,
- *    or emulator, e.g. those from ARM, Imagination or Qualcomm.
- *  - Resolving OpenGL ES function addresses at link time by linking with
- *    the OpenGL ES library instead of querying them at run time with
- *    SDL_GL_GetProcAddress().
+ * Circumstances where this is useful include - Testing an app with a
+ * particular OpenGL ES implementation, e.g ANGLE, or emulator, e.g. those
+ * from ARM, Imagination or Qualcomm. - Resolving OpenGL ES function addresses
+ * at link time by linking with the OpenGL ES library instead of querying them
+ * at run time with SDL_GL_GetProcAddress().
  *
- *  Caution: for an application to work with the default behaviour across
- *  different OpenGL drivers it must query the OpenGL ES function
- *  addresses at run time using SDL_GL_GetProcAddress().
+ * Caution: for an application to work with the default behaviour across
+ * different OpenGL drivers it must query the OpenGL ES function addresses at
+ * run time using SDL_GL_GetProcAddress().
  *
- *  This variable is ignored on most platforms because OpenGL ES is native
- *  or not supported.
+ * This variable is ignored on most platforms because OpenGL ES is native or
+ * not supported.
  *
- *  This variable can be set to the following values:
- *    "0"       - Use ES profile of OpenGL, if available. (Default when not set.)
- *    "1"       - Load OpenGL ES library using the default library names.
+ * This variable can be set to the following values:
  *
+ * - "0": Use ES profile of OpenGL, if available. (Default when not set.)
+ * - "1": Load OpenGL ES library using the default library names.
  */
 #define SDL_HINT_OPENGL_ES_DRIVER   "SDL_OPENGL_ES_DRIVER"
 
 /**
- *  \brief  A variable controlling which orientations are allowed on iOS/Android.
+ * A variable controlling which orientations are allowed on iOS/Android.
  *
- *  In some circumstances it is necessary to be able to explicitly control
- *  which UI orientations are allowed.
+ * In some circumstances it is necessary to be able to explicitly control
+ * which UI orientations are allowed.
  *
- *  This variable is a space delimited list of the following values:
- *    "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
+ * This variable is a space delimited list of the following values:
+ *
+ * - "LandscapeLeft"
+ * - "LandscapeRight"
+ * - "Portrait"
+ * - "PortraitUpsideDown"
  */
 #define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS"
 
 /**
- *  \brief  A variable controlling the use of a sentinel event when polling the event queue
+ * A variable controlling the use of a sentinel event when polling the event
+ * queue
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable poll sentinels
- *    "1"       - Enable poll sentinels
+ * - "0": Disable poll sentinels
+ * - "1": Enable poll sentinels
  *
- *  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 noticeable when moving a high frequency mouse.
+ * 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 noticeable when moving a high frequency mouse.
  *
- *  By default, poll sentinels are enabled.
+ * By default, poll sentinels are enabled.
  */
 #define SDL_HINT_POLL_SENTINEL "SDL_POLL_SENTINEL"
 
 /**
- *  \brief Override for SDL_GetPreferredLocales()
+ * Override for SDL_GetPreferredLocales()
  *
- *  If set, this will be favored over anything the OS might report for the
- *  user's preferred locales. Changing this hint at runtime will not generate
- *  a SDL_LOCALECHANGED event (but if you can change the hint, you can push
- *  your own event, if you want).
+ * If set, this will be favored over anything the OS might report for the
+ * user's preferred locales. Changing this hint at runtime will not generate a
+ * SDL_LOCALECHANGED event (but if you can change the hint, you can push your
+ * own event, if you want).
  *
- *  The format of this hint is a comma-separated list of language and locale,
- *  combined with an underscore, as is a common format: "en_GB". Locale is
- *  optional: "en". So you might have a list like this: "en_GB,jp,es_PT"
+ * The format of this hint is a comma-separated list of language and locale,
+ * combined with an underscore, as is a common format: "en_GB". Locale is
+ * optional: "en". So you might have a list like this: "en_GB,jp,es_PT"
  */
 #define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES"
 
 /**
- *  \brief  A variable describing the content orientation on QtWayland-based platforms.
+ * A variable describing the content orientation on QtWayland-based platforms.
+ *
+ * On QtWayland platforms, windows are rotated client-side to allow for custom
+ * transitions. In order to correctly position overlays (e.g. volume bar) and
+ * gestures (e.g. events view, close/minimize gestures), the system needs to
+ * know in which orientation the application is currently drawing its
+ * contents.
  *
- *  On QtWayland platforms, windows are rotated client-side to allow for custom
- *  transitions. In order to correctly position overlays (e.g. volume bar) and
- *  gestures (e.g. events view, close/minimize gestures), the system needs to
- *  know in which orientation the application is currently drawing its contents.
+ * This does not cause the window to be rotated or resized, the application
+ * needs to take care of drawing the content in the right orientation (the
+ * framebuffer is always in portrait mode).
  *
- *  This does not cause the window to be rotated or resized, the application
- *  needs to take care of drawing the content in the right orientation (the
- *  framebuffer is always in portrait mode).
+ * This variable can be one of the following values:
  *
- *  This variable can be one of the following values:
- *    "primary" (default), "portrait", "landscape", "inverted-portrait", "inverted-landscape"
+ * - "primary" (default)
+ * - "portrait"
+ * - "landscape"
+ * - "inverted-portrait"
+ * - "inverted-landscape"
  *
- *  Since SDL 2.0.22 this variable accepts a comma-separated list of values above.
+ * 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"
 
 /**
- *  \brief  Flags to set on QtWayland windows to integrate with the native window manager.
+ * Flags to set on QtWayland windows to integrate with the native window
+ * manager.
+ *
+ * On QtWayland platforms, this hint controls the flags to set on the windows.
+ * For example, on Sailfish OS "OverridesSystemGestures" disables swipe
+ * gestures.
  *
- *  On QtWayland platforms, this hint controls the flags to set on the windows.
- *  For example, on Sailfish OS "OverridesSystemGestures" disables swipe gestures.
+ * This variable is a space-separated list of the following values (empty = no
+ * flags):
  *
- *  This variable is a space-separated list of the following values (empty = no flags):
- *    "OverridesSystemGestures", "StaysOnTop", "BypassWindowManager"
+ * - "OverridesSystemGestures"
+ * - "StaysOnTop"
+ * - "BypassWindowManager"
  */
 #define SDL_HINT_QTWAYLAND_WINDOW_FLAGS "SDL_QTWAYLAND_WINDOW_FLAGS"
 
 /**
- *  \brief  A variable controlling whether the 2D render API is compatible or efficient.
+ * A variable controlling whether the 2D render API is compatible or
+ * efficient.
  *
- *  This variable can be set to the following values:
- *
- *    "0"     - Don't use batching to make rendering more efficient.
- *    "1"     - Use batching, but might cause problems if app makes its own direct OpenGL calls.
+ * This variable can be set to the following values:
  *
- *  Up to SDL 2.0.9, the render API would draw immediately when requested. Now
- *  it batches up draw requests and sends them all to the GPU only when forced
- *  to (during SDL_RenderPresent, when changing render targets, by updating a
- *  texture that the batch needs, etc). This is significantly more efficient,
- *  but it can cause problems for apps that expect to render on top of the
- *  render API's output. As such, SDL will disable batching if a specific
- *  render backend is requested (since this might indicate that the app is
- *  planning to use the underlying graphics API directly). This hint can
- *  be used to explicitly request batching in this instance. It is a contract
- *  that you will either never use the underlying graphics API directly, or
- *  if you do, you will call SDL_RenderFlush() before you do so any current
- *  batch goes to the GPU before your work begins. Not following this contract
- *  will result in undefined behavior.
+ * - "0": Don't use batching to make rendering more efficient.
+ * - "1": Use batching, but might cause problems if app makes its own direct
+ *   OpenGL calls.
+ *
+ * Up to SDL 2.0.9, the render API would draw immediately when requested. Now
+ * it batches up draw requests and sends them all to the GPU only when forced
+ * to (during SDL_RenderPresent, when changing render targets, by updating a
+ * texture that the batch needs, etc). This is significantly more efficient,
+ * but it can cause problems for apps that expect to render on top of the
+ * render API's output. As such, SDL will disable batching if a specific
+ * render backend is requested (since this might indicate that the app is
+ * planning to use the underlying graphics API directly). This hint can be
+ * used to explicitly request batching in this instance. It is a contract that
+ * you will either never use the underlying graphics API directly, or if you
+ * do, you will call SDL_RenderFlush() before you do so any current batch goes
+ * to the GPU before your work begins. Not following this contract will result
+ * in undefined behavior.
  */
 #define SDL_HINT_RENDER_BATCHING  "SDL_RENDER_BATCHING"
 
 /**
- *  \brief  A variable controlling how the 2D render API renders lines
+ * A variable controlling how the 2D render API renders lines
  *
- *  This variable can be set to the following values:
- *    "0"     - Use the default line drawing method (Bresenham's line algorithm as of SDL 2.0.20)
- *    "1"     - Use the driver point API using Bresenham's line algorithm (correct, draws many points)
- *    "2"     - Use the driver line API (occasionally misses line endpoints based on hardware driver quirks, was the default before 2.0.20)
- *    "3"     - Use the driver geometry API (correct, draws thicker diagonal lines)
+ * This variable can be set to the following values:
  *
- *  This variable should be set when the renderer is created.
+ * - "0": Use the default line drawing method (Bresenham's line algorithm as
+ *   of SDL 2.0.20)
+ * - "1": Use the driver point API using Bresenham's line algorithm (correct,
+ *   draws many points)
+ * - "2": Use the driver line API (occasionally misses line endpoints based on
+ *   hardware driver quirks, was the default before 2.0.20)
+ * - "3": Use the driver geometry API (correct, draws thicker diagonal lines)
+ *
+ * This variable should be set when the renderer is created.
  */
 #define SDL_HINT_RENDER_LINE_METHOD "SDL_RENDER_LINE_METHOD"
 
 /**
- *  \brief  A variable controlling whether to enable Direct3D 11+'s Debug Layer.
+ * A variable controlling whether to enable Direct3D 11+'s Debug Layer.
+ *
+ * This variable does not have any effect on the Direct3D 9 based renderer.
  *
- *  This variable does not have any effect on the Direct3D 9 based renderer.
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable Debug Layer use
- *    "1"       - Enable Debug Layer use
+ * - "0": Disable Debug Layer use
+ * - "1": Enable Debug Layer use
  *
- *  By default, SDL does not use Direct3D Debug Layer.
+ * By default, SDL does not use Direct3D Debug Layer.
  */
 #define SDL_HINT_RENDER_DIRECT3D11_DEBUG    "SDL_RENDER_DIRECT3D11_DEBUG"
 
 /**
- *  \brief  A variable controlling whether the Direct3D device is initialized for thread-safe operations.
+ * A variable controlling whether the Direct3D device is initialized for
+ * thread-safe operations.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Thread-safety is not enabled (faster)
- *    "1"       - Thread-safety is enabled
+ * - "0": Thread-safety is not enabled (faster)
+ * - "1": Thread-safety is enabled
  *
- *  By default the Direct3D device is created with thread-safety disabled.
+ * By default the Direct3D device is created with thread-safety disabled.
  */
 #define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE"
 
 /**
- *  \brief  A variable specifying which render driver to use.
+ * A variable specifying which render driver to use.
  *
- *  If the application doesn't pick a specific renderer to use, this variable
- *  specifies the name of the preferred renderer.  If the preferred renderer
- *  can't be initialized, the normal default renderer is used.
+ * If the application doesn't pick a specific renderer to use, this variable
+ * specifies the name of the preferred renderer. If the preferred renderer
+ * can't be initialized, the normal default renderer is used.
  *
- *  This variable is case insensitive and can be set to the following values:
- *    "direct3d"
- *    "direct3d11"
- *    "direct3d12"
- *    "opengl"
- *    "opengles2"
- *    "opengles"
- *    "metal"
- *    "software"
+ * This variable is case insensitive and can be set to the following values:
  *
- *  The default varies by platform, but it's the first one in the list that
- *  is available on the current platform.
+ * - "direct3d"
+ * - "direct3d11"
+ * - "direct3d12"
+ * - "opengl"
+ * - "opengles2"
+ * - "opengles"
+ * - "metal"
+ * - "software"
+ *
+ * The default varies by platform, but it's the first one in the list that is
+ * available on the current platform.
  */
 #define SDL_HINT_RENDER_DRIVER              "SDL_RENDER_DRIVER"
 
 /**
- *  \brief  A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
+ * A variable controlling the scaling policy for SDL_RenderSetLogicalSize.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on screen
- *    "1" or "overscan"  - Will zoom the rendering so it fills the entire screen, allowing edges to be drawn offscreen
+ * "0" or "letterbox" - Uses letterbox/sidebars to fit the entire rendering on
+ * screen "1" or "overscan" - Will zoom the rendering so it fills the entire
+ * screen, allowing edges to be drawn offscreen
  *
- *  By default letterbox is used
+ * By default letterbox is used
  */
 #define SDL_HINT_RENDER_LOGICAL_SIZE_MODE       "SDL_RENDER_LOGICAL_SIZE_MODE"
 
 /**
- *  \brief  A variable controlling whether the OpenGL render driver uses shaders if they are available.
+ * A variable controlling whether the OpenGL render driver uses shaders if
+ * they are available.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable shaders
- *    "1"       - Enable shaders
+ * - "0": Disable shaders
+ * - "1": Enable shaders
  *
- *  By default shaders are used if OpenGL supports them.
+ * By default shaders are used if OpenGL supports them.
  */
 #define SDL_HINT_RENDER_OPENGL_SHADERS      "SDL_RENDER_OPENGL_SHADERS"
 
 /**
- *  \brief  A variable controlling the scaling quality
+ * A variable controlling the scaling quality
  *
- *  This variable can be set to the following values:
- *    "0" or "nearest" - Nearest pixel sampling
- *    "1" or "linear"  - Linear filtering (supported by OpenGL and Direct3D)
- *    "2" or "best"    - Currently this is the same as "linear"
+ * This variable can be set to the following values:
+ *
+ * - "0" or "nearest": Nearest pixel sampling
+ * - "1" or "linear": Linear filtering (supported by OpenGL and Direct3D)
+ * - "2" or "best": Currently this is the same as "linear"
  *
- *  By default nearest pixel sampling is used
+ * By default nearest pixel sampling is used
  */
 #define SDL_HINT_RENDER_SCALE_QUALITY       "SDL_RENDER_SCALE_QUALITY"
 
 /**
- *  \brief  A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing.
+ * A variable controlling whether updates to the SDL screen surface should be
+ * synchronized with the vertical refresh, to avoid tearing.
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable vsync
- *    "1"       - Enable vsync
+ * This variable can be set to the following values:
  *
- *  By default SDL does not sync screen surface updates with vertical refresh.
+ * - "0": Disable vsync
+ * - "1": Enable vsync
+ *
+ * By default SDL does not sync screen surface updates with vertical refresh.
  */
 #define SDL_HINT_RENDER_VSYNC               "SDL_RENDER_VSYNC"
 
 /**
- *  \brief  A variable controlling whether the Metal render driver select low power device over default one
+ * 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
+ * This variable can be set to the following values:
  *
- *  By default the prefered OS device is used.
+ * - "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"
 
 /**
- *  A variable containing a list of ROG gamepad capable mice.
+ * A variable containing a list of ROG gamepad capable mice.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_ROG_GAMEPAD_MICE "SDL_ROG_GAMEPAD_MICE"
 
 /**
- *  A variable containing a list of devices that are not ROG gamepad capable mice. This will override SDL_HINT_ROG_GAMEPAD_MICE and the built in device list.
+ * A variable containing a list of devices that are not ROG gamepad capable
+ * mice.
+ *
+ * This will override SDL_HINT_ROG_GAMEPAD_MICE and the built in device list.
  *
- *  The format of the string is a comma separated list of USB VID/PID pairs
- *  in hexadecimal form, e.g.
+ * The format of the string is a comma separated list of USB VID/PID pairs in
+ * hexadecimal form, e.g.
  *
- *      0xAAAA/0xBBBB,0xCCCC/0xDDDD
+ * 0xAAAA/0xBBBB,0xCCCC/0xDDDD
  *
- *  The variable can also take the form of @file, in which case the named
- *  file will be loaded and interpreted as the value of the variable.
+ * The variable can also take the form of @file, in which case the named file
+ * will be loaded and interpreted as the value of the variable.
  */
 #define SDL_HINT_ROG_GAMEPAD_MICE_EXCLUDED "SDL_ROG_GAMEPAD_MICE_EXCLUDED"
 
 /**
- *  \brief  A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
+ * 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
+ * This variable can be set to the following values:
  *
- *  By default SDL does not enable the automatic VSYNC
+ * - "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.
+ * A variable to control whether the return key on the soft keyboard should
+ * hide the soft keyboard on Android and iOS.
  *
  * The variable can be set to the following values:
- *   "0"       - The return key will be handled as a key event. This is the behaviour of SDL <= 2.0.3. (default)
- *   "1"       - The return key will hide the keyboard.
  *
- * The value of this hint is used at runtime, so it can be changed at any time.
+ * - "0": The return key will be handled as a key event. This is the behaviour
+ *   of SDL <= 2.0.3. (default)
+ * - "1": The return key will hide the keyboard.
+ *
+ * The value of this hint is used at runtime, so it can be changed at any
+ * time.
  */
 #define SDL_HINT_RETURN_KEY_HIDES_IME "SDL_RETURN_KEY_HIDES_IME"
 
 /**
- * \brief Tell SDL which Dispmanx layer to use on a Raspberry PI
+ * Tell SDL which Dispmanx layer to use on a Raspberry PI
  *
  * Also known as Z-order. The variable can take a negative or positive value.
  * The default is 10000.
@@ -1757,7 +2041,7 @@ extern "C" {
 #define SDL_HINT_RPI_VIDEO_LAYER           "SDL_RPI_VIDEO_LAYER"
 
 /**
- *  \brief Specify an "activity name" for screensaver inhibition.
+ * Specify an "activity name" for screensaver inhibition.
  *
  * Some platforms, notably Linux desktops, list the applications which are
  * inhibiting the screensaver or other power-saving features.
@@ -1766,7 +2050,7 @@ extern "C" {
  * SDL_DisableScreenSaver() is used (or the screensaver is automatically
  * disabled). The contents of this hint are used when the screensaver is
  * disabled. You should use a string that describes what your program is doing
- * (and, therefore, why the screensaver is disabled).  For example, "Playing a
+ * (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
@@ -1777,125 +2061,140 @@ extern "C" {
 #define SDL_HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
 
 /**
- *  \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.
+ * Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as
+ * realtime.
  *
- *  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 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.
+ * On Linux, SDL will apply the following configuration to any thread that
+ * becomes realtime:
  *
- *  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
+ * - 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
  */
 #define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
 
 /**
-*  \brief  A string specifying additional information to use with SDL_SetThreadPriority.
-*
-*  By default SDL_SetThreadPriority will make appropriate system changes in order to
-*  apply a thread priority.  For example on systems using pthreads the scheduler policy
-*  is changed automatically to a policy that works well with a given priority.
-*  Code which has specific requirements can override SDL's default behavior with this hint.
-*
-*  pthread hint values are "current", "other", "fifo" and "rr".
-*  Currently no other platform hint values are defined but may be in the future.
-*
-*  \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro
-*  configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME
-*  after calling SDL_SetThreadPriority().
-*/
+ * A string specifying additional information to use with
+ * SDL_SetThreadPriority.
+ *
+ * By default SDL_SetThreadPriority will make appropriate system changes in
+ * order to apply a thread priority. For example on systems using pthreads the
+ * scheduler policy is changed automatically to a policy that works well with
+ * a given priority. Code which has specific requirements can override SDL's
+ * default behavior with this hint.
+ *
+ * pthread hint values are "current", "other", "fifo" and "rr". Currently no
+ * other platform hint values are defined but may be in the future.
+ */
 #define SDL_HINT_THREAD_PRIORITY_POLICY         "SDL_THREAD_PRIORITY_POLICY"
 
 /**
-*  \brief  A string specifying SDL's threads stack size in bytes or "0" for the backend's default size
-*
-*  Use this hint in case you need to set SDL's threads stack size to other than the default.
-*  This is specially useful if you build SDL against a non glibc libc library (such as musl) which
-*  provides a relatively small default thread stack size (a few kilobytes versus the default 8MB glibc uses).
-*  Support for this hint is currently available only in the pthread, Windows, and PSP backend.
-*
-*  Instead of this hint, in 2.0.9 and later, you can use
-*  SDL_CreateThreadWithStackSize(). This hint only works with the classic
-*  SDL_CreateThread().
-*/
+ * A string specifying SDL's threads stack size in bytes or "0" for the
+ * backend's default size
+ *
+ * Use this hint in case you need to set SDL's threads stack size to other
+ * than the default. This is specially useful if you build SDL against a non
+ * glibc libc library (such as musl) which provides a relatively small default
+ * thread stack size (a few kilobytes versus the default 8MB glibc uses).
+ * Support for this hint is currently available only in the pthread, Windows,
+ * and PSP backend.
+ *
+ * Instead of this hint, in 2.0.9 and later, you can use
+ * SDL_CreateThreadWithStackSize(). This hint only works with the classic
+ * SDL_CreateThread().
+ */
 #define SDL_HINT_THREAD_STACK_SIZE              "SDL_THREAD_STACK_SIZE"
 
 /**
- *  \brief A variable that controls the timer resolution, in milliseconds.
+ * A variable that controls the timer resolution, in milliseconds.
  *
- *  The higher resolution the timer, the more frequently the CPU services
- *  timer interrupts, and the more precise delays are, but this takes up
- *  power and CPU time.  This hint is only used on Windows.
+ * The higher resolution the timer, the more frequently the CPU services timer
+ * interrupts, and the more precise delays are, but this takes up power and
+ * CPU time. This hint is only used on Windows.
  *
- *  See this blog post for more information:
- *  http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
+ * See this blog post for more information:
+ * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/
  *
- *  If this variable is set to "0", the system timer resolution is not set.
+ * If this variable is set to "0", the system timer resolution is not set.
  *
- *  The default value is "1". This hint may be set at any time.
+ * The default value is "1". This hint may be set at any time.
  */
 #define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION"
 
 /**
- *  \brief  A variable controlling whether touch events should generate synthetic mouse events
+ * A variable controlling whether touch events should generate synthetic mouse
+ * events
  *
- *  This variable can be set to the following values:
- *    "0"       - Touch events will not generate mouse events
- *    "1"       - Touch events will generate mouse events
+ * This variable can be set to the following values:
  *
- *  By default SDL will generate mouse events for touch events
+ * - "0": Touch events will not generate mouse events
+ * - "1": Touch events will generate mouse events
+ *
+ * By default SDL will generate mouse events for touch events
  */
 #define SDL_HINT_TOUCH_MOUSE_EVENTS    "SDL_TOUCH_MOUSE_EVENTS"
 
 /**
- *  \brief  A variable controlling which touchpad should generate synthetic mouse events
+ * A variable controlling which touchpad should generate synthetic mouse
+ * events
  *
- *  This variable can be set to the following values:
- *    "0"       - Only front touchpad should generate mouse events. Default
- *    "1"       - Only back touchpad should generate mouse events.
- *    "2"       - Both touchpads should generate mouse events.
+ * This variable can be set to the following values:
  *
- *  By default SDL will generate mouse events for all touch devices
+ * - "0": Only front touchpad should generate mouse events. Default
+ * - "1": Only back touchpad should generate mouse events.
+ * - "2": Both touchpads should generate mouse events.
+ *
+ * By default SDL will generate mouse events for all touch devices
  */
 #define SDL_HINT_VITA_TOUCH_MOUSE_DEVICE    "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
 
 /**
- *  \brief  A variable controlling whether the Android / tvOS remotes
- *  should be listed as joystick devices, instead of sending keyboard events.
+ * A variable controlling whether the Android / tvOS remotes should be listed
+ * as joystick devices, instead of sending keyboard events.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Remotes send enter/escape/arrow key events
- *    "1"       - Remotes are available as 2 axis, 2 button joysticks (the default).
+ * - "0": Remotes send enter/escape/arrow key events
+ * - "1": Remotes are available as 2 axis, 2 button joysticks (the default).
  */
 #define SDL_HINT_TV_REMOTE_AS_JOYSTICK "SDL_TV_REMOTE_AS_JOYSTICK"
 
 /**
- *  \brief  A variable controlling whether the screensaver is enabled.
+ * A variable controlling whether the screensaver is enabled.
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable screensaver
- *    "1"       - Enable screensaver
+ * This variable can be set to the following values:
+ *
+ * - "0": Disable screensaver
+ * - "1": Enable screensaver
  *
- *  By default SDL will disable the screensaver.
+ * By default SDL will disable the screensaver.
  */
 #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER    "SDL_VIDEO_ALLOW_SCREENSAVER"
 
 /**
- * \brief Tell the video driver that we only want a double buffer.
+ * Tell the video driver that we only want a double buffer.
  *
  * 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
- * factor because we save a whole frame of latency.
- * We do so by waiting for vsync immediately after issuing a flip, usually just
- * after eglSwapBuffers call in the backend's *_SwapWindow function.
+ * factor because we save a whole frame of latency. We do so by waiting for
+ * vsync immediately after issuing a flip, usually just after eglSwapBuffers
+ * call in the backend's *_SwapWindow function.
  *
  * Since it's driver-specific, it's only supported where possible and
  * implemented. Currently supported the following drivers:
@@ -1906,499 +2205,570 @@ extern "C" {
 #define SDL_HINT_VIDEO_DOUBLE_BUFFER      "SDL_VIDEO_DOUBLE_BUFFER"
 
 /**
- * \brief A variable controlling whether the EGL window is allowed to be
- * composited as transparent, rather than opaque.
+ * A variable controlling whether the EGL window is allowed to be composited
+ * as transparent, rather than opaque.
  *
  * Most window systems will always render windows opaque, even if the surface
- * format has an alpha channel. This is not always true, however, so by default
- * SDL will try to enforce opaque composition. To override this behavior, you
- * can set this hint to "1".
+ * format has an alpha channel. This is not always true, however, so by
+ * default SDL will try to enforce opaque composition. To override this
+ * behavior, you can set this hint to "1".
  */
 #define SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"
 
 /**
- * \brief A variable controlling whether the graphics context is externally managed.
+ * A variable controlling whether the graphics context is externally managed.
  *
  * This variable can be set to the following values:
- *  "0"         - SDL will manage graphics contexts that are attached to windows.
- *  "1"         - Disable graphics context management on windows.
  *
- * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the
- * context will be automatically saved and restored when pausing the application. Additionally, some
- * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
- * behavior, which is desireable when the application manages the graphics context, such as
- * an externally managed OpenGL context or attaching a Vulkan surface to the window.
+ * - "0": SDL will manage graphics contexts that are attached to windows.
+ * - "1": Disable graphics context management on windows.
+ *
+ * By default SDL will manage OpenGL contexts in certain situations. For
+ * example, on Android the context will be automatically saved and restored
+ * when pausing the application. Additionally, some platforms will assume
+ * usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
+ * behavior, which is desireable when the application manages the graphics
+ * context, such as an externally managed OpenGL context or attaching a Vulkan
+ * surface to the window.
  */
 #define SDL_HINT_VIDEO_EXTERNAL_CONTEXT    "SDL_VIDEO_EXTERNAL_CONTEXT"
 
 /**
- *  \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS)
+ * If set to 1, then do not allow high-DPI windows.
+ *
+ * ("Retina" on Mac and iOS)
  */
 #define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED"
 
 /**
- *  \brief  A variable that dictates policy for fullscreen Spaces on Mac OS X.
+ * A variable that dictates policy for fullscreen Spaces on Mac OS X.
+ *
+ * This hint only applies to Mac OS X.
  *
- *  This hint only applies to Mac OS X.
+ * The variable can be set to the following values:
  *
- *  The variable can be set to the following values:
- *    "0"       - Disable Spaces support (FULLSCREEN_DESKTOP won't use them and
- *                SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen"
- *                button on their titlebars).
- *    "1"       - Enable Spaces support (FULLSCREEN_DESKTOP will use them and
- *                SDL_WINDOW_RESIZABLE windows will offer the "fullscreen"
- *                button on their titlebars).
+ * - "0": Disable Spaces support (FULLSCREEN_DESKTOP won't use them and
+ *   SDL_WINDOW_RESIZABLE windows won't offer the "fullscreen" button on their
+ *   titlebars).
+ * - "1": Enable Spaces support (FULLSCREEN_DESKTOP will use them and
+ *   SDL_WINDOW_RESIZABLE windows will offer the "fullscreen" button on their
+ *   titlebars).
  *
- *  The default value is "1". 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"
 
 /**
- *  \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false.
- *  \warning  Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're
- *            seeing if "true" causes more problems than it solves in modern times.
+ * Minimize your SDL_Window if it loses key focus when in fullscreen mode.
  *
+ * Defaults to false.
  */
 #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS   "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
 
 /**
- *  \brief  A variable controlling whether the libdecor Wayland backend is allowed to be used.
+ * A variable controlling whether the libdecor Wayland backend is allowed to
+ * be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - libdecor use is disabled.
- *    "1"       - libdecor use is enabled (default).
+ * - "0": libdecor use is disabled.
+ * - "1": libdecor use is enabled (default).
  *
- *  libdecor is used over xdg-shell when xdg-decoration protocol is unavailable.
+ * libdecor is used over xdg-shell when xdg-decoration protocol is
+ * unavailable.
  */
 #define SDL_HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
 
 /**
- *  \brief  A variable controlling whether the libdecor Wayland backend is preferred over native decrations.
+ * A variable controlling whether the libdecor Wayland backend is preferred
+ * over native decrations.
  *
- *  When this hint is set, libdecor will be used to provide window decorations, even if xdg-decoration is
- *  available. (Note that, by default, libdecor will use xdg-decoration itself if available).
+ * When this hint is set, libdecor will be used to provide window decorations,
+ * even if xdg-decoration is available. (Note that, by default, libdecor will
+ * use xdg-decoration itself if available).
  *
- *  This variable can be set to the following values:
- *    "0"       - libdecor is enabled only if server-side decorations are unavailable.
- *    "1"       - libdecor is always enabled if available.
+ * This variable can be set to the following values:
+ *
+ * - "0": libdecor is enabled only if server-side decorations are unavailable.
+ * - "1": libdecor is always enabled if available.
  *
- *  libdecor is used over xdg-shell when xdg-decoration protocol is unavailable.
+ * libdecor is used over xdg-shell when xdg-decoration protocol is
+ * unavailable.
  */
 #define SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
 
 /**
- *  \brief  A variable controlling whether video mode emulation is enabled under Wayland.
+ * 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.
+ * 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.
+ * This variable can be set to the following values:
  *
- *  By default video mode emulation is enabled.
+ * - "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.
+ * 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.
  *
- *  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:
  *
- *  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.
+ * - "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.
+ * 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
-*  created SDL_Window:
-*
-*  1. Its pixel format will be set to the same pixel format as this SDL_Window.  This is
-*  needed for example when sharing an OpenGL context across multiple windows.
-*
-*  2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for
-*  OpenGL rendering.
-*
-*  This variable can be set to the following values:
-*    The address (as a string "%p") of the SDL_Window* that new windows created with SDL_CreateWindowFrom() should
-*    share a pixel format with.
-*/
+ * 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 created SDL_Window:
+ *
+ * 1. Its pixel format will be set to the same pixel format as this
+ * SDL_Window. This is needed for example when sharing an OpenGL context
+ * across multiple windows.
+ *
+ * 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be
+ * used for OpenGL rendering.
+ *
+ * This variable can be set to the following values: The address (as a string
+ * "%p") of the SDL_Window* that new windows created with
+ * SDL_CreateWindowFrom() should share a pixel format with.
+ */
 #define SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT    "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
 
 /**
- *  \brief  When calling SDL_CreateWindowFrom(), make the window compatible with OpenGL.
+ * When calling SDL_CreateWindowFrom(), make the window compatible with
+ * OpenGL.
  *
  * This variable can be set to the following values:
- * "0" - Don't add any graphics flags to the SDL_WindowFlags
- * "1" - Add SDL_WINDOW_OPENGL to the SDL_WindowFlags
+ *
+ * - "0": Don't add any graphics flags to the SDL_WindowFlags
+ * - "1": Add SDL_WINDOW_OPENGL to the SDL_WindowFlags
  *
  * By default SDL will not make the foreign window compatible with OpenGL.
  */
 #define SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
 
 /**
- *  \brief  When calling SDL_CreateWindowFrom(), make the window compatible with Vulkan.
+ * When calling SDL_CreateWindowFrom(), make the window compatible with
+ * Vulkan.
  *
  * This variable can be set to the following values:
- * "0" - Don't add any graphics flags to the SDL_WindowFlags
- * "1" - Add SDL_WINDOW_VULKAN to the SDL_WindowFlags
+ *
+ * - "0": Don't add any graphics flags to the SDL_WindowFlags
+ * - "1": Add SDL_WINDOW_VULKAN to the SDL_WindowFlags
  *
  * By default SDL will not make the foreign window compatible with Vulkan.
  */
 #define SDL_HINT_VIDEO_FOREIGN_WINDOW_VULKAN "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
 
 /**
-*  \brief  A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
-*
-*  SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
-*  can use two different sets of binaries, those compiled by the user from source
-*  or those provided by the Chrome browser. In the later case, these binaries require
-*  that SDL loads a DLL providing the shader compiler.
-*
-*  This variable can be set to the following values:
-*    "d3dcompiler_46.dll" - default, best for Vista or later.
-*    "d3dcompiler_43.dll" - for XP support.
-*    "none" - do not load any library, useful if you compiled ANGLE from source and included the compiler in your binaries.
-*
-*/
+ * A variable specifying which shader compiler to preload when using the
+ * Chrome ANGLE binaries
+ *
+ * SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It can
+ * use two different sets of binaries, those compiled by the user from source
+ * or those provided by the Chrome browser. In the later case, these binaries
+ * require that SDL loads a DLL providing the shader compiler.
+ *
+ * This variable can be set to the following values:
+ *
+ * - "d3dcompiler_46.dll: default, best for Vista or later.
+ * - "d3dcompiler_43.dll: for XP support.
+ * - "none": do not load any library, useful if you compiled ANGLE from source
+ *   and included the compiler in your binaries.
+ */
 #define SDL_HINT_VIDEO_WIN_D3DCOMPILER              "SDL_VIDEO_WIN_D3DCOMPILER"
 
 /**
- * \brief A variable controlling whether X11 should use GLX or EGL by default
+ * A variable controlling whether X11 should use GLX or EGL by default
  *
  * This variable can be set to the following values:
- * "0" - Use GLX
- * "1" - Use EGL
+ *
+ * - "0": Use GLX
+ * - "1": Use EGL
  *
  * By default SDL will use GLX when both are present.
  */
 #define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL"
 
 /**
- * \brief A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint should be used.
+ * 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
+ * - "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"
 
 /**
- *  \brief  A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
+ * A variable controlling whether the X11 _NET_WM_PING protocol should be
+ * supported.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable _NET_WM_PING
- *    "1"       - Enable _NET_WM_PING
+ * - "0": Disable _NET_WM_PING
+ * - "1": Enable _NET_WM_PING
  *
- *  By default SDL will use _NET_WM_PING, but for applications that know they
- *  will not always be able to respond to ping requests in a timely manner they can
- *  turn it off to avoid the window manager thinking the app is hung.
- *  The hint is checked in CreateWindow.
+ * By default SDL will use _NET_WM_PING, but for applications that know they
+ * will not always be able to respond to ping requests in a timely manner they
+ * can turn it off to avoid the window manager thinking the app is hung. The
+ * hint is checked in CreateWindow.
  */
 #define SDL_HINT_VIDEO_X11_NET_WM_PING      "SDL_VIDEO_X11_NET_WM_PING"
 
 /**
- *  \brief  A variable forcing the visual ID chosen for new X11 windows
- *
+ * A variable forcing the visual ID chosen for new X11 windows
  */
 #define SDL_HINT_VIDEO_X11_WINDOW_VISUALID      "SDL_VIDEO_X11_WINDOW_VISUALID"
 
 /**
- *  \brief  A no-longer-used variable controlling whether the X11 Xinerama extension should be used.
+ * A no-longer-used variable controlling whether the X11 Xinerama extension
+ * should be used.
  *
- * 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.
+ * 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"
 
 /**
- *  \brief  A variable controlling whether the X11 XRandR extension should be used.
+ * A variable controlling whether the X11 XRandR extension should be used.
+ *
+ * This variable can be set to the following values:
  *
- *  This variable can be set to the following values:
- *    "0"       - Disable XRandR
- *    "1"       - Enable XRandR
+ * - "0": Disable XRandR
+ * - "1": Enable XRandR
  *
- *  By default SDL will use XRandR.
+ * By default SDL will use XRandR.
  */
 #define SDL_HINT_VIDEO_X11_XRANDR           "SDL_VIDEO_X11_XRANDR"
 
 /**
- *  \brief  A no-longer-used variable controlling whether the X11 VidMode extension should be used.
+ * A no-longer-used variable controlling whether the X11 VidMode extension
+ * should be used.
  *
- * 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.
+ * 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"
 
 /**
- *  \brief  Controls how the fact chunk affects the loading of a WAVE file.
+ * Controls how the fact chunk affects the loading of a WAVE file.
  *
- *  The fact chunk stores information about the number of samples of a WAVE
- *  file. The Standards Update from Microsoft notes that this value can be used
- *  to 'determine the length of the data in seconds'. This is especially useful
- *  for compressed formats (for which this is a mandatory chunk) if they produce
- *  multiple sample frames per block and truncating the block is not allowed.
- *  The fact chunk can exactly specify how many sample frames there should be
- *  in this case.
+ * The fact chunk stores information about the number of samples of a WAVE
+ * file. The Standards Update from Microsoft notes that this value can be used
+ * to 'determine the length of the data in seconds'. This is especially useful
+ * for compressed formats (for which this is a mandatory chunk) if they
+ * produce multiple sample frames per block and truncating the block is not
+ * allowed. The fact chunk can exactly specify how many sample frames there
+ * should be in this case.
  *
- *  Unfortunately, most application seem to ignore the fact chunk and so SDL
- *  ignores it by default as well.
+ * Unfortunately, most application seem to ignore the fact chunk and so SDL
+ * ignores it by default as well.
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "truncate"    - Use the number of samples to truncate the wave data if
- *                    the fact chunk is present and valid
- *    "strict"      - Like "truncate", but raise an error if the fact chunk
- *                    is invalid, not present for non-PCM formats, or if the
- *                    data chunk doesn't have that many samples
- *    "ignorezero"  - Like "truncate", but ignore fact chunk if the number of
- *                    samples is zero
- *    "ignore"      - Ignore fact chunk entirely (default)
+ * - "truncate": Use the number of samples to truncate the wave data if the
+ *   fact chunk is present and valid
+ * - "strict": Like "truncate", but raise an error if the fact chunk is
+ *   invalid, not present for non-PCM formats, or if the data chunk doesn't
+ *   have that many samples
+ * - "ignorezero": Like "truncate", but ignore fact chunk if the number of
+ *   samples is zero
+ * - "ignore": Ignore fact chunk entirely (default)
  */
 #define SDL_HINT_WAVE_FACT_CHUNK   "SDL_WAVE_FACT_CHUNK"
 
 /**
- *  \brief  Controls how the size of the RIFF chunk affects the loading of a WAVE file.
+ * Controls how the size of the RIFF chunk affects the loading of a WAVE file.
  *
- *  The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
- *  file) is not always reliable. In case the size is wrong, it's possible to
- *  just ignore it and step through the chunks until a fixed limit is reached.
+ * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
+ * file) is not always reliable. In case the size is wrong, it's possible to
+ * just ignore it and step through the chunks until a fixed limit is reached.
  *
- *  Note that files that have trailing data unrelated to the WAVE file or
- *  corrupt files may slow down the loading process without a reliable boundary.
- *  By default, SDL stops after 10000 chunks to prevent wasting time. Use the
- *  environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
+ * Note that files that have trailing data unrelated to the WAVE file or
+ * corrupt files may slow down the loading process without a reliable
+ * boundary. By default, SDL stops after 10000 chunks to prevent wasting time.
+ * Use the environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "force"        - Always use the RIFF chunk size as a boundary for the chunk search
- *    "ignorezero"   - Like "force", but a zero size searches up to 4 GiB (default)
- *    "ignore"       - Ignore the RIFF chunk size and always search up to 4 GiB
- *    "maximum"      - Search for chunks until the end of file (not recommended)
+ * - "force": Always use the RIFF chunk size as a boundary for the chunk
+ *   search
+ * - "ignorezero": Like "force", but a zero size searches up to 4 GiB
+ *   (default)
+ * - "ignore": Ignore the RIFF chunk size and always search up to 4 GiB
+ * - "maximum": Search for chunks until the end of file (not recommended)
  */
 #define SDL_HINT_WAVE_RIFF_CHUNK_SIZE   "SDL_WAVE_RIFF_CHUNK_SIZE"
 
 /**
- *  \brief  Controls how a truncated WAVE file is handled.
+ * Controls how a truncated WAVE file is handled.
  *
- *  A WAVE file is considered truncated if any of the chunks are incomplete or
- *  the data chunk size is not a multiple of the block size. By default, SDL
- *  decodes until the first incomplete block, as most applications seem to do.
+ * A WAVE file is considered truncated if any of the chunks are incomplete or
+ * the data chunk size is not a multiple of the block size. By default, SDL
+ * decodes until the first incomplete block, as most applications seem to do.
  *
- *  This variable can be set to the following values:
+ * This variable can be set to the following values:
  *
- *    "verystrict" - Raise an error if the file is truncated
- *    "strict"     - Like "verystrict", but the size of the RIFF chunk is ignored
- *    "dropframe"  - Decode until the first incomplete sample frame
- *    "dropblock"  - Decode until the first incomplete block (default)
+ * - "verystrict": Raise an error if the file is truncated
+ * - "strict": Like "verystrict", but the size of the RIFF chunk is ignored
+ * - "dropframe": Decode until the first incomplete sample frame
+ * - "dropblock": Decode until the first incomplete block (default)
  */
 #define SDL_HINT_WAVE_TRUNCATION   "SDL_WAVE_TRUNCATION"
 
 /**
- * \brief Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
- *        The 0x406D1388 Exception is a trick used to inform Visual Studio of a
- *        thread's name, but it tends to cause problems with other debuggers,
- *        and the .NET runtime. Note that SDL 2.0.6 and later will still use
- *        the (safer) SetThreadDescription API, introduced in the Windows 10
- *        Creators Update, if available.
+ * Tell SDL not to name threads on Windows with the 0x406D1388 Exception.
+ *
+ * The 0x406D1388 Exception is a trick used to inform Visual Studio of a
+ * thread's name, but it tends to cause problems with other debuggers, and the
+ * .NET runtime. Note that SDL 2.0.6 and later will still use the (safer)
+ * SetThreadDescription API, introduced in the Windows 10 Creators Update, if
+ * available.
  *
  * The variable can be set to the following values:
- *   "0"       - SDL will raise the 0x406D1388 Exception to name threads.
- *               This is the default behavior of SDL <= 2.0.4.
- *   "1"       - SDL will not raise this exception, and threads will be unnamed. (default)
- *               This is necessary with .NET languages or debuggers that aren't Visual Studio.
+ *
+ * - "0": SDL will raise the 0x406D1388 Exception to name threads. This is the
+ *   default behavior of SDL <= 2.0.4.
+ * - "1": SDL will not raise this exception, and threads will be unnamed.
+ *   (default) This is necessary with .NET languages or debuggers that aren't
+ *   Visual Studio.
  */
 #define SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING "SDL_WINDOWS_DISABLE_THREAD_NAMING"
 
 /**
- *  \brief Controls whether menus can be opened with their keyboard shortcut (Alt+mnemonic).
+ * 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!
+ * 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.
+ * 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.
+ * 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:
  *
- *  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.
+ * - "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
+ * 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
- *    "1"       - The window message loop is processed in SDL_PumpEvents()
+ * This variable can be set to the following values:
+ *
+ * - "0": The window message loop is not run
+ * - "1": The window message loop is processed in SDL_PumpEvents()
  *
- *  By default SDL will process the windows message loop
+ * By default SDL will process the windows message loop
  */
 #define SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP "SDL_WINDOWS_ENABLE_MESSAGELOOP"
 
 /**
- * \brief Force SDL to use Critical Sections for mutexes on Windows.
- *        On Windows 7 and newer, Slim Reader/Writer Locks are available.
- *        They offer better performance, allocate no kernel ressources and
- *        use less memory. SDL will fall back to Critical Sections on older
- *        OS versions or if forced to by this hint.
+ * Force SDL to use Critical Sections for mutexes on Windows.
  *
- *  This variable can be set to the following values:
- *    "0"       - Use SRW Locks when available. If not, fall back to Critical Sections. (default)
- *    "1"       - Force the use of Critical Sections in all cases.
+ * On Windows 7 and newer, Slim Reader/Writer Locks are available. They offer
+ * better performance, allocate no kernel ressources and use less memory. SDL
+ * will fall back to Critical Sections on older OS versions or if forced to by
+ * this hint.
  *
+ * This variable can be set to the following values:
+ *
+ * - "0": Use SRW Locks when available. If not, fall back to Critical
+ *   Sections. (default)
+ * - "1": Force the use of Critical Sections in all cases.
  */
 #define SDL_HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"
 
 /**
- * \brief Force SDL to use Kernel Semaphores on Windows.
- *        Kernel Semaphores are inter-process and require a context
- *        switch on every interaction. On Windows 8 and newer, the
- *        WaitOnAddress API is available. Using that and atomics to
- *        implement semaphores increases performance.
- *        SDL will fall back to Kernel Objects on older OS versions
- *        or if forced to by this hint.
+ * Force SDL to use Kernel Semaphores on Windows.
+ *
+ * Kernel Semaphores are inter-process and require a context switch on every
+ * interaction. On Windows 8 and newer, the WaitOnAddress API is available.
+ * Using that and atomics to implement semaphores increases performance. SDL
+ * will fall back to Kernel Objects on older OS versions or if forced to by
+ * this hint.
  *
- *  This variable can be set to the following values:
- *    "0"       - Use Atomics and WaitOnAddress API when available. If not, fall back to Kernel Objects. (default)
- *    "1"       - Force the use of Kernel Objects in all cases.
+ * This variable can be set to the following values:
  *
+ * - "0": Use Atomics and WaitOnAddress API when available. If not, fall back
+ *   to Kernel Objects. (default)
+ * - "1": Force the use of Kernel Objects in all cases.
  */
 #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
+ * A variable to specify custom icon resource id from RC file on Windows
+ * platform
  */
 #define SDL_HINT_WINDOWS_INTRESOURCE_ICON       "SDL_WINDOWS_INTRESOURCE_ICON"
+
+/**
+ * A variable to specify custom icon resource id from RC file on Windows
+ * platform
+ */
 #define SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
 
 /**
- *  \brief Tell SDL not to generate window-close events for Alt+F4 on Windows.
+ * Tell SDL not to generate window-close events for Alt+F4 on Windows.
  *
  * The variable can be set to the following values:
- *   "0"       - SDL will generate a window-close event when it sees Alt+F4.
- *   "1"       - SDL will only do normal key handling for Alt+F4.
+ *
+ * - "0": SDL will generate a window-close event when it sees Alt+F4.
+ * - "1": SDL will only do normal key handling for Alt+F4.
  */
 #define SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
 
 /**
- * \brief Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9.
- *        Direct3D 9Ex contains changes to state management that can eliminate device
- *        loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may require
- *        some changes to your application to cope with the new behavior, so this
- *        is disabled by default.
+ * Use the D3D9Ex API introduced in Windows Vista, instead of normal D3D9.
  *
- *  This hint must be set before initializing the video subsystem.
+ * Direct3D 9Ex contains changes to state management that can eliminate device
+ * loss errors during scenarios like Alt+Tab or UAC prompts. D3D9Ex may
+ * require some changes to your application to cope with the new behavior, so
+ * this is disabled by default.
  *
- *  For more information on Direct3D 9Ex, see:
- *    - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex
- *    - https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements
+ * This hint must be set before initializing the video subsystem.
+ *
+ * For more information on Direct3D 9Ex, see: -
+ * https://docs.microsoft.com/en-us/windows/win32/direct3darticles/graphics-apis-in-windows-vista#direct3d-9ex
+ * -
+ * https://docs.microsoft.com/en-us/windows/win32/direct3darticles/direct3d-9ex-improvements
  *
- *  This variable can be set to the following values:
- *    "0"       - Use the original Direct3D 9 API (default)
- *    "1"       - Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex is unavailable)
+ * This variable can be set to the following values:
  *
+ * - "0": Use the original Direct3D 9 API (default)
+ * - "1": Use the Direct3D 9Ex API on Vista and later (and fall back if D3D9Ex
+ *   is unavailable)
  */
 #define SDL_HINT_WINDOWS_USE_D3D9EX "SDL_WINDOWS_USE_D3D9EX"
 
 /**
- * \brief Controls whether SDL will declare the process to be DPI aware.
+ * Controls whether SDL will declare the process to be DPI aware.
+ *
+ * This hint must be set before initializing the video subsystem.
  *
- *  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.
  *
- *  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.
  *
- *  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
  *
- *  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:
  *
- *  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.
+ * - "": 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.
+ * 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.
+ * 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.
  *
- *  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).
  *
- *  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.
  *
- *  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:
  *
- *  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.
+ * - "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
+ * 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:
  *
- *  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)
- *    "1"       - The window frame is interactive when the cursor is hidden
+ * - "0": The window frame is not interactive when the cursor is hidden (no
+ *   move, resize, etc)
+ * - "1": The window frame is interactive when the cursor is hidden
  *
- *  By default SDL will allow interaction with the window frame when the cursor is hidden
+ * By default SDL will allow interaction with the window frame when the cursor
+ * is hidden
  */
 #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
-*
-*  This variable can be set to the following values:
-*    "0"       - The window is activated when the SDL_ShowWindow function is called
-*    "1"       - The window is not activated when the SDL_ShowWindow function is called
-*
-*  By default SDL will activate the window when the SDL_ShowWindow function is called
-*/
+ * 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
+ * - "1": The window is not activated when the SDL_ShowWindow function is
+ *   called
+ *
+ * By default SDL will activate the window when the SDL_ShowWindow function is
+ * called
+ */
 #define SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN    "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"
 
-/** \brief Allows back-button-press events on Windows Phone to be marked as handled
+/** Allows back-button-press events on Windows Phone to be marked as handled
  *
  *  Windows Phone devices typically feature a Back button.  When pressed,
  *  the OS will emit back-button-press events, which apps are expected to
@@ -2446,11 +2816,12 @@ extern "C" {
  *
  *  More details on back button behavior in Windows Phone apps can be found
  *  at the following page, on Microsoft's developer site:
+ *
  *  http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx
  */
 #define SDL_HINT_WINRT_HANDLE_BACK_BUTTON "SDL_WINRT_HANDLE_BACK_BUTTON"
 
-/** \brief Label text for a WinRT app's privacy policy link
+/** Label text for a WinRT app's privacy policy link
  *
  *  Network-enabled WinRT apps must include a privacy policy.  On Windows 8, 8.1, and RT,
  *  Microsoft mandates that this policy be available via the Windows Settings charm.
@@ -2472,213 +2843,221 @@ extern "C" {
 #define SDL_HINT_WINRT_PRIVACY_POLICY_LABEL "SDL_WINRT_PRIVACY_POLICY_LABEL"
 
 /**
- *  \brief A URL to a WinRT app's privacy policy
+ * A URL to a WinRT app's privacy policy
  *
- *  All network-enabled WinRT apps must make a privacy policy available to its
- *  users.  On Windows 8, 8.1, and RT, Microsoft mandates that this policy be
- *  be available in the Windows Settings charm, as accessed from within the app.
- *  SDL provides code to add a URL-based link there, which can point to the app's
- *  privacy policy.
+ * All network-enabled WinRT apps must make a privacy policy available to its
+ * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be be
+ * available in the Windows Settings charm, as accessed from within the app.
+ * SDL provides code to add a URL-based link there, which can point to the
+ * app's privacy policy.
  *
- *  To setup a URL to an app's privacy policy, set SDL_HINT_WINRT_PRIVACY_POLICY_URL
- *  before calling any SDL_Init() functions.  The contents of the hint should
- *  be a valid URL.  For example, "http://www.example.com".
+ * To setup a URL to an app's privacy policy, set
+ * SDL_HINT_WINRT_PRIVACY_POLICY_URL before calling any SDL_Init() functions.
+ * The contents of the hint should be a valid URL. For example,
+ * "http://www.example.com".
  *
- *  The default value is "", which will prevent SDL from adding a privacy policy
- *  link to the Settings charm.  This hint should only be set during app init.
+ * The default value is "", which will prevent SDL from adding a privacy
+ * policy link to the Settings charm. This hint should only be set during app
+ * init.
  *
- *  The label text of an app's "Privacy Policy" link may be customized via another
- *  hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
+ * The label text of an app's "Privacy Policy" link may be customized via
+ * another hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
  *
- *  Please note that on Windows Phone, Microsoft does not provide standard UI
- *  for displaying a privacy policy link, and as such, SDL_HINT_WINRT_PRIVACY_POLICY_URL
- *  will not get used on that platform.  Network-enabled phone apps should display
- *  their privacy policy through some other, in-app means.
+ * Please note that on Windows Phone, Microsoft does not provide standard UI
+ * for displaying a privacy policy link, and as such,
+ * SDL_HINT_WINRT_PRIVACY_POLICY_URL will not get used on that platform.
+ * Network-enabled phone apps should display their privacy policy through some
+ * other, in-app means.
  */
 #define SDL_HINT_WINRT_PRIVACY_POLICY_URL "SDL_WINRT_PRIVACY_POLICY_URL"
 
 /**
- *  \brief Mark X11 windows as override-redirect.
+ * Mark X11 windows as override-redirect.
  *
- *  If set, this _might_ increase framerate at the expense of the desktop
- *  not working as expected. Override-redirect windows aren't noticed by the
- *  window manager at all.
+ * If set, this _might_ increase framerate at the expense of the desktop not
+ * working as expected. Override-redirect windows aren't noticed by the window
+ * manager at all.
  *
- *  You should probably only use this for fullscreen windows, and you probably
- *  shouldn't even use it for that. But it's here if you want to try!
+ * You should probably only use this for fullscreen windows, and you probably
+ * shouldn't even use it for that. But it's here if you want to try!
  */
 #define SDL_HINT_X11_FORCE_OVERRIDE_REDIRECT "SDL_X11_FORCE_OVERRIDE_REDIRECT"
 
 /**
- *  \brief  A variable that lets you disable the detection and use of Xinput gamepad devices
+ * A variable that lets you disable the detection and use of Xinput gamepad
+ * devices
  *
- *  The variable can be set to the following values:
- *    "0"       - Disable XInput detection (only uses direct input)
- *    "1"       - Enable XInput detection (the default)
+ * The variable can be set to the following values:
+ *
+ * - "0": Disable XInput detection (only uses direct input)
+ * - "1": Enable XInput detection (the default)
  */
 #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)
-  */
+/**
+ * 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.
+ * A variable that causes SDL to use the old axis and button mapping for
+ * XInput devices.
  *
- *  This hint is for backwards compatibility only and will be removed in SDL 2.1
+ * This hint is for backwards compatibility only and will be removed in SDL
+ * 2.1
  *
- *  The default value is "0".  This hint must be set before SDL_Init()
+ * The default value is "0". This hint must be set before SDL_Init()
  */
 #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
 
 /**
- *  \brief  A variable that causes SDL to not ignore audio "monitors"
+ * A variable that causes SDL to not ignore audio "monitors"
  *
- *  This is currently only used for PulseAudio and ignored elsewhere.
+ * This is currently only used for PulseAudio and ignored elsewhere.
  *
- *  By default, SDL ignores audio devices that aren't associated with physical
- *  hardware. Changing this hint to "1" will expose anything SDL sees that
- *  appears to be an audio source or sink. This will add "devices" to the list
- *  that the user probably doesn't want or need, but it can be useful in
- *  scenarios where you want to hook up SDL to some sort of virtual device,
- *  etc.
+ * By default, SDL ignores audio devices that aren't associated with physical
+ * hardware. Changing this hint to "1" will expose anything SDL sees that
+ * appears to be an audio source or sink. This will add "devices" to the list
+ * that the user probably doesn't want or need, but it can be useful in
+ * scenarios where you want to hook up SDL to some sort of virtual device,
+ * etc.
  *
- *  The default value is "0".  This hint must be set before SDL_Init().
+ * The default value is "0". This hint must be set before SDL_Init().
  *
- *  This hint is available since SDL 2.0.16. Before then, virtual devices are
- *  always ignored.
+ * This hint is available since SDL 2.0.16. Before then, virtual devices are
+ * always ignored.
  */
 #define SDL_HINT_AUDIO_INCLUDE_MONITORS "SDL_AUDIO_INCLUDE_MONITORS"
 
 /**
- *  \brief  A variable that forces X11 windows to create as a custom type.
+ * A variable that forces X11 windows to create as a custom type.
  *
- *  This is currently only used for X11 and ignored elsewhere.
+ * This is currently only used for X11 and ignored elsewhere.
  *
- *  During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property
- *  to report to the window manager the type of window it wants to create.
- *  This might be set to various things if SDL_WINDOW_TOOLTIP or
- *  SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that
- *  haven't set a specific type, this hint can be used to specify a custom
- *  type. For example, a dock window might set this to
- *  "_NET_WM_WINDOW_TYPE_DOCK".
+ * During SDL_CreateWindow, SDL uses the _NET_WM_WINDOW_TYPE X11 property to
+ * report to the window manager the type of window it wants to create. This
+ * might be set to various things if SDL_WINDOW_TOOLTIP or
+ * SDL_WINDOW_POPUP_MENU, etc, were specified. For "normal" windows that
+ * haven't set a specific type, this hint can be used to specify a custom
+ * type. For example, a dock window might set this to
+ * "_NET_WM_WINDOW_TYPE_DOCK".
  *
- *  If not set or set to "", this hint is ignored. This hint must be set
- *  before the SDL_CreateWindow() call that it is intended to affect.
+ * If not set or set to "", this hint is ignored. This hint must be set before
+ * the SDL_CreateWindow() call that it is intended to affect.
  *
- *  This hint is available since SDL 2.0.22.
+ * This hint is available since SDL 2.0.22.
  */
 #define SDL_HINT_X11_WINDOW_TYPE "SDL_X11_WINDOW_TYPE"
 
 /**
- *  \brief  A variable that decides whether to send SDL_QUIT when closing the final window.
+ * A variable that decides whether to send SDL_QUIT when closing the final
+ * window.
  *
- *  By default, SDL sends an SDL_QUIT event when there is only one window
- *  and it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most
- *  apps would also take the loss of this window as a signal to terminate the
- *  program.
+ * By default, SDL sends an SDL_QUIT event when there is only one window and
+ * it receives an SDL_WINDOWEVENT_CLOSE event, under the assumption most apps
+ * would also take the loss of this window as a signal to terminate the
+ * program.
  *
- *  However, it's not unreasonable in some cases to have the program continue
- *  to live on, perhaps to create new windows later.
+ * However, it's not unreasonable in some cases to have the program continue
+ * to live on, perhaps to create new windows later.
  *
- *  Changing this hint to "0" will cause SDL to not send an SDL_QUIT event
- *  when the final window is requesting to close. Note that in this case,
- *  there are still other legitimate reasons one might get an SDL_QUIT
- *  event: choosing "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c)
- *  on Unix, etc.
+ * Changing this hint to "0" will cause SDL to not send an SDL_QUIT event when
+ * the final window is requesting to close. Note that in this case, there are
+ * still other legitimate reasons one might get an SDL_QUIT event: choosing
+ * "Quit" from the macOS menu bar, sending a SIGINT (ctrl-c) on Unix, etc.
  *
- *  The default value is "1".  This hint can be changed at any time.
+ * The default value is "1". This hint can be changed at any time.
  *
- *  This hint is available since SDL 2.0.22. Before then, you always get
- *  an SDL_QUIT event when closing the final window.
+ * This hint is available since SDL 2.0.22. Before then, you always get an
+ * SDL_QUIT event when closing the final window.
  */
 #define SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE "SDL_QUIT_ON_LAST_WINDOW_CLOSE"
 
 
 /**
- *  \brief  A variable that decides what video backend to use.
+ * A variable that decides what video backend to use.
  *
- *  By default, SDL will try all available video backends in a reasonable
- *  order until it finds one that can work, but this hint allows the app
- *  or user to force a specific target, such as "x11" if, say, you are
- *  on Wayland but want to try talking to the X server instead.
+ * By default, SDL will try all available video backends in a reasonable order
+ * until it finds one that can work, but this hint allows the app or user to
+ * force a specific target, such as "x11" if, say, you are on Wayland but want
+ * to try talking to the X server instead.
  *
- *  This functionality has existed since SDL 2.0.0 (indeed, before that)
- *  but before 2.0.22 this was an environment variable only. In 2.0.22,
- *  it was upgraded to a full SDL hint, so you can set the environment
- *  variable as usual or programatically set the hint with SDL_SetHint,
- *  which won't propagate to child processes.
+ * This functionality has existed since SDL 2.0.0 (indeed, before that) but
+ * before 2.0.22 this was an environment variable only. In 2.0.22, it was
+ * upgraded to a full SDL hint, so you can set the environment variable as
+ * usual or programatically set the hint with SDL_SetHint, which won't
+ * propagate to child processes.
  *
- *  The default value is unset, in which case SDL will try to figure out
- *  the best video backend on your behalf. This hint needs to be set
- *  before SDL_Init() is called to be useful.
+ * The default value is unset, in which case SDL will try to figure out the
+ * best video backend on your behalf. This hint needs to be set before
+ * SDL_Init() is called to be useful.
  *
- *  This hint is available since SDL 2.0.22. Before then, you could set
- *  the environment variable to get the same effect.
+ * This hint is available since SDL 2.0.22. Before then, you could set the
+ * environment variable to get the same effect.
  */
 #define SDL_HINT_VIDEODRIVER "SDL_VIDEODRIVER"
 
 /**
- *  \brief  A variable that decides what audio backend to use.
+ * A variable that decides what audio backend to use.
  *
- *  By default, SDL will try all available audio backends in a reasonable
- *  order until it finds one that can work, but this hint allows the app
- *  or user to force a specific target, such as "alsa" if, say, you are
- *  on PulseAudio but want to try talking to the lower level instead.
+ * By default, SDL will try all available audio backends in a reasonable order
+ * until it finds one that can work, but this hint allows the app or user to
+ * force a specific target, such as "alsa" if, say, you are on PulseAudio but
+ * want to try talking to the lower level instead.
  *
- *  This functionality has existed since SDL 2.0.0 (indeed, before that)
- *  but before 2.0.22 this was an environment variable only. In 2.0.22,
- *  it was upgraded to a full SDL hint, so you can set the environment
- *  variable as usual or programatically set the hint with SDL_SetHint,
- *  which won't propagate to child processes.
+ * This functionality has existed since SDL 2.0.0 (indeed, before that) but
+ * before 2.0.22 this was an environment variable only. In 2.0.22, it was
+ * upgraded to a full SDL hint, so you can set the environment variable as
+ * usual or programatically set the hint with SDL_SetHint, which won't
+ * propagate to child processes.
  *
- *  The default value is unset, in which case SDL will try to figure out
- *  the best audio backend on your behalf. This hint needs to be set
- *  before SDL_Init() is called to be useful.
+ * The default value is unset, in which case SDL will try to figure out the
+ * best audio backend on your behalf. This hint needs to be set before
+ * SDL_Init() is called to be useful.
  *
- *  This hint is available since SDL 2.0.22. Before then, you could set
- *  the environment variable to get the same effect.
+ * This hint is available since SDL 2.0.22. Before then, you could set the
+ * environment variable to get the same effect.
  */
 #define SDL_HINT_AUDIODRIVER "SDL_AUDIODRIVER"
 
 /**
- *  \brief  A variable that decides what KMSDRM device to use.
+ * 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.
+ * 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.
+ * 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.
+ * 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.
+ * 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.
+ * 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.
+ * 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.
+ * 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 checked during SDL_Init and can not be changed after.
  *
- *  This hint is available since SDL 2.24.0.
+ * This hint is available since SDL 2.24.0.
  */
 #define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY"
 
@@ -2686,13 +3065,14 @@ extern "C" {
  * Cause SDL to call dbus_shutdown() on quit.
  *
  * This is useful as a debug tool to validate memory leaks, but shouldn't ever
- * be set in production applications, as other libraries used by the application
- * might use dbus under the hood and this cause cause crashes if they continue
- * after SDL_Quit().
+ * be set in production applications, as other libraries used by the
+ * application might use dbus under the hood and this cause cause crashes if
+ * they continue after SDL_Quit().
  *
  * This variable can be set to the following values:
- *   "0"       - SDL will not call dbus_shutdown() on quit (default)
- *   "1"       - SDL will call dbus_shutdown() on quit
+ *
+ * - "0": SDL will not call dbus_shutdown() on quit (default)
+ * - "1": SDL will call dbus_shutdown() on quit
  *
  * This hint is available since SDL 2.30.0.
  */
@@ -2700,7 +3080,7 @@ extern "C" {
 
 
 /**
- *  \brief  An enumeration of hint priorities
+ * An enumeration of hint priorities
  */
 typedef enum SDL_HintPriority
 {

+ 12 - 8
include/SDL_joystick.h

@@ -56,7 +56,7 @@ extern "C" {
  *  \file SDL_joystick.h
  *
  *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
+ *  with the SDL_INIT_JOYSTICK flag.  This causes SDL to scan the system
  *  for joysticks, and load appropriate drivers.
  *
  *  If you would like to receive joystick updates while the application
@@ -77,11 +77,13 @@ typedef struct _SDL_Joystick SDL_Joystick;
 typedef SDL_GUID SDL_JoystickGUID;
 
 /**
- * This is a unique ID for a joystick for the time it is connected to the system,
- * and is never reused for the lifetime of the application. If the joystick is
- * disconnected and reconnected, it will get a new ID.
+ * This is a unique ID for a joystick for the time it is connected to the
+ * system, and is never reused for the lifetime of the application.
  *
- * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
+ * If the joystick is disconnected and reconnected, it will get a new ID.
+ *
+ * The ID value starts at 0 and increments from there. The value -1 is an
+ * invalid ID.
  */
 typedef Sint32 SDL_JoystickID;
 
@@ -358,8 +360,10 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
 /**
  * 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.
+ * 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
  */
@@ -390,7 +394,7 @@ typedef struct SDL_VirtualJoystickDesc
 } SDL_VirtualJoystickDesc;
 
 /**
- * \brief The current version of the SDL_VirtualJoystickDesc structure
+ * The current version of the SDL_VirtualJoystickDesc structure
  */
 #define SDL_VIRTUAL_JOYSTICK_DESC_VERSION   1
 

+ 5 - 4
include/SDL_keyboard.h

@@ -40,14 +40,15 @@ extern "C" {
 #endif
 
 /**
- *  \brief The SDL keysym structure, used in key events.
+ * The SDL keysym structure, used in key events.
  *
- *  \note  If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
+ * If you are looking for translated character input, see the SDL_TEXTINPUT
+ * event.
  */
 typedef struct SDL_Keysym
 {
-    SDL_Scancode scancode;      /**< SDL physical key code - see ::SDL_Scancode for details */
-    SDL_Keycode sym;            /**< SDL virtual key code - see ::SDL_Keycode for details */
+    SDL_Scancode scancode;      /**< SDL physical key code - see SDL_Scancode for details */
+    SDL_Keycode sym;            /**< SDL virtual key code - see SDL_Keycode for details */
     Uint16 mod;                 /**< current key modifiers */
     Uint32 unused;
 } SDL_Keysym;

+ 8 - 8
include/SDL_keycode.h

@@ -32,15 +32,15 @@
 #include "SDL_scancode.h"
 
 /**
- *  \brief The SDL virtual key representation.
+ * The SDL virtual key representation.
  *
- *  Values of this type are used to represent keyboard keys using the current
- *  layout of the keyboard.  These values include Unicode values representing
- *  the unmodified character that would be generated by pressing the key, or
- *  an SDLK_* constant for those keys that do not generate characters.
+ * Values of this type are used to represent keyboard keys using the current
+ * layout of the keyboard. These values include Unicode values representing
+ * the unmodified character that would be generated by pressing the key, or 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
- *  map to SDLK_0...SDLK_9 on AZERTY layouts.
+ * A special exception is the number keys at the top of the keyboard which map
+ * to SDLK_0...SDLK_9 on AZERTY layouts.
  */
 typedef Sint32 SDL_Keycode;
 
@@ -327,7 +327,7 @@ typedef enum SDL_KeyCode
 } SDL_KeyCode;
 
 /**
- * \brief Enumeration of valid key mods (possibly OR'd together).
+ * Enumeration of valid key mods (possibly OR'd together).
  */
 typedef enum SDL_Keymod
 {

+ 7 - 8
include/SDL_log.h

@@ -47,19 +47,18 @@ extern "C" {
 
 
 /**
- *  \brief The maximum size of a log message prior to SDL 2.0.24
+ * The maximum size of a log message prior to SDL 2.0.24
  *
- *  As of 2.0.24 there is no limit to the length of SDL log messages.
+ * As of 2.0.24 there is no limit to the length of SDL log messages.
  */
 #define SDL_MAX_LOG_MESSAGE 4096
 
 /**
- *  \brief The predefined log categories
+ * The predefined log categories
  *
- *  By default the application category is enabled at the INFO level,
- *  the assert category is enabled at the WARN level, test is enabled
- *  at the VERBOSE level and all other categories are enabled at the
- *  ERROR level.
+ * By default the application category is enabled at the INFO level, the
+ * assert category is enabled at the WARN level, test is enabled at the
+ * VERBOSE level and all other categories are enabled at the ERROR level.
  */
 typedef enum SDL_LogCategory
 {
@@ -97,7 +96,7 @@ typedef enum SDL_LogCategory
 } SDL_LogCategory;
 
 /**
- *  \brief The predefined log priorities
+ * The predefined log priorities
  */
 typedef enum SDL_LogPriority
 {

+ 3 - 3
include/SDL_main.h

@@ -129,14 +129,14 @@
  *
  *  The application's main() function must be called with C linkage,
  *  and should be declared like this:
- *  \code
+ *  ```c
  *  #ifdef __cplusplus
  *  extern "C"
  *  #endif
  *  int main(int argc, char *argv[])
  *  {
  *  }
- *  \endcode
+ *  ```
  */
 
 #if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE)
@@ -149,7 +149,7 @@ extern "C" {
 #endif
 
 /**
- *  The prototype for the application's main() function
+ * The prototype for the application's main() function
  */
 typedef int (*SDL_main_func)(int argc, char *argv[]);
 extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);

+ 6 - 4
include/SDL_messagebox.h

@@ -32,7 +32,9 @@ extern "C" {
 #endif
 
 /**
- * SDL_MessageBox flags. If supported will display warning icon, etc.
+ * SDL_MessageBox flags.
+ *
+ * If supported will display warning icon, etc.
  */
 typedef enum SDL_MessageBoxFlags
 {
@@ -57,7 +59,7 @@ typedef enum SDL_MessageBoxButtonFlags
  */
 typedef struct SDL_MessageBoxButtonData
 {
-    Uint32 flags;       /**< ::SDL_MessageBoxButtonFlags */
+    Uint32 flags;       /**< SDL_MessageBoxButtonFlags */
     int buttonid;       /**< User defined button id (value returned via SDL_ShowMessageBox) */
     const char * text;  /**< The UTF-8 button text */
 } SDL_MessageBoxButtonData;
@@ -93,7 +95,7 @@ typedef struct SDL_MessageBoxColorScheme
  */
 typedef struct SDL_MessageBoxData
 {
-    Uint32 flags;                       /**< ::SDL_MessageBoxFlags */
+    Uint32 flags;                       /**< SDL_MessageBoxFlags */
     SDL_Window *window;                 /**< Parent window, can be NULL */
     const char *title;                  /**< UTF-8 title */
     const char *message;                /**< UTF-8 message text */
@@ -101,7 +103,7 @@ typedef struct SDL_MessageBoxData
     int numbuttons;
     const SDL_MessageBoxButtonData *buttons;
 
-    const SDL_MessageBoxColorScheme *colorScheme;   /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */
+    const SDL_MessageBoxColorScheme *colorScheme;   /**< SDL_MessageBoxColorScheme, can be NULL to use system settings */
 } SDL_MessageBoxData;
 
 /**

+ 2 - 2
include/SDL_metal.h

@@ -37,9 +37,9 @@ extern "C" {
 #endif
 
 /**
- *  \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
+ * A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
  *
- *  \note This can be cast directly to an NSView or UIView.
+ * This can be cast directly to an NSView or UIView.
  */
 typedef void *SDL_MetalView;
 

+ 5 - 5
include/SDL_mouse.h

@@ -41,7 +41,7 @@ extern "C" {
 typedef struct SDL_Cursor SDL_Cursor;   /**< Implementation dependent */
 
 /**
- * \brief Cursor types for SDL_CreateSystemCursor().
+ * Cursor types for SDL_CreateSystemCursor().
  */
 typedef enum SDL_SystemCursor
 {
@@ -61,7 +61,7 @@ typedef enum SDL_SystemCursor
 } SDL_SystemCursor;
 
 /**
- * \brief Scroll direction types for the Scroll event
+ * Scroll direction types for the Scroll event
  */
 typedef enum SDL_MouseWheelDirection
 {
@@ -437,9 +437,9 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
 /**
  * Used as a mask when testing buttons in buttonstate.
  *
- * - Button 1:  Left mouse button
- * - Button 2:  Middle mouse button
- * - Button 3:  Right mouse button
+ * - Button 1: Left mouse button
+ * - Button 2: Middle mouse button
+ * - Button 3: Right mouse button
  */
 #define SDL_BUTTON(X)       (1 << ((X)-1))
 #define SDL_BUTTON_LEFT     1

+ 3 - 3
include/SDL_mutex.h

@@ -112,13 +112,13 @@ extern "C" {
 #endif
 
 /**
- *  Synchronization functions which can time out return this value
- *  if they time out.
+ * Synchronization functions which can time out return this value if they time
+ * out.
  */
 #define SDL_MUTEX_TIMEDOUT  1
 
 /**
- *  This is the timeout value which corresponds to never time out.
+ * This is the timeout value which corresponds to never time out.
  */
 #define SDL_MUTEX_MAXWAIT   (~(Uint32)0)
 

+ 28 - 4
include/SDL_pixels.h

@@ -320,9 +320,10 @@ typedef enum
 } SDL_PixelFormatEnum;
 
 /**
- * The bits of this structure can be directly reinterpreted as an integer-packed
- * color which uses the SDL_PIXELFORMAT_RGBA32 format (SDL_PIXELFORMAT_ABGR8888
- * on little-endian systems and SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
+ * The bits of this structure can be directly reinterpreted as an
+ * integer-packed color which uses the SDL_PIXELFORMAT_RGBA32 format
+ * (SDL_PIXELFORMAT_ABGR8888 on little-endian systems and
+ * SDL_PIXELFORMAT_RGBA8888 on big-endian systems).
  */
 typedef struct SDL_Color
 {
@@ -342,7 +343,30 @@ typedef struct SDL_Palette
 } SDL_Palette;
 
 /**
- *  \note Everything in the pixel format structure is read-only.
+ * A structure that contains pixel format information.
+ *
+ * Everything in the pixel format structure is read-only.
+ *
+ * A pixel format has either a palette or masks. If a palette is used `Rmask`,
+ * `Gmask`, `Bmask`, and `Amask` will be 0.
+ *
+ * An SDL_PixelFormat describes the format of the pixel data stored at the
+ * `pixels` field of an SDL_Surface. Every surface stores an SDL_PixelFormat
+ * in the `format` field.
+ *
+ * If you wish to do pixel level modifications on a surface, then
+ * understanding how SDL stores its color information is essential.
+ *
+ * For information on modern pixel color spaces, see the following Wikipedia
+ * article: http://en.wikipedia.org/wiki/RGBA_color_space
+ *
+ * \sa SDL_ConvertSurface
+ * \sa SDL_GetRGB
+ * \sa SDL_GetRGBA
+ * \sa SDL_MapRGB
+ * \sa SDL_MapRGBA
+ * \sa SDL_AllocFormat
+ * \sa SDL_FreeFormat
  */
 typedef struct SDL_PixelFormat
 {

+ 1 - 1
include/SDL_power.h

@@ -37,7 +37,7 @@ extern "C" {
 #endif
 
 /**
- *  The basic state for the system's power supply.
+ * The basic state for the system's power supply.
  */
 typedef enum SDL_PowerState
 {

+ 3 - 3
include/SDL_quit.h

@@ -34,7 +34,7 @@
 /**
  *  \file SDL_quit.h
  *
- *  An ::SDL_QUIT event is generated when the user tries to close the application
+ *  An SDL_QUIT event is generated when the user tries to close the application
  *  window.  If it is ignored or filtered out, the window will remain open.
  *  If it is not ignored or filtered, it is queued normally and the window
  *  is allowed to close.  When the window is closed, screen updates will
@@ -42,8 +42,8 @@
  *
  *  SDL_Init() installs signal handlers for SIGINT (keyboard interrupt)
  *  and SIGTERM (system termination request), if handlers do not already
- *  exist, that generate ::SDL_QUIT events as well.  There is no way
- *  to determine the cause of an ::SDL_QUIT event, but setting a signal
+ *  exist, that generate SDL_QUIT events as well.  There is no way
+ *  to determine the cause of an SDL_QUIT event, but setting a signal
  *  handler in your application will override the default generation of
  *  quit events for that signal.
  *

+ 2 - 2
include/SDL_render.h

@@ -78,7 +78,7 @@ typedef enum SDL_RendererFlags
 typedef struct SDL_RendererInfo
 {
     const char *name;           /**< The name of the renderer */
-    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
+    Uint32 flags;               /**< Supported SDL_RendererFlags */
     Uint32 num_texture_formats; /**< The number of available texture formats */
     Uint32 texture_formats[16]; /**< The available texture formats */
     int max_texture_width;      /**< The maximum texture width */
@@ -86,7 +86,7 @@ typedef struct SDL_RendererInfo
 } SDL_RendererInfo;
 
 /**
- *  Vertex structure
+ * Vertex structure
  */
 typedef struct SDL_Vertex
 {

+ 5 - 5
include/SDL_rwops.h

@@ -57,7 +57,7 @@ typedef struct SDL_RWops
     Sint64 (SDLCALL * size) (struct SDL_RWops * context);
 
     /**
-     *  Seek to \c offset relative to \c whence, one of stdio's whence values:
+     *  Seek to `offset` relative to `whence`, one of stdio's whence values:
      *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
      *
      *  \return the final offset in the data stream, or -1 on error.
@@ -66,8 +66,8 @@ typedef struct SDL_RWops
                              int whence);
 
     /**
-     *  Read up to \c maxnum objects each of size \c size from the data
-     *  stream to the area pointed at by \c ptr.
+     *  Read up to `maxnum` objects each of size `size` from the data
+     *  stream to the area pointed at by `ptr`.
      *
      *  \return the number of objects read, or 0 at error or end of file.
      */
@@ -75,8 +75,8 @@ typedef struct SDL_RWops
                              size_t size, size_t maxnum);
 
     /**
-     *  Write exactly \c num objects each of size \c size from the area
-     *  pointed at by \c ptr to data stream.
+     *  Write exactly `num` objects each of size `size` from the area
+     *  pointed at by `ptr` to data stream.
      *
      *  \return the number of objects written, or 0 at error or end of file.
      */

+ 6 - 6
include/SDL_scancode.h

@@ -31,14 +31,14 @@
 #include "SDL_stdinc.h"
 
 /**
- *  \brief The SDL keyboard scancode representation.
+ * The SDL keyboard scancode representation.
  *
- *  Values of this type are used to represent keyboard keys, among other places
- *  in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
- *  SDL_Event structure.
+ * Values of this type are used to represent keyboard keys, among other places
+ * in the SDL_Keysym::scancode key.keysym.scancode field of the SDL_Event
+ * structure.
  *
- *  The values in this enumeration are based on the USB usage page standard:
- *  https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
+ * The values in this enumeration are based on the USB usage page standard:
+ * https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf
  */
 typedef enum SDL_Scancode
 {

+ 59 - 51
include/SDL_sensor.h

@@ -44,7 +44,7 @@ extern "C" {
  *  \brief SDL_sensor.h
  *
  *  In order to use these functions, SDL_Init() must have been called
- *  with the ::SDL_INIT_SENSOR flag.  This causes SDL to scan the system
+ *  with the SDL_INIT_SENSOR flag.  This causes SDL to scan the system
  *  for sensors, and load appropriate drivers.
  */
 
@@ -52,21 +52,67 @@ struct _SDL_Sensor;
 typedef struct _SDL_Sensor SDL_Sensor;
 
 /**
- * This is a unique ID for a sensor for the time it is connected to the system,
- * and is never reused for the lifetime of the application.
+ * This is a unique ID for a sensor for the time it is connected to the
+ * system, and is never reused for the lifetime of the application.
  *
- * The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
+ * The ID value starts at 0 and increments from there. The value -1 is an
+ * invalid ID.
  */
 typedef Sint32 SDL_SensorID;
 
-/* The different sensors defined by SDL
+/**
+ * The different sensors defined by SDL.
  *
  * Additional sensors may be available, using platform dependent semantics.
  *
- * Hare are the additional Android sensors:
+ * Here are the additional Android sensors:
+ *
  * https://developer.android.com/reference/android/hardware/SensorEvent.html#values
+ *
+ * Accelerometer sensor notes:
+ *
+ * The accelerometer returns the current acceleration in SI meters per second
+ * squared. This measurement includes the force of gravity, so a device at
+ * rest will have an value of SDL_STANDARD_GRAVITY away from the center of the
+ * earth, which is a positive Y value.
+ *
+ * - `values[0]`: Acceleration on the x axis
+ * - `values[1]`: Acceleration on the y axis
+ * - `values[2]`: Acceleration on the z axis
+ *
+ * For phones and tablets held in natural orientation and game controllers
+ * held in front of you, the axes are defined as follows:
+ *
+ * - -X ... +X : left ... right
+ * - -Y ... +Y : bottom ... top
+ * - -Z ... +Z : farther ... closer
+ *
+ * The accelerometer axis data is not changed when the device is rotated.
+ *
+ * Gyroscope sensor notes:
+ *
+ * The gyroscope returns the current rate of rotation in radians per second.
+ * The rotation is positive in the counter-clockwise direction. That is, an
+ * observer looking from a positive location on one of the axes would see
+ * positive rotation on that axis when it appeared to be rotating
+ * counter-clockwise.
+ *
+ * - `values[0]`: Angular speed around the x axis (pitch)
+ * - `values[1]`: Angular speed around the y axis (yaw)
+ * - `values[2]`: Angular speed around the z axis (roll)
+ *
+ * For phones and tablets held in natural orientation and game controllers
+ * held in front of you, the axes are defined as follows:
+ *
+ * - -X ... +X : left ... right
+ * - -Y ... +Y : bottom ... top
+ * - -Z ... +Z : farther ... closer
+ *
+ * The gyroscope axis data is not changed when the device is rotated.
+ *
+ * \sa SDL_GetDisplayOrientation
  */
-typedef enum
+typedef enum SDL_SensorType
 {
     SDL_SENSOR_INVALID = -1,    /**< Returned for an invalid sensor */
     SDL_SENSOR_UNKNOWN,         /**< Unknown sensor type */
@@ -79,52 +125,14 @@ typedef enum
 } SDL_SensorType;
 
 /**
- * Accelerometer sensor
- *
- * The accelerometer returns the current acceleration in SI meters per
- * second squared. This measurement includes the force of gravity, so
- * a device at rest will have an value of SDL_STANDARD_GRAVITY away
- * from the center of the earth, which is a positive Y value.
- *
- * values[0]: Acceleration on the x axis
- * values[1]: Acceleration on the y axis
- * values[2]: Acceleration on the z axis
- *
- * For phones held in portrait mode and game controllers held in front of you,
- * the axes are defined as follows:
- * -X ... +X : left ... right
- * -Y ... +Y : bottom ... top
- * -Z ... +Z : farther ... closer
- * 
- * The axis data is not changed when the phone is rotated.
- *
- * \sa SDL_GetDisplayOrientation()
- */
-#define SDL_STANDARD_GRAVITY    9.80665f
-
-/**
- * Gyroscope sensor
+ * A constant to represent standard gravity for accelerometer sensors.
  *
- * The gyroscope returns the current rate of rotation in radians per second.
- * The rotation is positive in the counter-clockwise direction. That is,
- * an observer looking from a positive location on one of the axes would
- * see positive rotation on that axis when it appeared to be rotating
- * counter-clockwise.
- *
- * values[0]: Angular speed around the x axis (pitch)
- * values[1]: Angular speed around the y axis (yaw)
- * values[2]: Angular speed around the z axis (roll)
- *
- * For phones held in portrait mode and game controllers held in front of you,
- * the axes are defined as follows:
- * -X ... +X : left ... right
- * -Y ... +Y : bottom ... top
- * -Z ... +Z : farther ... closer
- * 
- * The axis data is not changed when the phone or controller is rotated.
- *
- * \sa SDL_GetDisplayOrientation()
+ * The accelerometer returns the current acceleration in SI meters per second
+ * squared. This measurement includes the force of gravity, so a device at
+ * rest will have an value of SDL_STANDARD_GRAVITY away from the center of the
+ * earth, which is a positive Y value.
  */
+#define SDL_STANDARD_GRAVITY    9.80665f
 
 /* Function prototypes */
 

+ 9 - 9
include/SDL_shape.h

@@ -48,18 +48,18 @@ extern "C" {
  * and flags.
  *
  * \param title The title of the window, in UTF-8 encoding.
- * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *          ::SDL_WINDOWPOS_UNDEFINED.
- * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
- *          ::SDL_WINDOWPOS_UNDEFINED.
+ * \param x The x position of the window, SDL_WINDOWPOS_CENTERED, or
+ *          SDL_WINDOWPOS_UNDEFINED.
+ * \param y The y position of the window, SDL_WINDOWPOS_CENTERED, or
+ *          SDL_WINDOWPOS_UNDEFINED.
  * \param w The width of the window.
  * \param h The height of the window.
  * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with
- *              any of the following: ::SDL_WINDOW_OPENGL,
- *              ::SDL_WINDOW_INPUT_GRABBED, ::SDL_WINDOW_HIDDEN,
- *              ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED,
- *              ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_BORDERLESS is always set,
- *              and ::SDL_WINDOW_FULLSCREEN is always unset.
+ *              any of the following: SDL_WINDOW_OPENGL,
+ *              SDL_WINDOW_INPUT_GRABBED, SDL_WINDOW_HIDDEN,
+ *              SDL_WINDOW_RESIZABLE, SDL_WINDOW_MAXIMIZED,
+ *              SDL_WINDOW_MINIMIZED, SDL_WINDOW_BORDERLESS is always set, and
+ *              SDL_WINDOW_FULLSCREEN is always unset.
  * \return the window created, or NULL if window creation failed.
  *
  * \since This function is available since SDL 2.0.0.

+ 27 - 15
include/SDL_stdinc.h

@@ -129,15 +129,19 @@ void *alloca(size_t);
 #endif
 
 /**
- *  The number of elements in an array.
+ * The number of elements in an array.
  */
 #define SDL_arraysize(array)    (sizeof(array)/sizeof(array[0]))
 #define SDL_TABLESIZE(table)    SDL_arraysize(table)
 
 /**
- *  Macro useful for building other macros with strings in them
+ * Macro useful for building other macros with strings in them
  *
- *  e.g. #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
+ * e.g:
+ *
+ * ```c
+ * #define LOG_ERROR(X) OutputDebugString(SDL_STRINGIFY_ARG(__FUNCTION__) ": " X "\n")
+ * ```
  */
 #define SDL_STRINGIFY_ARG(arg)  #arg
 
@@ -185,50 +189,56 @@ typedef enum
 #endif
 
 /**
- * \brief A signed 8-bit integer type.
+ * A signed 8-bit integer type.
  */
 #define SDL_MAX_SINT8   ((Sint8)0x7F)           /* 127 */
 #define SDL_MIN_SINT8   ((Sint8)(~0x7F))        /* -128 */
 typedef int8_t Sint8;
+
 /**
- * \brief An unsigned 8-bit integer type.
+ * An unsigned 8-bit integer type.
  */
 #define SDL_MAX_UINT8   ((Uint8)0xFF)           /* 255 */
 #define SDL_MIN_UINT8   ((Uint8)0x00)           /* 0 */
 typedef uint8_t Uint8;
+
 /**
- * \brief A signed 16-bit integer type.
+ * A signed 16-bit integer type.
  */
 #define SDL_MAX_SINT16  ((Sint16)0x7FFF)        /* 32767 */
 #define SDL_MIN_SINT16  ((Sint16)(~0x7FFF))     /* -32768 */
 typedef int16_t Sint16;
+
 /**
- * \brief An unsigned 16-bit integer type.
+ * An unsigned 16-bit integer type.
  */
 #define SDL_MAX_UINT16  ((Uint16)0xFFFF)        /* 65535 */
 #define SDL_MIN_UINT16  ((Uint16)0x0000)        /* 0 */
 typedef uint16_t Uint16;
+
 /**
- * \brief A signed 32-bit integer type.
+ * A signed 32-bit integer type.
  */
 #define SDL_MAX_SINT32  ((Sint32)0x7FFFFFFF)    /* 2147483647 */
 #define SDL_MIN_SINT32  ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */
 typedef int32_t Sint32;
+
 /**
- * \brief An unsigned 32-bit integer type.
+ * An unsigned 32-bit integer type.
  */
 #define SDL_MAX_UINT32  ((Uint32)0xFFFFFFFFu)   /* 4294967295 */
 #define SDL_MIN_UINT32  ((Uint32)0x00000000)    /* 0 */
 typedef uint32_t Uint32;
 
 /**
- * \brief A signed 64-bit integer type.
+ * A signed 64-bit integer type.
  */
 #define SDL_MAX_SINT64  ((Sint64)0x7FFFFFFFFFFFFFFFll)      /* 9223372036854775807 */
 #define SDL_MIN_SINT64  ((Sint64)(~0x7FFFFFFFFFFFFFFFll))   /* -9223372036854775808 */
 typedef int64_t Sint64;
+
 /**
- * \brief An unsigned 64-bit integer type.
+ * An unsigned 64-bit integer type.
  */
 #define SDL_MAX_UINT64  ((Uint64)0xFFFFFFFFFFFFFFFFull)     /* 18446744073709551615 */
 #define SDL_MIN_UINT64  ((Uint64)(0x0000000000000000ull))   /* 0 */
@@ -775,8 +785,9 @@ SDL_FORCE_INLINE void *SDL_memcpy4(SDL_OUT_BYTECAP(dwords*4) void *dst, SDL_IN_B
 }
 
 /**
- * If a * b would overflow, return -1. Otherwise store a * b via ret
- * and return 0.
+ * If a * b would overflow, return -1.
+ *
+ * Otherwise store a * b via ret and return 0.
  *
  * \since This function is available since SDL 2.24.0.
  */
@@ -805,8 +816,9 @@ SDL_FORCE_INLINE int _SDL_size_mul_overflow_builtin (size_t a,
 #endif
 
 /**
- * If a + b would overflow, return -1. Otherwise store a + b via ret
- * and return 0.
+ * If a + b would overflow, return -1.
+ *
+ * Otherwise store a + b via ret and return 0.
  *
  * \since This function is available since SDL 2.24.0.
  */

+ 66 - 64
include/SDL_surface.h

@@ -22,7 +22,7 @@
 /**
  *  \file SDL_surface.h
  *
- *  Header file for ::SDL_Surface definition and management functions.
+ *  Header file for SDL_Surface definition and management functions.
  */
 
 #ifndef SDL_surface_h_
@@ -43,7 +43,7 @@ extern "C" {
 /**
  *  \name Surface flags
  *
- *  These are the currently supported flags for the ::SDL_Surface.
+ *  These are the currently supported flags for the SDL_Surface.
  *
  *  \internal
  *  Used internally (read-only).
@@ -57,17 +57,17 @@ extern "C" {
 /* @} *//* Surface flags */
 
 /**
- *  Evaluates to true if the surface needs to be locked before access.
+ * Evaluates to true if the surface needs to be locked before access.
  */
 #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
 
 typedef struct SDL_BlitMap SDL_BlitMap;  /* this is an opaque type. */
 
 /**
- * \brief A collection of pixels used in software blitting.
+ * A collection of pixels used in software blitting.
  *
- * \note  This structure should be treated as read-only, except for \c pixels,
- *        which, if not NULL, contains the raw pixel data for the surface.
+ * This structure should be treated as read-only, except for `pixels`, which,
+ * if not NULL, contains the raw pixel data for the surface.
  */
 typedef struct SDL_Surface
 {
@@ -103,7 +103,7 @@ typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
                                  struct SDL_Surface * dst, SDL_Rect * dstrect);
 
 /**
- * \brief The formula used for converting between YUV and RGB
+ * The formula used for converting between YUV and RGB
  */
 typedef enum SDL_YUV_CONVERSION_MODE
 {
@@ -378,9 +378,9 @@ extern DECLSPEC int SDLCALL SDL_SaveBMP_RW
     (SDL_Surface * surface, SDL_RWops * dst, int freedst);
 
 /**
- *  Save a surface to a file.
+ * Save a surface to a file.
  *
- *  Convenience macro.
+ * Convenience macro.
  */
 #define SDL_SaveBMP(surface, file) \
         SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
@@ -801,62 +801,64 @@ extern DECLSPEC int SDLCALL SDL_FillRects
     (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
 
 /* !!! FIXME: merge this documentation with the wiki */
+
 /**
- *  Performs a fast blit from the source surface to the destination surface.
- *
- *  This assumes that the source and destination rectangles are
- *  the same size.  If either \c srcrect or \c dstrect are NULL, the entire
- *  surface (\c src or \c dst) is copied.  The final blit rectangles are saved
- *  in \c srcrect and \c dstrect after all clipping is performed.
- *
- *  \returns 0 if the blit is successful, otherwise it returns -1.
- *
- *  The blit function should not be called on a locked surface.
- *
- *  The blit semantics for surfaces with and without blending and colorkey
- *  are defined as follows:
- *  \verbatim
-    RGBA->RGB:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source alpha-channel and per-surface alpha)
-        SDL_SRCCOLORKEY ignored.
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB.
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        RGB values of the source color key, ignoring alpha in the
-        comparison.
-
-    RGB->RGBA:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source per-surface alpha)
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB, set destination alpha to source per-surface alpha value.
-      both:
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        source color key.
-
-    RGBA->RGBA:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source alpha-channel and per-surface alpha)
-        SDL_SRCCOLORKEY ignored.
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy all of RGBA to the destination.
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        RGB values of the source color key, ignoring alpha in the
-        comparison.
-
-    RGB->RGB:
-      Source surface blend mode set to SDL_BLENDMODE_BLEND:
-        alpha-blend (using the source per-surface alpha)
-      Source surface blend mode set to SDL_BLENDMODE_NONE:
-        copy RGB.
-      both:
-        if SDL_SRCCOLORKEY set, only copy the pixels matching the
-        source color key.
-    \endverbatim
- *
- *  You should call SDL_BlitSurface() unless you know exactly how SDL
- *  blitting works internally and how to use the other blit functions.
+ * Performs a fast blit from the source surface to the destination surface.
+ *
+ * This assumes that the source and destination rectangles are the same size.
+ * If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
+ * `dst`) is copied. The final blit rectangles are saved in `srcrect` and
+ * `dstrect` after all clipping is performed.
+ *
+ * The blit function should not be called on a locked surface.
+ *
+ * The blit semantics for surfaces with and without blending and colorkey are
+ * defined as follows:
+ *
+ * ```
+ *   RGBA->RGB:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source alpha-channel and per-surface alpha)
+ *       SDL_SRCCOLORKEY ignored.
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy RGB.
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       RGB values of the source color key, ignoring alpha in the
+ *       comparison.
+ *
+ *   RGB->RGBA:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source per-surface alpha)
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy RGB, set destination alpha to source per-surface alpha value.
+ *     both:
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       source color key.
+ *
+ *   RGBA->RGBA:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source alpha-channel and per-surface alpha)
+ *       SDL_SRCCOLORKEY ignored.
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy all of RGBA to the destination.
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       RGB values of the source color key, ignoring alpha in the
+ *       comparison.
+ *
+ *   RGB->RGB:
+ *     Source surface blend mode set to SDL_BLENDMODE_BLEND:
+ *       alpha-blend (using the source per-surface alpha)
+ *     Source surface blend mode set to SDL_BLENDMODE_NONE:
+ *       copy RGB.
+ *     both:
+ *       if SDL_SRCCOLORKEY set, only copy the pixels matching the
+ *       source color key.
+ * ```
+ *
+ * You should call SDL_BlitSurface() unless you know exactly how SDL blitting
+ * works internally and how to use the other blit functions.
+ *
+ * \returns 0 if the blit is successful, otherwise it returns -1.
  */
 #define SDL_BlitSurface SDL_UpperBlit
 

+ 5 - 5
include/SDL_system.h

@@ -356,9 +356,9 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
 extern DECLSPEC void SDLCALL SDL_AndroidBackButton(void);
 
 /**
-   See the official Android developer guide for more information:
-   http://developer.android.com/guide/topics/data/data-storage.html
-*/
+ * See the official Android developer guide for more information:
+ * http://developer.android.com/guide/topics/data/data-storage.html
+ */
 #define SDL_ANDROID_EXTERNAL_STORAGE_READ   0x01
 #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE  0x02
 
@@ -470,7 +470,7 @@ extern DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param);
 #ifdef __WINRT__
 
 /**
- *  \brief WinRT / Windows Phone path types
+ * WinRT / Windows Phone path types
  */
 typedef enum SDL_WinRT_Path
 {
@@ -494,7 +494,7 @@ typedef enum SDL_WinRT_Path
 
 
 /**
- *  \brief WinRT Device Family
+ * WinRT Device Family
  */
 typedef enum SDL_WinRT_DeviceFamily
 {

+ 7 - 6
include/SDL_syswm.h

@@ -36,7 +36,7 @@
 /*
  *  \file SDL_syswm.h
  *
- *  Your application has access to a special type of event ::SDL_SYSWMEVENT,
+ *  Your application has access to a special type of event SDL_SYSWMEVENT,
  *  which contains window-manager specific information and arrives whenever
  *  an unhandled window event occurs.  This event is ignored by default, but
  *  you can enable it with SDL_EventState().
@@ -130,8 +130,9 @@ extern "C" {
 #endif
 
 #if !defined(SDL_PROTOTYPES_ONLY)
+
 /**
- *  These are the various supported windowing subsystems
+ * These are the various supported windowing subsystems
  */
 typedef enum SDL_SYSWM_TYPE
 {
@@ -153,7 +154,7 @@ typedef enum SDL_SYSWM_TYPE
 } SDL_SYSWM_TYPE;
 
 /**
- *  The custom event structure.
+ * The custom event structure.
  */
 struct SDL_SysWMmsg
 {
@@ -219,10 +220,10 @@ struct SDL_SysWMmsg
 };
 
 /**
- *  The custom window manager information structure.
+ * The custom window manager information structure.
  *
- *  When this structure is returned, it holds information about which
- *  low level system it is using, and will be one of SDL_SYSWM_TYPE.
+ * When this structure is returned, it holds information about which low level
+ * system it is using, and will be one of SDL_SYSWM_TYPE.
  */
 struct SDL_SysWMinfo
 {

+ 1 - 1
include/SDL_test.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test.h
  *
  *  Include file for SDL test framework.

+ 9 - 9
include/SDL_test_assert.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_assert.h
  *
  *  Include file for SDL test framework.
@@ -42,17 +42,17 @@
 extern "C" {
 #endif
 
-/**
+/*
  * \brief Fails the assert.
  */
 #define ASSERT_FAIL     0
 
-/**
+/*
  * \brief Passes the assert.
  */
 #define ASSERT_PASS     1
 
-/**
+/*
  * \brief Assert that logs and break execution flow on failures.
  *
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
@@ -60,7 +60,7 @@ extern "C" {
  */
 void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
 
-/**
+/*
  * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
  *
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
@@ -70,25 +70,25 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as
  */
 int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
 
-/**
+/*
  * \brief Explicitly pass without checking an assertion condition. Updates assertion counter.
  *
  * \param assertDescription Message to log with the assert describing it.
  */
 void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
 
-/**
+/*
  * \brief Resets the assert summary counters to zero.
  */
 void SDLTest_ResetAssertSummary(void);
 
-/**
+/*
  * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
  */
 void SDLTest_LogAssertSummary(void);
 
 
-/**
+/*
  * \brief Converts the current assert summary state to a test result.
  *
  * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT

+ 10 - 10
include/SDL_test_common.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_common.h
  *
  *  Include file for SDL test framework.
@@ -129,7 +129,7 @@ extern "C" {
 
 /* Function prototypes */
 
-/**
+/*
  * \brief Parse command line parameters and create common state.
  *
  * \param argv Array of command line parameters
@@ -139,7 +139,7 @@ extern "C" {
  */
 SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
 
-/**
+/*
  * \brief Process one common argument.
  *
  * \param state The common state describing the test window to create.
@@ -150,7 +150,7 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
 int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
 
 
-/**
+/*
  * \brief Logs command line usage info.
  *
  * This logs the appropriate command line options for the subsystems in use
@@ -164,7 +164,7 @@ int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
  */
 void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, const char **options);
 
-/**
+/*
  * \brief Returns common usage information
  *
  * You should (probably) be using SDLTest_CommonLogUsage() instead, but this
@@ -177,7 +177,7 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, cons
  */
 const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
 
-/**
+/*
  * \brief Open test window.
  *
  * \param state The common state describing the test window to create.
@@ -186,7 +186,7 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
  */
 SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
 
-/**
+/*
  * \brief Easy argument handling when test app doesn't need any custom args.
  *
  * \param state The common state describing the test window to create.
@@ -197,7 +197,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
  */
 SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
 
-/**
+/*
  * \brief Common event handler for test windows.
  *
  * \param state The common state used to create test window.
@@ -207,7 +207,7 @@ SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc,
  */
 void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done);
 
-/**
+/*
  * \brief Close test window.
  *
  * \param state The common state used to create test window.
@@ -215,7 +215,7 @@ void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *do
  */
 void SDLTest_CommonQuit(SDLTest_CommonState * state);
 
-/**
+/*
  * \brief Draws various window information (position, size, etc.) to the renderer.
  *
  * \param renderer The renderer to draw to.

+ 2 - 2
include/SDL_test_compare.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_compare.h
  *
  *  Include file for SDL test framework.
@@ -46,7 +46,7 @@
 extern "C" {
 #endif
 
-/**
+/*
  * \brief Compares a surface and with reference image data for equality
  *
  * \param surface Surface used in comparison

+ 11 - 11
include/SDL_test_font.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_font.h
  *
  *  Include file for SDL test framework.
@@ -41,7 +41,7 @@ extern "C" {
 #define FONT_CHARACTER_SIZE 8
 #define FONT_LINE_HEIGHT    (FONT_CHARACTER_SIZE + 2)
 
-/**
+/*
  *  \brief Draw a string in the currently set font.
  *
  *  \param renderer The renderer to draw on.
@@ -53,7 +53,7 @@ extern "C" {
  */
 int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c);
 
-/**
+/*
  *  \brief Draw a UTF-8 string in the currently set font.
  *
  *  The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets.
@@ -67,7 +67,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c);
  */
 int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
 
-/**
+/*
  *  \brief Data used for multi-line text output
  */
 typedef struct SDLTest_TextWindow
@@ -78,7 +78,7 @@ typedef struct SDLTest_TextWindow
     char **lines;
 } SDLTest_TextWindow;
 
-/**
+/*
  *  \brief Create a multi-line text output window
  *
  *  \param x The X coordinate of the upper left corner of the window.
@@ -92,7 +92,7 @@ typedef struct SDLTest_TextWindow
  */
 SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h);
 
-/**
+/*
  *  \brief Display a multi-line text output window
  *
  *  This function should be called every frame to display the text
@@ -104,7 +104,7 @@ SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h);
  */
 void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer);
 
-/**
+/*
  *  \brief Add text to a multi-line text output window
  *
  *  Adds UTF-8 text to the end of the current text. The newline character starts a
@@ -119,7 +119,7 @@ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *render
  */
 void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
 
-/**
+/*
  *  \brief Add text to a multi-line text output window
  *
  *  Adds UTF-8 text to the end of the current text. The newline character starts a
@@ -134,7 +134,7 @@ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_ST
  */
 void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len);
 
-/**
+/*
  *  \brief Clear the text in a multi-line text output window
  *
  *  \param textwin The text output window
@@ -143,7 +143,7 @@ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char
  */
 void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
 
-/**
+/*
  *  \brief Free the storage associated with a multi-line text output window
  *
  *  \param textwin The text output window
@@ -152,7 +152,7 @@ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
  */
 void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin);
 
-/**
+/*
  *  \brief Cleanup textures used by font drawing functions.
  */
 void SDLTest_CleanupTextDrawing(void);

+ 29 - 28
include/SDL_test_fuzzer.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_fuzzer.h
  *
  *  Include file for SDL test framework.
@@ -48,13 +48,13 @@ extern "C" {
 */
 
 
-/**
+/*
  * \file
  * Note: The fuzzer implementation uses a static instance of random context
  * internally which makes it thread-UNsafe.
  */
 
-/**
+/*
  * Initializes the fuzzer for a test
  *
  * \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
@@ -63,14 +63,14 @@ extern "C" {
 void SDLTest_FuzzerInit(Uint64 execKey);
 
 
-/**
+/*
  * Returns a random Uint8
  *
  * \returns a generated integer
  */
 Uint8 SDLTest_RandomUint8(void);
 
-/**
+/*
  * Returns a random Sint8
  *
  * \returns a generated signed integer
@@ -78,14 +78,14 @@ Uint8 SDLTest_RandomUint8(void);
 Sint8 SDLTest_RandomSint8(void);
 
 
-/**
+/*
  * Returns a random Uint16
  *
  * \returns a generated integer
  */
 Uint16 SDLTest_RandomUint16(void);
 
-/**
+/*
  * Returns a random Sint16
  *
  * \returns a generated signed integer
@@ -93,7 +93,7 @@ Uint16 SDLTest_RandomUint16(void);
 Sint16 SDLTest_RandomSint16(void);
 
 
-/**
+/*
  * Returns a random integer
  *
  * \returns a generated integer
@@ -101,14 +101,14 @@ Sint16 SDLTest_RandomSint16(void);
 Sint32 SDLTest_RandomSint32(void);
 
 
-/**
+/*
  * Returns a random positive integer
  *
  * \returns a generated integer
  */
 Uint32 SDLTest_RandomUint32(void);
 
-/**
+/*
  * Returns random Uint64.
  *
  * \returns a generated integer
@@ -116,36 +116,36 @@ Uint32 SDLTest_RandomUint32(void);
 Uint64 SDLTest_RandomUint64(void);
 
 
-/**
+/*
  * Returns random Sint64.
  *
  * \returns a generated signed integer
  */
 Sint64 SDLTest_RandomSint64(void);
 
-/**
+/*
  * \returns a random float in range [0.0 - 1.0]
  */
 float SDLTest_RandomUnitFloat(void);
 
-/**
+/*
  * \returns a random double in range [0.0 - 1.0]
  */
 double SDLTest_RandomUnitDouble(void);
 
-/**
+/*
  * \returns a random float.
  *
  */
 float SDLTest_RandomFloat(void);
 
-/**
+/*
  * \returns a random double.
  *
  */
 double SDLTest_RandomDouble(void);
 
-/**
+/*
  * Returns a random boundary value for Uint8 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -166,7 +166,7 @@ double SDLTest_RandomDouble(void);
  */
 Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
 
-/**
+/*
  * Returns a random boundary value for Uint16 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -187,7 +187,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
  */
 Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
 
-/**
+/*
  * Returns a random boundary value for Uint32 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -208,7 +208,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL
  */
 Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
 
-/**
+/*
  * Returns a random boundary value for Uint64 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -229,7 +229,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL
  */
 Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
 
-/**
+/*
  * Returns a random boundary value for Sint8 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -251,7 +251,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL
 Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns a random boundary value for Sint16 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -272,7 +272,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
  */
 Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
 
-/**
+/*
  * Returns a random boundary value for Sint32 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -293,7 +293,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL
  */
 Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
 
-/**
+/*
  * Returns a random boundary value for Sint64 within the given boundaries.
  * Boundaries are inclusive, see the usage examples below. If validDomain
  * is true, the function will only return valid boundaries, otherwise non-valid
@@ -315,7 +315,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL
 Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
 
 
-/**
+/*
  * Returns integer in range [min, max] (inclusive).
  * Min and max values can be negative values.
  * If Max in smaller than min, then the values are swapped.
@@ -329,7 +329,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
 Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
 
 
-/**
+/*
  * Generates random null-terminated string. The minimum length for
  * the string is 1 character, maximum length for the string is 255
  * characters and it can contain ASCII characters from 32 to 126.
@@ -341,7 +341,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
 char * SDLTest_RandomAsciiString(void);
 
 
-/**
+/*
  * Generates random null-terminated string. The maximum length for
  * the string is defined by the maxLength parameter.
  * String can contain ASCII characters from 32 to 126.
@@ -355,7 +355,7 @@ char * SDLTest_RandomAsciiString(void);
 char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
 
 
-/**
+/*
  * Generates random null-terminated string. The length for
  * the string is defined by the size parameter.
  * String can contain ASCII characters from 32 to 126.
@@ -368,7 +368,8 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
  */
 char * SDLTest_RandomAsciiStringOfSize(int size);
 
-/**
+
+/*
  * Get the invocation count for the fuzzer since last ...FuzzerInit.
  *
  * \returns the invocation count.

+ 5 - 5
include/SDL_test_harness.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_harness.h
  *
  *  Include file for SDL test framework.
@@ -69,7 +69,7 @@ typedef int (*SDLTest_TestCaseFp)(void *arg);
 /* !< Function pointer to a test case teardown function (run after every test) */
 typedef void  (*SDLTest_TestCaseTearDownFp)(void *arg);
 
-/**
+/*
  * Holds information about a single test case.
  */
 typedef struct SDLTest_TestCaseReference {
@@ -83,7 +83,7 @@ typedef struct SDLTest_TestCaseReference {
     int enabled;
 } SDLTest_TestCaseReference;
 
-/**
+/*
  * Holds information about a test suite (multiple test cases).
  */
 typedef struct SDLTest_TestSuiteReference {
@@ -98,7 +98,7 @@ typedef struct SDLTest_TestSuiteReference {
 } SDLTest_TestSuiteReference;
 
 
-/**
+/*
  * \brief Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
  *
  * Note: The returned string needs to be deallocated by the caller.
@@ -109,7 +109,7 @@ typedef struct SDLTest_TestSuiteReference {
  */
 char *SDLTest_GenerateRunSeed(const int length);
 
-/**
+/*
  * \brief Execute a test suite using the given run seed and execution key.
  *
  * \param testSuites Suites containing the test case.

+ 2 - 2
include/SDL_test_images.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_images.h
  *
  *  Include file for SDL test framework.
@@ -44,7 +44,7 @@
 extern "C" {
 #endif
 
-/**
+/*
  *Type for test images.
  */
 typedef struct SDLTest_SurfaceImage_s {

+ 3 - 3
include/SDL_test_log.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_log.h
  *
  *  Include file for SDL test framework.
@@ -42,14 +42,14 @@
 extern "C" {
 #endif
 
-/**
+/*
  * \brief Prints given message with a timestamp in the TEST category and INFO priority.
  *
  * \param fmt Message to be logged
  */
 void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
 
-/**
+/*
  * \brief Prints given message with a timestamp in the TEST category and the ERROR priority.
  *
  * \param fmt Message to be logged

+ 4 - 4
include/SDL_test_md5.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_md5.h
  *
  *  Include file for SDL test framework.
@@ -77,7 +77,7 @@ extern "C" {
 
 /* ---------- Function Prototypes ------------- */
 
-/**
+/*
  * \brief initialize the context
  *
  * \param  mdContext        pointer to context variable
@@ -89,7 +89,7 @@ extern "C" {
  void SDLTest_Md5Init(SDLTest_Md5Context * mdContext);
 
 
-/**
+/*
  * \brief update digest from variable length data
  *
  * \param  mdContext       pointer to context variable
@@ -105,7 +105,7 @@ extern "C" {
                  unsigned int inLen);
 
 
-/**
+/*
  * \brief complete digest computation
  *
  * \param mdContext     pointer to context variable

+ 3 - 3
include/SDL_test_memory.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_memory.h
  *
  *  Include file for SDL test framework.
@@ -37,14 +37,14 @@ extern "C" {
 #endif
 
 
-/**
+/*
  * \brief Start tracking SDL memory allocations
  * 
  * \note This should be called before any other SDL functions for complete tracking coverage
  */
 int SDLTest_TrackAllocations(void);
 
-/**
+/*
  * \brief Print a log of any outstanding allocations
  *
  * \note This can be called after SDL_Quit()

+ 4 - 4
include/SDL_test_random.h

@@ -19,7 +19,7 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
-/**
+/*
  *  \file SDL_test_random.h
  *
  *  Include file for SDL test framework.
@@ -67,7 +67,7 @@ extern "C" {
 
 /* --- Function prototypes */
 
-/**
+/*
  *  \brief Initialize random number generator with two integers.
  *
  *  Note: The random sequence of numbers returned by ...Random() is the
@@ -81,7 +81,7 @@ extern "C" {
  void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi,
                   unsigned int ci);
 
-/**
+/*
  *  \brief Initialize random number generator based on current system time.
  *
  *  \param rndContext     pointer to context structure
@@ -90,7 +90,7 @@ extern "C" {
  void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext);
 
 
-/**
+/*
  *  \brief Initialize random number generator based on current system time.
  *
  *  Note: ...RandomInit() or ...RandomInitTime() must have been called

+ 8 - 6
include/SDL_thread.h

@@ -63,14 +63,16 @@ typedef unsigned long SDL_threadID;
 typedef unsigned int SDL_TLSID;
 
 /**
- *  The SDL thread priority.
+ * The SDL thread priority.
  *
- *  SDL will make system changes as necessary in order to apply the thread priority.
- *  Code which attempts to control thread state related to priority should be aware
- *  that calling SDL_SetThreadPriority may alter such state.
- *  SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this behavior.
+ * SDL will make system changes as necessary in order to apply the thread
+ * priority. Code which attempts to control thread state related to priority
+ * should be aware that calling SDL_SetThreadPriority may alter such state.
+ * SDL_HINT_THREAD_PRIORITY_POLICY can be used to control aspects of this
+ * behavior.
  *
- *  \note On many systems you require special privileges to set high or time critical priority.
+ * On many systems you require special privileges to set high or time critical
+ * priority.
  */
 typedef enum SDL_ThreadPriority {
     SDL_THREAD_PRIORITY_LOW,

+ 9 - 9
include/SDL_timer.h

@@ -89,8 +89,8 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
  * days, but should _not_ be used with SDL_GetTicks64(), which does not have
  * that problem.
  *
- * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could
- * do this:
+ * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could do
+ * this:
  *
  * ```c
  * const Uint32 timeout = SDL_GetTicks() + 100;
@@ -99,9 +99,9 @@ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
  * }
  * ```
  *
- * Note that this does not handle tick differences greater
- * than 2^31 so take care when using the above kind of code
- * with large timeout delays (tens of days).
+ * Note that this does not handle tick differences greater than 2^31 so take
+ * care when using the above kind of code with large timeout delays (tens of
+ * days).
  */
 #define SDL_TICKS_PASSED(A, B)  ((Sint32)((B) - (A)) <= 0)
 
@@ -149,10 +149,10 @@ extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
 /**
  * Function prototype for the timer callback function.
  *
- * The callback function is passed the current timer interval and returns
- * the next timer interval. If the returned value is the same as the one
- * passed in, the periodic alarm continues, otherwise a new alarm is
- * scheduled. If the callback returns 0, the periodic alarm is cancelled.
+ * The callback function is passed the current timer interval and returns the
+ * next timer interval. If the returned value is the same as the one passed
+ * in, the periodic alarm continues, otherwise a new alarm is scheduled. If
+ * the callback returns 0, the periodic alarm is cancelled.
  */
 typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 

+ 26 - 25
include/SDL_version.h

@@ -40,10 +40,9 @@ extern "C" {
  * Information about the version of SDL in use.
  *
  * Represents the library's version as three levels: major revision
- * (increments with massive changes, additions, and enhancements),
- * minor revision (increments with backwards-compatible changes to the
- * major revision), and patchlevel (increments with fixes to the minor
- * revision).
+ * (increments with massive changes, additions, and enhancements), minor
+ * revision (increments with backwards-compatible changes to the major
+ * revision), and patchlevel (increments with fixes to the minor revision).
  *
  * \sa SDL_VERSION
  * \sa SDL_GetVersion
@@ -64,12 +63,11 @@ typedef struct SDL_version
 /**
  * Macro to determine SDL version program was compiled against.
  *
- * This macro fills in a SDL_version structure with the version of the
- * library you compiled against. This is determined by what header the
- * compiler uses. Note that if you dynamically linked the library, you might
- * have a slightly newer or older version at runtime. That version can be
- * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
- * is not a macro.
+ * This macro fills in a SDL_version structure with the version of the library
+ * you compiled against. This is determined by what header the compiler uses.
+ * Note that if you dynamically linked the library, you might have a slightly
+ * newer or older version at runtime. That version can be determined with
+ * SDL_GetVersion(), which, unlike SDL_VERSION(), is not a macro.
  *
  * \param x A pointer to a SDL_version struct to initialize.
  *
@@ -85,37 +83,40 @@ typedef struct SDL_version
 
 /* TODO: Remove this whole block in SDL 3 */
 #if SDL_MAJOR_VERSION < 3
+
 /**
- *  This macro turns the version numbers into a numeric value:
- *  \verbatim
-    (1,2,3) -> (1203)
-    \endverbatim
+ * This macro turns the version numbers into a numeric value:
+ *
+ * ```
+ * (1,2,3) -> (1203)
+ * ```
+ *
+ * This assumes that there will never be more than 100 patchlevels.
  *
- *  This assumes that there will never be more than 100 patchlevels.
+ * In versions higher than 2.9.0, the minor version overflows into the
+ * thousands digit: for example, 2.23.0 is encoded as 4300, and 2.255.99 would
+ * be encoded as 25799.
  *
- *  In versions higher than 2.9.0, the minor version overflows into
- *  the thousands digit: for example, 2.23.0 is encoded as 4300,
- *  and 2.255.99 would be encoded as 25799.
- *  This macro will not be available in SDL 3.x.
+ * This macro will not be available in SDL 3.x.
  */
 #define SDL_VERSIONNUM(X, Y, Z)                     \
     ((X)*1000 + (Y)*100 + (Z))
 
 /**
- *  This is the version number macro for the current SDL version.
+ * This is the version number macro for the current SDL version.
  *
- *  In versions higher than 2.9.0, the minor version overflows into
- *  the thousands digit: for example, 2.23.0 is encoded as 4300.
- *  This macro will not be available in SDL 3.x.
+ * In versions higher than 2.9.0, the minor version overflows into the
+ * thousands digit: for example, 2.23.0 is encoded as 4300. This macro will
+ * not be available in SDL 3.x.
  *
- *  Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
+ * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
  */
 #define SDL_COMPILEDVERSION \
     SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
 #endif /* SDL_MAJOR_VERSION < 3 */
 
 /**
- *  This macro will evaluate to true if compiled with SDL at least X.Y.Z.
+ * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
  */
 #define SDL_VERSION_ATLEAST(X, Y, Z) \
     ((SDL_MAJOR_VERSION >= X) && \

+ 49 - 49
include/SDL_video.h

@@ -40,15 +40,15 @@ extern "C" {
 #endif
 
 /**
- *  \brief  The structure that defines a display mode
+ * The structure that defines a display mode
  *
- *  \sa SDL_GetNumDisplayModes()
- *  \sa SDL_GetDisplayMode()
- *  \sa SDL_GetDesktopDisplayMode()
- *  \sa SDL_GetCurrentDisplayMode()
- *  \sa SDL_GetClosestDisplayMode()
- *  \sa SDL_SetWindowDisplayMode()
- *  \sa SDL_GetWindowDisplayMode()
+ * \sa SDL_GetNumDisplayModes
+ * \sa SDL_GetDisplayMode
+ * \sa SDL_GetDesktopDisplayMode
+ * \sa SDL_GetCurrentDisplayMode
+ * \sa SDL_GetClosestDisplayMode
+ * \sa SDL_SetWindowDisplayMode
+ * \sa SDL_GetWindowDisplayMode
  */
 typedef struct SDL_DisplayMode
 {
@@ -60,44 +60,44 @@ typedef struct SDL_DisplayMode
 } SDL_DisplayMode;
 
 /**
- *  \brief The type used to identify a window
- *
- *  \sa SDL_CreateWindow()
- *  \sa SDL_CreateWindowFrom()
- *  \sa SDL_DestroyWindow()
- *  \sa SDL_FlashWindow()
- *  \sa SDL_GetWindowData()
- *  \sa SDL_GetWindowFlags()
- *  \sa SDL_GetWindowGrab()
- *  \sa SDL_GetWindowKeyboardGrab()
- *  \sa SDL_GetWindowMouseGrab()
- *  \sa SDL_GetWindowPosition()
- *  \sa SDL_GetWindowSize()
- *  \sa SDL_GetWindowTitle()
- *  \sa SDL_HideWindow()
- *  \sa SDL_MaximizeWindow()
- *  \sa SDL_MinimizeWindow()
- *  \sa SDL_RaiseWindow()
- *  \sa SDL_RestoreWindow()
- *  \sa SDL_SetWindowData()
- *  \sa SDL_SetWindowFullscreen()
- *  \sa SDL_SetWindowGrab()
- *  \sa SDL_SetWindowKeyboardGrab()
- *  \sa SDL_SetWindowMouseGrab()
- *  \sa SDL_SetWindowIcon()
- *  \sa SDL_SetWindowPosition()
- *  \sa SDL_SetWindowSize()
- *  \sa SDL_SetWindowBordered()
- *  \sa SDL_SetWindowResizable()
- *  \sa SDL_SetWindowTitle()
- *  \sa SDL_ShowWindow()
+ * The type used to identify a window
+ *
+ * \sa SDL_CreateWindow
+ * \sa SDL_CreateWindowFrom
+ * \sa SDL_DestroyWindow
+ * \sa SDL_FlashWindow
+ * \sa SDL_GetWindowData
+ * \sa SDL_GetWindowFlags
+ * \sa SDL_GetWindowGrab
+ * \sa SDL_GetWindowKeyboardGrab
+ * \sa SDL_GetWindowMouseGrab
+ * \sa SDL_GetWindowPosition
+ * \sa SDL_GetWindowSize
+ * \sa SDL_GetWindowTitle
+ * \sa SDL_HideWindow
+ * \sa SDL_MaximizeWindow
+ * \sa SDL_MinimizeWindow
+ * \sa SDL_RaiseWindow
+ * \sa SDL_RestoreWindow
+ * \sa SDL_SetWindowData
+ * \sa SDL_SetWindowFullscreen
+ * \sa SDL_SetWindowGrab
+ * \sa SDL_SetWindowKeyboardGrab
+ * \sa SDL_SetWindowMouseGrab
+ * \sa SDL_SetWindowIcon
+ * \sa SDL_SetWindowPosition
+ * \sa SDL_SetWindowSize
+ * \sa SDL_SetWindowBordered
+ * \sa SDL_SetWindowResizable
+ * \sa SDL_SetWindowTitle
+ * \sa SDL_ShowWindow
  */
 typedef struct SDL_Window SDL_Window;
 
 /**
- *  \brief The flags on a window
+ * The flags on a window
  *
- *  \sa SDL_GetWindowFlags()
+ * \sa SDL_GetWindowFlags
  */
 typedef enum SDL_WindowFlags
 {
@@ -131,7 +131,7 @@ typedef enum SDL_WindowFlags
 } SDL_WindowFlags;
 
 /**
- *  \brief Used to indicate that you don't care what the window position is.
+ * Used to indicate that you don't care what the window position is.
  */
 #define SDL_WINDOWPOS_UNDEFINED_MASK    0x1FFF0000u
 #define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)  (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
@@ -140,7 +140,7 @@ typedef enum SDL_WindowFlags
             (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
 
 /**
- *  \brief Used to indicate that the window position should be centered.
+ * Used to indicate that the window position should be centered.
  */
 #define SDL_WINDOWPOS_CENTERED_MASK    0x2FFF0000u
 #define SDL_WINDOWPOS_CENTERED_DISPLAY(X)  (SDL_WINDOWPOS_CENTERED_MASK|(X))
@@ -149,7 +149,7 @@ typedef enum SDL_WindowFlags
             (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
 
 /**
- *  \brief Event subtype for window events
+ * Event subtype for window events
  */
 typedef enum SDL_WindowEventID
 {
@@ -180,7 +180,7 @@ typedef enum SDL_WindowEventID
 } SDL_WindowEventID;
 
 /**
- *  \brief Event subtype for display events
+ * Event subtype for display events
  */
 typedef enum SDL_DisplayEventID
 {
@@ -192,7 +192,7 @@ typedef enum SDL_DisplayEventID
 } SDL_DisplayEventID;
 
 /**
- *  \brief Display orientation
+ * Display orientation
  */
 typedef enum SDL_DisplayOrientation
 {
@@ -204,7 +204,7 @@ typedef enum SDL_DisplayOrientation
 } SDL_DisplayOrientation;
 
 /**
- *  \brief Window flash operation
+ * Window flash operation
  */
 typedef enum SDL_FlashOperation
 {
@@ -214,12 +214,12 @@ typedef enum SDL_FlashOperation
 } SDL_FlashOperation;
 
 /**
- *  \brief An opaque handle to an OpenGL context.
+ * An opaque handle to an OpenGL context.
  */
 typedef void *SDL_GLContext;
 
 /**
- *  \brief OpenGL configuration attributes
+ * OpenGL configuration attributes
  */
 typedef enum SDL_GLattr
 {