Skip to content

Commit 791e9b2

Browse files
committed
Merge branch 'main' of github.com:libsdl-org/SDL
2 parents 9f185fa + 7c11a8c commit 791e9b2

19 files changed

+302
-183
lines changed

docs/README-ngage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ a state-of-the-art C23 compiler. The irony writes itself.
4444
## Existing Issues and Limitations
4545

4646
- For now, the new
47-
[SDL3 main callbacks](https://wiki.libsdl.org/SDL3/README/main-functions#how-to-use-main-callbacks-in-sdl3)
47+
[SDL3 main callbacks](https://wiki.libsdl.org/SDL3/README-main-functions#main-callbacks-in-sdl3)
4848
are not optional and must be used. This is important as the callbacks
4949
are optional on other platforms.
5050

docs/README-platforms.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [NetBSD](README-bsd.md)
1313
- [Nintendo Switch](README-switch.md)
1414
- [Nintendo 3DS](README-n3ds.md)
15+
- [Nokia N-Gage](README-ngage.md)
1516
- [OpenBSD](README-bsd.md)
1617
- [PlayStation 2](README-ps2.md)
1718
- [PlayStation 4](README-ps4.md)
@@ -24,7 +25,6 @@
2425
- [Windows](README-windows.md)
2526
- [Windows GDK](README-gdk.md)
2627
- [Xbox](README-gdk.md)
27-
- [Nokia N-Gage](README-ngage.md)
2828

2929
## Unsupported Platforms
3030

include/SDL3/SDL_endian.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ SDL_FORCE_INLINE Uint32 SDL_Swap32(Uint32 x) { return x_but_byteswapped; }
486486
*
487487
* \since This function is available since SDL 3.2.0.
488488
*/
489-
SDL_FORCE_INLINE Uint32 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
489+
SDL_FORCE_INLINE Uint64 SDL_Swap64(Uint64 x) { return x_but_byteswapped; }
490490

491491
/**
492492
* Swap a 16-bit value from littleendian to native byte order.

include/SDL3/SDL_hints.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2500,6 +2500,10 @@ extern "C" {
25002500
* This defaults to 0, and specifying NULL for the hint's value will restore
25012501
* the default.
25022502
*
2503+
* This doesn't have to be an integer value. For example, "59.94" won't be
2504+
* rounded to an integer rate; the digits after the decimal are actually
2505+
* respected.
2506+
*
25032507
* This hint can be set anytime.
25042508
*
25052509
* \since This hint is available since SDL 3.2.0.

include/SDL3/SDL_video.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void);
545545
* to be proper names.
546546
*
547547
* \param index the index of a video driver.
548-
* \returns the name of the video driver with the given **index**.
548+
* \returns the name of the video driver with the given **index**, or NULL if
549+
* index is out of bounds.
549550
*
550551
* \threadsafety This function should only be called on the main thread.
551552
*

src/dynapi/SDL_dynapi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#define SDL_DYNAMIC_API 0
5858
#elif defined(SDL_PLATFORM_RISCOS) // probably not useful on RISC OS, since dlopen() can't be used when using static linking.
5959
#define SDL_DYNAMIC_API 0
60-
#elif defined(__clang_analyzer__) || defined(__INTELLISENSE__) || defined(SDL_THREAD_SAFETY_ANALYSIS)
60+
#elif defined(__clang_analyzer__) || defined(__INTELLISENSE__) || defined(SDL_THREAD_SAFETY_ANALYSIS) || defined(__RESHARPER__)
6161
#define SDL_DYNAMIC_API 0 // Turn off for static analysis, so reports are more clear.
6262
#elif defined(SDL_PLATFORM_VITA)
6363
#define SDL_DYNAMIC_API 0 // vitasdk doesn't support dynamic linking

src/gpu/SDL_gpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@ void SDL_EndGPUComputePass(
25362536
if (COMPUTEPASS_DEVICE->debug_mode) {
25372537
commandBufferCommonHeader = (CommandBufferCommonHeader *)COMPUTEPASS_COMMAND_BUFFER;
25382538
commandBufferCommonHeader->compute_pass.in_progress = false;
2539-
commandBufferCommonHeader->compute_pass.compute_pipeline = false;
2539+
commandBufferCommonHeader->compute_pass.compute_pipeline = NULL;
25402540
SDL_zeroa(commandBufferCommonHeader->compute_pass.sampler_bound);
25412541
SDL_zeroa(commandBufferCommonHeader->compute_pass.read_only_storage_texture_bound);
25422542
SDL_zeroa(commandBufferCommonHeader->compute_pass.read_only_storage_buffer_bound);

src/gpu/metal/SDL_gpu_metal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3759,7 +3759,7 @@ static void METAL_ReleaseWindow(
37593759
MetalWindowData *windowData = METAL_INTERNAL_FetchWindowData(window);
37603760

37613761
if (windowData == NULL) {
3762-
SET_STRING_ERROR_AND_RETURN("Window is not claimed by this SDL_GpuDevice", );
3762+
SET_STRING_ERROR_AND_RETURN("Window is not claimed by this SDL_GPUDevice", );
37633763
}
37643764

37653765
METAL_Wait(driverData);
@@ -3838,7 +3838,7 @@ static bool METAL_INTERNAL_AcquireSwapchainTexture(
38383838

38393839
windowData = METAL_INTERNAL_FetchWindowData(window);
38403840
if (windowData == NULL) {
3841-
SET_STRING_ERROR_AND_RETURN("Window is not claimed by this SDL_GpuDevice", false);
3841+
SET_STRING_ERROR_AND_RETURN("Window is not claimed by this SDL_GPUDevice", false);
38423842
}
38433843

38443844
// Update the window size

src/gpu/vulkan/SDL_gpu_vulkan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11700,7 +11700,7 @@ static SDL_GPUDevice *VULKAN_CreateDevice(bool debugMode, bool preferLowPower, S
1170011700
renderer = (VulkanRenderer *)SDL_calloc(1, sizeof(*renderer));
1170111701
if (!renderer) {
1170211702
SDL_Vulkan_UnloadLibrary();
11703-
return false;
11703+
return NULL;
1170411704
}
1170511705

1170611706
renderer->debugMode = debugMode;

src/main/generic/SDL_sysmain_callbacks.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#ifndef SDL_PLATFORM_IOS
2727

28-
static int callback_rate_increment = 0;
28+
static Uint64 callback_rate_increment = 0;
2929
static bool iterate_after_waitevent = false;
3030

3131
static void SDLCALL MainCallbackRateHintChanged(void *userdata, const char *name, const char *oldValue, const char *newValue)
@@ -34,9 +34,9 @@ static void SDLCALL MainCallbackRateHintChanged(void *userdata, const char *name
3434
if (iterate_after_waitevent) {
3535
callback_rate_increment = 0;
3636
} else {
37-
const int callback_rate = newValue ? SDL_atoi(newValue) : 0;
38-
if (callback_rate > 0) {
39-
callback_rate_increment = ((Uint64) 1000000000) / ((Uint64) callback_rate);
37+
const double callback_rate = newValue ? SDL_atof(newValue) : 0.0;
38+
if (callback_rate > 0.0) {
39+
callback_rate_increment = (Uint64) ((double) SDL_NS_PER_SECOND / callback_rate);
4040
} else {
4141
callback_rate_increment = 0;
4242
}

0 commit comments

Comments
 (0)