Skip to content

Commit e079e7a

Browse files
committed
Add trigonometric functions to sdlstdinc
1 parent 4ebe24b commit e079e7a

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

units/sdlstdinc.inc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,62 @@ function SDL_realloc(mem: Pointer; size: csize_t): Pointer; cdecl;
138138
procedure SDL_free(mem: Pointer); cdecl;
139139
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_free' {$ENDIF} {$ENDIF};
140140

141+
142+
(*** --- Math functions --- ***)
143+
144+
145+
(**
146+
* Calculate the cosine of x, where x is given in radians.
147+
*
148+
* \since This function is available since SDL 2.0.4.
149+
*)
150+
function SDL_cos(x: cdouble): cdouble; cdecl;
151+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_cos' {$ENDIF} {$ENDIF};
152+
153+
(**
154+
* Calculate the cosine of x, where x is given in radians.
155+
*
156+
* \since This function is available since SDL 2.0.4.
157+
*)
158+
function SDL_cosf(x: cfloat): cfloat; cdecl;
159+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_cosf' {$ENDIF} {$ENDIF};
160+
161+
(**
162+
* Calculate the sine of x, where x is given in radians.
163+
*
164+
* \since This function is available since SDL 2.0.4.
165+
*)
166+
function SDL_sin(x: cdouble): cdouble; cdecl;
167+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_sin' {$ENDIF} {$ENDIF};
168+
169+
(**
170+
* Calculate the sine of x, where x is given in radians.
171+
*
172+
* \since This function is available since SDL 2.0.4.
173+
*)
174+
function SDL_sinf(x: cfloat): cfloat; cdecl;
175+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_sinf' {$ENDIF} {$ENDIF};
176+
177+
(**
178+
* Calculate the tangent of x, where x is given in radians.
179+
*
180+
* \since This function is available since SDL 2.0.4.
181+
*)
182+
function SDL_tan(x: cdouble): cdouble; cdecl;
183+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_tan' {$ENDIF} {$ENDIF};
184+
185+
(**
186+
* Calculate the tangent of x, where x is given in radians.
187+
*
188+
* \since This function is available since SDL 2.0.4.
189+
*)
190+
function SDL_tanf(x: cfloat): cfloat; cdecl;
191+
external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_tanf' {$ENDIF} {$ENDIF};
192+
193+
194+
(*** --- iconv functions --- ***)
195+
196+
141197
(**
142198
* This function converts a string between encodings in one pass, returning a
143199
* string that must be freed with SDL_free(), or NIL on error.

0 commit comments

Comments
 (0)