Skip to content

Commit 47cab7d

Browse files
committed
Add the Windows notification driver
Notifications are supported on Win10 and above.
1 parent f2af15b commit 47cab7d

6 files changed

Lines changed: 1190 additions & 2 deletions

File tree

VisualC-GDK/SDL/SDL.vcxproj.filters

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<ClCompile Include="..\..\src\core\gdk\SDL_gdk.cpp" />
55
<ClCompile Include="..\..\src\core\windows\pch.c" />
66
<ClCompile Include="..\..\src\core\windows\pch_cpp.cpp" />
7+
<ClCompile Include="..\..\src\events\SDL_notificationevents.c" />
8+
<ClCompile Include="..\..\src\notification\dummy\SDL_dummynotification.c" />
9+
<ClCompile Include="..\..\src\notification\SDL_notification.c" />
710
<ClCompile Include="..\..\src\render\direct3d12\SDL_render_d3d12_xbox.cpp" />
811
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxone.cpp" />
912
<ClCompile Include="..\..\src\render\direct3d12\SDL_shaders_d3d12_xboxseries.cpp" />
@@ -54,6 +57,7 @@
5457
<ClCompile Include="..\..\src\gpu\vulkan\SDL_gpu_vulkan.c" />
5558
<ClCompile Include="..\..\src\gpu\xr\SDL_gpu_openxr.c" />
5659
<ClCompile Include="..\..\src\gpu\xr\SDL_openxrdyn.c" />
60+
<ClInclude Include="..\..\src\events\SDL_notificationevents_c.h" />
5761
<ClInclude Include="..\..\src\gpu\xr\SDL_openxr_internal.h" />
5862
<ClCompile Include="..\..\src\haptic\dummy\SDL_syshaptic.c" />
5963
<ClCompile Include="..\..\src\haptic\SDL_haptic.c" />
@@ -241,6 +245,7 @@
241245
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_lsx.c" />
242246
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_sse.c" />
243247
<ClCompile Include="..\..\src\video\yuv2rgb\yuv_rgb_std.c" />
248+
<ClInclude Include="..\..\src\notification\SDL_notification_c.h" />
244249
</ItemGroup>
245250
<ItemGroup>
246251
<ClInclude Include="..\..\include\SDL3\SDL.h" />
@@ -513,4 +518,4 @@
513518
<ItemGroup>
514519
<ResourceCompile Include="..\..\src\core\windows\version.rc" />
515520
</ItemGroup>
516-
</Project>
521+
</Project>

VisualC/SDL/SDL.vcxproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@
466466
<ClInclude Include="..\..\src\events\SDL_keysym_to_keycode_c.h" />
467467
<ClInclude Include="..\..\src\events\SDL_keysym_to_scancode_c.h" />
468468
<ClInclude Include="..\..\src\events\SDL_mouse_c.h" />
469+
<ClInclude Include="..\..\src\events\SDL_notificationevents_c.h" />
469470
<ClInclude Include="..\..\src\events\SDL_pen_c.h" />
470471
<ClInclude Include="..\..\src\events\SDL_scancode_tables_c.h" />
471472
<ClInclude Include="..\..\src\events\SDL_touch_c.h" />
@@ -522,6 +523,7 @@
522523
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h" />
523524
<ClInclude Include="..\..\src\misc\SDL_libusb.h" />
524525
<ClInclude Include="..\..\src\misc\SDL_sysurl.h" />
526+
<ClInclude Include="..\..\src\notification\SDL_notification_c.h" />
525527
<ClInclude Include="..\..\src\power\SDL_syspower.h" />
526528
<ClInclude Include="..\..\src\process\SDL_sysprocess.h" />
527529
<ClInclude Include="..\..\src\render\direct3d11\D3D11_PixelShader_Advanced.h" />
@@ -624,6 +626,7 @@
624626
<ClCompile Include="..\..\src\events\imKStoUCS.c" />
625627
<ClCompile Include="..\..\src\events\SDL_keysym_to_keycode.c" />
626628
<ClCompile Include="..\..\src\events\SDL_keysym_to_scancode.c" />
629+
<ClCompile Include="..\..\src\events\SDL_notificationevents.c" />
627630
<ClCompile Include="..\..\src\events\SDL_scancode_tables.c" />
628631
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c" />
629632
<ClCompile Include="..\..\src\filesystem\windows\SDL_sysfsops.c" />
@@ -639,6 +642,8 @@
639642
<ClCompile Include="..\..\src\main\SDL_main_callbacks.c" />
640643
<ClCompile Include="..\..\src\main\SDL_runapp.c" />
641644
<ClCompile Include="..\..\src\main\windows\SDL_sysmain_runapp.c" />
645+
<ClCompile Include="..\..\src\notification\SDL_notification.c" />
646+
<ClCompile Include="..\..\src\notification\windows\SDL_windowsnotification.c" />
642647
<ClCompile Include="..\..\src\render\vulkan\SDL_render_vulkan.c" />
643648
<ClCompile Include="..\..\src\render\vulkan\SDL_shaders_vulkan.c" />
644649
<ClCompile Include="..\..\src\SDL_guid.c" />
@@ -1000,4 +1005,4 @@
10001005
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
10011006
<ImportGroup Label="ExtensionTargets">
10021007
</ImportGroup>
1003-
</Project>
1008+
</Project>

