Skip to content

Commit 7440285

Browse files
authored
Merge branch 'libsdl-org:main' into main
2 parents 2a1747b + 8eb57c5 commit 7440285

File tree

11 files changed

+172
-15
lines changed

11 files changed

+172
-15
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -2192,6 +2192,7 @@ elseif(APPLE)
21922192
set(SDL_CAMERA_DRIVER_COREMEDIA 1)
21932193
set(HAVE_CAMERA TRUE)
21942194
sdl_glob_sources("${SDL3_SOURCE_DIR}/src/camera/coremedia/*.m")
2195+
set(SDL_FRAMEWORK_AVFOUNDATION 1)
21952196
endif()
21962197
endif()
21972198

VisualC/SDL.sln

+73-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "camera", "camera", "{AAEC83
6969
EndProject
7070
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-read-and-draw", "examples\camera\01-read-and-draw\01-read-and-draw.vcxproj", "{510ACF0C-4012-4216-98EF-E4F155DE33CE}"
7171
EndProject
72-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "game", "game", "{D1BF59F6-22DC-493B-BDEB-451A50DA793D}"
72+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "demo", "demo", "{D1BF59F6-22DC-493B-BDEB-451A50DA793D}"
7373
EndProject
7474
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-snake", "examples\demo\01-snake\01-snake.vcxproj", "{7820969A-5B7B-4046-BB0A-82905D457FC5}"
7575
EndProject
@@ -115,6 +115,22 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-woodeneye-008", "example
115115
EndProject
116116
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "03-infinite-monkeys", "examples\demo\03-infinite-monkeys\03-infinite-monkeys.vcxproj", "{75AEE75A-C016-4497-960B-D767B822237D}"
117117
EndProject
118+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "19-affine-textures", "examples\renderer\19-affine-textures\19-affine-textures.vcxproj", "{E21C50BF-54B4-434C-AA24-9A6469553987}"
119+
EndProject
120+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04-multiple-streams", "examples\audio\04-multiple-streams\04-multiple-streams.vcxproj", "{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}"
121+
EndProject
122+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "asyncio", "asyncio", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
123+
EndProject
124+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "input", "input", "{8DEAE483-FDE7-463F-9FD5-F597BBAED1F9}"
125+
EndProject
126+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-load-bitmaps", "examples\asyncio\01-load-bitmaps\01-load-bitmaps.vcxproj", "{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}"
127+
EndProject
128+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "04-bytepusher", "examples\demo\04-bytepusher\04-bytepusher.vcxproj", "{3DB9B219-769E-43AC-8B8B-319DB6045DCF}"
129+
EndProject
130+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "01-joystick-polling", "examples\input\01-joystick-polling\01-joystick-polling.vcxproj", "{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}"
131+
EndProject
132+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "02-joystick-events", "examples\input\02-joystick-events\02-joystick-events.vcxproj", "{FCBDF2B2-1129-49AE-9406-3F219E65CA89}"
133+
EndProject
118134
Global
119135
GlobalSection(SolutionConfigurationPlatforms) = preSolution
120136
Debug|Win32 = Debug|Win32
@@ -515,6 +531,54 @@ Global
515531
{75AEE75A-C016-4497-960B-D767B822237D}.Release|Win32.Build.0 = Release|Win32
516532
{75AEE75A-C016-4497-960B-D767B822237D}.Release|x64.ActiveCfg = Release|x64
517533
{75AEE75A-C016-4497-960B-D767B822237D}.Release|x64.Build.0 = Release|x64
534+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|Win32.ActiveCfg = Debug|Win32
535+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|Win32.Build.0 = Debug|Win32
536+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|x64.ActiveCfg = Debug|x64
537+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Debug|x64.Build.0 = Debug|x64
538+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|Win32.ActiveCfg = Release|Win32
539+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|Win32.Build.0 = Release|Win32
540+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|x64.ActiveCfg = Release|x64
541+
{E21C50BF-54B4-434C-AA24-9A6469553987}.Release|x64.Build.0 = Release|x64
542+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|Win32.ActiveCfg = Debug|Win32
543+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|Win32.Build.0 = Debug|Win32
544+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|x64.ActiveCfg = Debug|x64
545+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Debug|x64.Build.0 = Debug|x64
546+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|Win32.ActiveCfg = Release|Win32
547+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|Win32.Build.0 = Release|Win32
548+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|x64.ActiveCfg = Release|x64
549+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}.Release|x64.Build.0 = Release|x64
550+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|Win32.ActiveCfg = Debug|Win32
551+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|Win32.Build.0 = Debug|Win32
552+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|x64.ActiveCfg = Debug|x64
553+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Debug|x64.Build.0 = Debug|x64
554+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|Win32.ActiveCfg = Release|Win32
555+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|Win32.Build.0 = Release|Win32
556+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|x64.ActiveCfg = Release|x64
557+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}.Release|x64.Build.0 = Release|x64
558+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|Win32.ActiveCfg = Debug|Win32
559+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|Win32.Build.0 = Debug|Win32
560+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|x64.ActiveCfg = Debug|x64
561+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Debug|x64.Build.0 = Debug|x64
562+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|Win32.ActiveCfg = Release|Win32
563+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|Win32.Build.0 = Release|Win32
564+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|x64.ActiveCfg = Release|x64
565+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF}.Release|x64.Build.0 = Release|x64
566+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|Win32.ActiveCfg = Debug|Win32
567+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|Win32.Build.0 = Debug|Win32
568+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|x64.ActiveCfg = Debug|x64
569+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Debug|x64.Build.0 = Debug|x64
570+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|Win32.ActiveCfg = Release|Win32
571+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|Win32.Build.0 = Release|Win32
572+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|x64.ActiveCfg = Release|x64
573+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}.Release|x64.Build.0 = Release|x64
574+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|Win32.ActiveCfg = Debug|Win32
575+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|Win32.Build.0 = Debug|Win32
576+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|x64.ActiveCfg = Debug|x64
577+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Debug|x64.Build.0 = Debug|x64
578+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|Win32.ActiveCfg = Release|Win32
579+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|Win32.Build.0 = Release|Win32
580+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|x64.ActiveCfg = Release|x64
581+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89}.Release|x64.Build.0 = Release|x64
518582
EndGlobalSection
519583
GlobalSection(SolutionProperties) = preSolution
520584
HideSolutionNode = FALSE
@@ -572,6 +636,14 @@ Global
572636
{608C6C67-7766-471F-BBFF-8B00086039AF} = {1B61A1B7-92DE-4C37-9151-D2928D6449AB}
573637
{A3F601E0-B54C-4DD8-8A97-FDEF7624EE60} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
574638
{75AEE75A-C016-4497-960B-D767B822237D} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
639+
{E21C50BF-54B4-434C-AA24-9A6469553987} = {F91DDAF0-B74F-4516-A1A9-42ED8DFCBF6A}
640+
{7117A55C-BE4E-41DB-A4FC-4070E35A8B28} = {1B61A1B7-92DE-4C37-9151-D2928D6449AB}
641+
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
642+
{8DEAE483-FDE7-463F-9FD5-F597BBAED1F9} = {1498F0CD-F4DA-4847-9CB2-FB18D48061D5}
643+
{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
644+
{3DB9B219-769E-43AC-8B8B-319DB6045DCF} = {D1BF59F6-22DC-493B-BDEB-451A50DA793D}
645+
{B3852DB7-E925-4026-8B9D-D2272EFEFF3C} = {8DEAE483-FDE7-463F-9FD5-F597BBAED1F9}
646+
{FCBDF2B2-1129-49AE-9406-3F219E65CA89} = {8DEAE483-FDE7-463F-9FD5-F597BBAED1F9}
575647
EndGlobalSection
576648
GlobalSection(ExtensibilityGlobals) = postSolution
577649
SolutionGuid = {C320C9F2-1A8F-41D7-B02B-6338F872BCAD}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{6A2BFA8B-C027-400D-A18B-3E9E1CC4DDD0}</ProjectGuid>
5+
</PropertyGroup>
6+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
7+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8+
<ItemGroup>
9+
<None Include="$(SolutionDir)\..\examples\asyncio\01-load-bitmaps\README.txt" />
10+
<ClCompile Include="$(SolutionDir)\..\examples\asyncio\01-load-bitmaps\load-bitmaps.c" />
11+
</ItemGroup>
12+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{7117A55C-BE4E-41DB-A4FC-4070E35A8B28}</ProjectGuid>
5+
</PropertyGroup>
6+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
7+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8+
<ItemGroup>
9+
<None Include="$(SolutionDir)\..\examples\audio\04-multiple-streams\README.txt" />
10+
<ClCompile Include="$(SolutionDir)\..\examples\audio\04-multiple-streams\multiple-streams.c" />
11+
</ItemGroup>
12+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{3DB9B219-769E-43AC-8B8B-319DB6045DCF}</ProjectGuid>
5+
</PropertyGroup>
6+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
7+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8+
<ItemGroup>
9+
<None Include="$(SolutionDir)\..\examples\demo\04-bytepusher\README.txt" />
10+
<ClCompile Include="$(SolutionDir)\..\examples\demo\04-bytepusher\bytepusher.c" />
11+
</ItemGroup>
12+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
13+
</Project>

VisualC/examples/generate.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def main():
4747
for category in path.iterdir():
4848
if category.is_dir():
4949
for example in category.iterdir():
50-
generate(category.name, example.name, get_c_source_filename(example))
50+
if example.is_dir():
51+
generate(category.name, example.name, get_c_source_filename(example))
5152

5253

5354
if __name__ == "__main__":
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{B3852DB7-E925-4026-8B9D-D2272EFEFF3C}</ProjectGuid>
5+
</PropertyGroup>
6+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
7+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8+
<ItemGroup>
9+
<None Include="$(SolutionDir)\..\examples\input\01-joystick-polling\README.txt" />
10+
<ClCompile Include="$(SolutionDir)\..\examples\input\01-joystick-polling\joystick-polling.c" />
11+
</ItemGroup>
12+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{FCBDF2B2-1129-49AE-9406-3F219E65CA89}</ProjectGuid>
5+
</PropertyGroup>
6+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
7+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8+
<ItemGroup>
9+
<None Include="$(SolutionDir)\..\examples\input\02-joystick-events\README.txt" />
10+
<ClCompile Include="$(SolutionDir)\..\examples\input\02-joystick-events\joystick-events.c" />
11+
</ItemGroup>
12+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Globals">
4+
<ProjectGuid>{E21C50BF-54B4-434C-AA24-9A6469553987}</ProjectGuid>
5+
</PropertyGroup>
6+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
7+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
8+
<ItemGroup>
9+
<None Include="$(SolutionDir)\..\examples\renderer\19-affine-textures\README.txt" />
10+
<ClCompile Include="$(SolutionDir)\..\examples\renderer\19-affine-textures\affine-textures.c" />
11+
</ItemGroup>
12+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
13+
</Project>

src/audio/disk/SDL_diskaudio.c

+13-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,16 @@ static const char *get_filename(const bool recording)
100100
return devname;
101101
}
102102

