Add intrinsics.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
#ifndef HANDMADE_INTRINSICS_H_SENTRY
|
||||
#define HANDMADE_INTRINSICS_H_SENTRY
|
||||
|
||||
/* TODO: Re-implement these functions so we do not have to rely on
|
||||
math.h. */
|
||||
|
||||
#include <math.h>
|
||||
|
||||
S32 RoundF32toS32(F32 Real32)
|
||||
{
|
||||
S32 Result = (S32)(Real32 + 0.5f);
|
||||
return Result;
|
||||
}
|
||||
|
||||
S32 FloorF32toS32(F32 Real32)
|
||||
{
|
||||
S32 Result = (S32)floorf(Real32);
|
||||
return Result;
|
||||
}
|
||||
|
||||
F32 Sin(F32 Angle)
|
||||
{
|
||||
F32 Result = sinf(Angle);
|
||||
return Result;
|
||||
}
|
||||
|
||||
F32 Cos(F32 Angle)
|
||||
{
|
||||
F32 Result = cosf(Angle);
|
||||
return Result;
|
||||
}
|
||||
|
||||
F32 ATan2(F32 Y, F32 X)
|
||||
{
|
||||
F32 Result = atan2f(Y, X);
|
||||
return Result;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user