VisualC/SDL/SDL.vcxproj.filters

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,12 @@
262262
<Filter Include="render\gpu\shaders">
263263
<UniqueIdentifier>{107d41e6-7c7e-4d9a-a3b3-b6f4abfde0c1}</UniqueIdentifier>
264264
</Filter>
265+
<Filter Include="notification">
266+
<UniqueIdentifier>{0000b1b2d12877646f6147a5a7510000}</UniqueIdentifier>
267+
</Filter>
268+
<Filter Include="notification\windows">
269+
<UniqueIdentifier>{0000b6590eb19c11945581d0479b0000}</UniqueIdentifier>
270+
</Filter>
265271
</ItemGroup>
266272
<ItemGroup>
267273
<ClInclude Include="..\..\include\SDL3\SDL.h">
@@ -489,6 +495,9 @@
489495
<ClInclude Include="..\..\src\camera\SDL_syscamera.h">
490496
<Filter>camera</Filter>
491497
</ClInclude>
498+
<ClInclude Include="..\..\src\events\SDL_notificationevents_c.h">
499+
<Filter>events</Filter>
500+
</ClInclude>
492501
<ClInclude Include="..\..\src\filesystem\SDL_sysfilesystem.h">
493502
<Filter>filesystem</Filter>
494503
</ClInclude>
@@ -501,6 +510,9 @@
501510
<ClInclude Include="..\..\src\main\SDL_main_callbacks.h">
502511
<Filter>main</Filter>
503512
</ClInclude>
513+
<ClInclude Include="..\..\src\notification\SDL_notification_c.h">
514+
<Filter>notification</Filter>
515+
</ClInclude>
504516
<ClInclude Include="..\..\src\SDL_error_c.h" />
505517
<ClInclude Include="..\..\src\SDL_hashtable.h" />
506518
<ClInclude Include="..\..\src\SDL_list.h" />
@@ -1351,6 +1363,9 @@
13511363
<ClCompile Include="..\..\src\dialog\SDL_dialog_utils.c">
13521364
<Filter>dialog</Filter>
13531365
</ClCompile>
1366+
<ClCompile Include="..\..\src\events\SDL_notificationevents.c">
1367+
<Filter>events</Filter>
1368+
</ClCompile>
13541369
<ClCompile Include="..\..\src\filesystem\SDL_filesystem.c">
13551370
<Filter>filesystem</Filter>
13561371
</ClCompile>
@@ -1378,6 +1393,12 @@
13781393
<ClCompile Include="..\..\src\main\windows\SDL_sysmain_runapp.c">
13791394
<Filter>main\windows</Filter>
13801395
</ClCompile>
1396+
<ClCompile Include="..\..\src\notification\SDL_notification.c">
1397+
<Filter>notification</Filter>
1398+
</ClCompile>
1399+
<ClCompile Include="..\..\src\notification\windows\SDL_windowsnotification.c">
1400+
<Filter>notification\windows</Filter>
1401+
</ClCompile>
13811402
<ClCompile Include="..\..\src\SDL.c" />
13821403
<ClCompile Include="..\..\src\SDL_assert.c" />
13831404
<ClCompile Include="..\..\src\SDL_error.c" />

src/core/windows/SDL_windows.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,11 @@ BOOL WIN_IsWindows8OrGreater(void)
374374
CHECKWINVER(TRUE, IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0));
375375
}
376376

377+
BOOL WIN_IsWindows10OrGreater(void)
378+
{
379+
CHECKWINVER(TRUE, IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN10), LOBYTE(_WIN32_WINNT_WIN10), 0));
380+
}
381+
377382
BOOL WIN_IsWindows11OrGreater(void)
378383
{
379384
return IsWindowsBuildVersionAtLeast(22000);

src/core/windows/SDL_windows.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ extern BOOL WIN_IsWindows7OrGreater(void);
183183
// Returns true if we're running on Windows 8 and newer
184184
extern BOOL WIN_IsWindows8OrGreater(void);
185185

186+
// Returns true if we're running on Windows 10 and newer
187+
extern BOOL WIN_IsWindows10OrGreater(void);
188+
186189
// Returns true if we're running on Windows 11 and newer
187190
extern BOOL WIN_IsWindows11OrGreater(void);
188191

0 commit comments

Comments
 (0)