Skip to content

Commit ff1142c

Browse files
committed
remove bad version checks
1 parent d47948c commit ff1142c

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

lib/tsdl.ml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,8 +1896,11 @@ let set_texture_color_mod =
18961896
returning zero_to_ok)
18971897

18981898
let set_texture_scale_mode =
1899-
pre "SDL_SetTextureScaleMode"; foreign "SDL_SetTextureScaleMode"
1899+
pre "SDL_SetTextureScaleMode";
1900+
if sdl2_version >= (2,0,12)
1901+
then foreign "SDL_SetTextureScaleMode"
19001902
(texture @-> uint @-> returning zero_to_ok)
1903+
else fun _ -> failwith "SDL_SetTextureScaleMode not implemented (need SDL >= 2.0.12)"
19011904

19021905
let unlock_texture =
19031906
pre "SDL_UnlockTexture"; foreign "SDL_UnlockTexture" (texture @-> returning void)
@@ -2042,11 +2045,8 @@ let get_display_mode d i =
20422045
| Ok () -> Ok (display_mode_of_c mode) | Error _ as e -> e
20432046

20442047
let get_display_usable_bounds =
2045-
pre "SDL_GetDisplayUsableBounds";
2046-
if sdl2_version >= (2,0,14)
2047-
then foreign "SDL_GetDisplayUsableBounds"
2048+
pre "SDL_GetDisplayUsableBounds"; foreign "SDL_GetDisplayUsableBounds"
20482049
(int @-> ptr rect @-> returning zero_to_ok)
2049-
else fun _ -> failwith "SDL_GetDisplayUsableBounds not implemented (need SDL >= 2.0.14)"
20502050

20512051
let get_display_usable_bounds i =
20522052
let r = make rect in
@@ -5407,17 +5407,11 @@ let dequeue_audio dev ba =
54075407
dequeue_audio dev (to_voidp (bigarray_start array1 ba)) (len * kind_size)
54085408

54095409
let get_queued_audio_size =
5410-
pre "SDL_GetQueuedAudioSize";
5411-
if sdl2_version >= (2,0,12)
5412-
then foreign "SDL_GetQueuedAudioSize"
5410+
pre "SDL_GetQueuedAudioSize"; foreign "SDL_GetQueuedAudioSize"
54135411
(audio_device_id @-> returning int_as_uint32_t)
5414-
else fun _ -> failwith "SDL_GetQueuedAudioSize not implemented (need SDL >= 2.0.12)"
54155412

54165413
let clear_queued_audio =
5417-
pre "SDL_ClearQueuedAudio";
5418-
if sdl2_version >= (2,0,12)
5419-
then foreign "SDL_ClearQueuedAudio" (audio_device_id @-> returning void)
5420-
else fun _ -> failwith "SDL_ClearQueuedAudio not implemented (need SDL >= 2.0.12)"
5414+
pre "SDL_ClearQueuedAudio"; foreign "SDL_ClearQueuedAudio" (audio_device_id @-> returning void)
54215415

54225416
(* Timer *)
54235417

@@ -5504,10 +5498,7 @@ type power_info =
55045498
pi_pct : int option; }
55055499

55065500
let get_power_info =
5507-
pre "SDL_GetPowerInfo";
5508-
if sdl2_version >= (2,0,16)
5509-
then foreign "SDL_GetPowerInfo" ((ptr int) @-> (ptr int) @-> returning int)
5510-
else fun _ -> failwith "SDL_GetPowerInfo not implemented (need SDL >= 2.0.16)"
5501+
pre "SDL_GetPowerInfo"; foreign "SDL_GetPowerInfo" ((ptr int) @-> (ptr int) @-> returning int)
55115502

55125503
let get_power_info () =
55135504
let secs = allocate int 0 in

0 commit comments

Comments
 (0)