103+
static const char *AudioFormatString(SDL_AudioFormat fmt)
104+
{
105+
const char *str = SDL_GetAudioFormatName(fmt);
106+
SDL_assert(str);
107+
if (SDL_strncmp(str, "SDL_AUDIO_", 10) == 0) {
108+
str += 10; // so we return "S8" instead of "SDL_AUDIO_S8", etc.
109+
}
110+
return str;
111+
}
112+
103113
static bool DISKAUDIO_OpenDevice(SDL_AudioDevice *device)
104114
{
105115
bool recording = device->recording;
@@ -136,7 +146,9 @@ static bool DISKAUDIO_OpenDevice(SDL_AudioDevice *device)
136146
}
137147

138148
SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, "You are using the SDL disk i/o audio driver!");
139-
SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, " %s file [%s].", recording ? "Reading from" : "Writing to", fname);
149+
SDL_LogCritical(SDL_LOG_CATEGORY_AUDIO, " %s file [%s], format=%s channels=%d freq=%d.",
150+
recording ? "Reading from" : "Writing to", fname,
151+
AudioFormatString(device->spec.format), device->spec.channels, device->spec.freq);
140152

141153
return true; // We're ready to rock and roll. :-)
142154
}

src/video/x11/SDL_x11window.c

+5-12
Original file line numberDiff line numberDiff line change
@@ -1516,17 +1516,13 @@ void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
15161516
SDL_WindowData *data = window->internal;
15171517
Display *display = data->videodata->display;
15181518
bool bActivate = SDL_GetHintBoolean(SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN, true);
1519-
bool position_is_absolute = false;
15201519
bool set_position = false;
15211520
XEvent event;
15221521

15231522
if (SDL_WINDOW_IS_POPUP(window)) {
15241523
// Update the position in case the parent moved while we were hidden
15251524
X11_ConstrainPopup(window, true);
15261525
data->pending_position = true;
1527-
1528-
// Coordinates after X11_ConstrainPopup() are already in the global space.
1529-
position_is_absolute = true;
15301526
set_position = true;
15311527
}
15321528

@@ -1569,14 +1565,11 @@ void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
15691565
const int tx = data->pending_position ? window->pending.x : window->x;
15701566
const int ty = data->pending_position ? window->pending.y : window->y;
15711567
int x, y;
1572-
if (position_is_absolute) {
1573-
x = tx;
1574-
y = ty;
1575-
} else {
1576-
SDL_RelativeToGlobalForWindow(window,
1577-
tx - data->border_left, ty - data->border_top,
1578-
&x, &y);
1579-
}
1568+
1569+
SDL_RelativeToGlobalForWindow(window,
1570+
tx - data->border_left, ty - data->border_top,
1571+
&x, &y);
1572+
15801573
data->pending_position = false;
15811574
X11_XMoveWindow(display, data->xwindow, x, y);
15821575
}

0 commit comments

Comments
 (0)