summaryrefslogtreecommitdiffhomepage
path: root/src/raylib.h
diff options
context:
space:
mode:
authorAhmad Fatoum <[email protected]>2018-02-22 02:05:00 +0100
committerAhmad Fatoum <[email protected]>2018-02-24 15:37:37 +0100
commit6ffc8cb7990fb4ff40f205cb53bec797b10e48a2 (patch)
tree82a7ac62531aee879891164c478efda6924e2db7 /src/raylib.h
parente4d7bbec1ef08279495ac41f5f8c4be359c58cf0 (diff)
downloadraylib-6ffc8cb7990fb4ff40f205cb53bec797b10e48a2.tar.gz
raylib-6ffc8cb7990fb4ff40f205cb53bec797b10e48a2.zip
raymath.h: Use C99 inline semantics
RAYMATH_EXTERN_INLINE was renamed to RAYMATH_HEADER_ONLY, which user code may define if they want to use it as header-only library. If multiple files in the same project define RAYMATH_HEADER_ONLY, they might each have duplicate out-of-line definitions of the same functions. By default, raymath.h exposes inline definitions, which instructs the compiler _not_ to generate out-of-line definitons, if out-of-line definitions are required, those of the file defined with RAYLIB_IMPLEMENTATION are used instead. There may be only one such file. In C++ mode, the compiler will select only one out-of-line definition automatically, so no need to define a RAYLIB_IMPLEMENTATION. Unfortunately, we have to remove raymath function declaration from raylib.h as those declarations would lead to duplicate out-of-line definitions which would yield linker errors. This problem didn't exist with GNU89 or C++, because there multiple defintions are ok, but in C99 they aren't.
Diffstat (limited to 'src/raylib.h')
-rw-r--r--src/raylib.h21
1 files changed, 0 insertions, 21 deletions
diff --git a/src/raylib.h b/src/raylib.h
index a740e234..66598b27 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -338,14 +338,6 @@ typedef struct Matrix {
float m3, m7, m11, m15;
} Matrix;
-typedef struct Float3 {
- float f[3];
-} Float3;
-
-typedef struct Float16 {
- float f[16];
-} Float16;
-
// Color type, RGBA (32bit)
typedef struct Color {
unsigned char r;
@@ -750,19 +742,6 @@ RLAPI Vector3 ColorToHSV(Color color); // Returns HSV
RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value
RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
-// Math useful functions (available from raymath.h)
-RLAPI Vector3 Vector3Zero(void); // Vector with components value 0.0f
-RLAPI Vector3 Vector3One(void); // Vector with components value 1.0f
-RLAPI Matrix MatrixIdentity(void); // Returns identity matrix
-#ifndef Vector3ToFloat
-#define Vector3ToFloat(vec) (Vector3ToFloat_(vec).f) // Returns Vector3 as float array
-RLAPI Float3 Vector3ToFloat_(Vector3 vec); // don't use, use above
-#endif
-#ifndef MatrixToFloat
-#define MatrixToFloat(mat) (MatrixToFloat_(mat).f) // Returns Matrix as float array
-RLAPI Float16 MatrixToFloat_(Matrix mat); // don't use, use above
-#endif
-
// Misc. functions
RLAPI void ShowLogo(void); // Activate raylib logo at startup (can be done with flags)
RLAPI void SetConfigFlags(unsigned char flags); // Setup window configuration flags (view FLAGS)