~evantj/hare-raylib

6880e3e2722010c0bfe8623c4cc29dbc7a9c1cfb — Evan Johnston 1 year, 3 months ago bb64ebc
remove raymath from makefile

still need to dedupe things which i was planning to do at the time
that i added to the makefile but i didn't and forgot i did that
2 files changed, 1 insertions(+), 284 deletions(-)

M Makefile
D raylib/raymath.ha
M Makefile => Makefile +1 -1
@@ 5,7 5,7 @@ LIBS=-lraylib
RAYLIB_HEADER := /usr/include/raylib.h
RAYMATH_HEADER := /usr/include/raymath.h

all: raylib/raylib.ha raylib/raymath.ha
all: raylib/raylib.ha

raylib/raylib.ha: raylib.json hare-raylib.py
	./hare-raylib.py raylib.json > raylib/raylib.ha

D raylib/raymath.ha => raylib/raymath.ha +0 -283
@@ 1,283 0,0 @@

use strings;

// c boolean
export type c_bool = enum u8 {
	FALSE = 0,
	TRUE = 1,
};

// internal to raudio
export type rAudioProcessor = void;

// internal to raudio
export type rAudioBuffer = void;


export def PI: f64 = 3.141592653589793;

export def DEG2RAD: f64 = (PI/180.0);

export def RAD2DEG: f64 = (180.0/PI);

// Vector2 type
export type Vector2 = struct {
	x: f32,
	y: f32,
};

// Vector3 type
export type Vector3 = struct {
	x: f32,
	y: f32,
	z: f32,
};

// Vector4 type
export type Vector4 = struct {
	x: f32,
	y: f32,
	z: f32,
	w: f32,
};

// Matrix type (OpenGL style 4x4 - right handed, column major)
export type Matrix = struct {
	// Matrix first row (4 components)
	m0: f32,
	// Matrix first row (4 components)
	m4: f32,
	// Matrix first row (4 components)
	m8: f32,
	// Matrix first row (4 components)
	m12: f32,
	// Matrix second row (4 components)
	m1: f32,
	// Matrix second row (4 components)
	m5: f32,
	// Matrix second row (4 components)
	m9: f32,
	// Matrix second row (4 components)
	m13: f32,
	// Matrix third row (4 components)
	m2: f32,
	// Matrix third row (4 components)
	m6: f32,
	// Matrix third row (4 components)
	m10: f32,
	// Matrix third row (4 components)
	m14: f32,
	// Matrix fourth row (4 components)
	m3: f32,
	// Matrix fourth row (4 components)
	m7: f32,
	// Matrix fourth row (4 components)
	m11: f32,
	// Matrix fourth row (4 components)
	m15: f32,
};

// NOTE: Helper types to be used instead of array return types for *ToFloat functions
export type float3 = struct {
	v: [3]f32,
};

export type float16 = struct {
	v: [16]f32,
};

// Quaternion type
export type Quaternion = Vector4;

export @symbol("Clamp") fn Clamp(value: f32, min: f32, max: f32) f32;

export @symbol("Lerp") fn Lerp(start: f32, end: f32, amount: f32) f32;

export @symbol("Normalize") fn Normalize(value: f32, start: f32, end: f32) f32;

export @symbol("Remap") fn Remap(value: f32, inputStart: f32, inputEnd: f32, outputStart: f32, outputEnd: f32) f32;

export @symbol("Vector2Zero") fn Vector2Zero() Vector2;

export @symbol("Vector2One") fn Vector2One() Vector2;

export @symbol("Vector2Add") fn Vector2Add(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2AddValue") fn Vector2AddValue(v: Vector2, add: f32) Vector2;

export @symbol("Vector2Subtract") fn Vector2Subtract(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2SubtractValue") fn Vector2SubtractValue(v: Vector2, sub: f32) Vector2;

export @symbol("Vector2Length") fn Vector2Length(v: Vector2) f32;

export @symbol("Vector2LengthSqr") fn Vector2LengthSqr(v: Vector2) f32;

export @symbol("Vector2DotProduct") fn Vector2DotProduct(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2Distance") fn Vector2Distance(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2Angle") fn Vector2Angle(v1: Vector2, v2: Vector2) f32;

export @symbol("Vector2Scale") fn Vector2Scale(v: Vector2, scale: f32) Vector2;

export @symbol("Vector2Multiply") fn Vector2Multiply(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2Negate") fn Vector2Negate(v: Vector2) Vector2;

export @symbol("Vector2Divide") fn Vector2Divide(v1: Vector2, v2: Vector2) Vector2;

export @symbol("Vector2Normalize") fn Vector2Normalize(v: Vector2) Vector2;

export @symbol("Vector2Lerp") fn Vector2Lerp(v1: Vector2, v2: Vector2, amount: f32) Vector2;

export @symbol("Vector2Reflect") fn Vector2Reflect(v: Vector2, normal: Vector2) Vector2;

export @symbol("Vector2Rotate") fn Vector2Rotate(v: Vector2, angle: f32) Vector2;

export @symbol("Vector2MoveTowards") fn Vector2MoveTowards(v: Vector2, target: Vector2, maxDistance: f32) Vector2;

export @symbol("Vector3Zero") fn Vector3Zero() Vector3;

export @symbol("Vector3One") fn Vector3One() Vector3;

export @symbol("Vector3Add") fn Vector3Add(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3AddValue") fn Vector3AddValue(v: Vector3, add: f32) Vector3;

export @symbol("Vector3Subtract") fn Vector3Subtract(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3SubtractValue") fn Vector3SubtractValue(v: Vector3, sub: f32) Vector3;

export @symbol("Vector3Scale") fn Vector3Scale(v: Vector3, scalar: f32) Vector3;

export @symbol("Vector3Multiply") fn Vector3Multiply(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3CrossProduct") fn Vector3CrossProduct(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Perpendicular") fn Vector3Perpendicular(v: Vector3) Vector3;

export @symbol("Vector3Length") fn Vector3Length(v: const Vector3) f32;

export @symbol("Vector3LengthSqr") fn Vector3LengthSqr(v: const Vector3) f32;

export @symbol("Vector3DotProduct") fn Vector3DotProduct(v1: Vector3, v2: Vector3) f32;

export @symbol("Vector3Distance") fn Vector3Distance(v1: Vector3, v2: Vector3) f32;

export @symbol("Vector3Angle") fn Vector3Angle(v1: Vector3, v2: Vector3) Vector2;

export @symbol("Vector3Negate") fn Vector3Negate(v: Vector3) Vector3;

export @symbol("Vector3Divide") fn Vector3Divide(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Normalize") fn Vector3Normalize(v: Vector3) Vector3;

export @symbol("Vector3OrthoNormalize") fn Vector3OrthoNormalize(v1: *Vector3, v2: *Vector3) void;

export @symbol("Vector3Transform") fn Vector3Transform(v: Vector3, mat: Matrix) Vector3;

export @symbol("Vector3RotateByQuaternion") fn Vector3RotateByQuaternion(v: Vector3, q: Quaternion) Vector3;

export @symbol("Vector3Lerp") fn Vector3Lerp(v1: Vector3, v2: Vector3, amount: f32) Vector3;

export @symbol("Vector3Reflect") fn Vector3Reflect(v: Vector3, normal: Vector3) Vector3;

export @symbol("Vector3Min") fn Vector3Min(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Max") fn Vector3Max(v1: Vector3, v2: Vector3) Vector3;

export @symbol("Vector3Barycenter") fn Vector3Barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) Vector3;

export @symbol("Vector3Unproject") fn Vector3Unproject(source: Vector3, projection: Matrix, view: Matrix) Vector3;

export @symbol("Vector3ToFloatV") fn Vector3ToFloatV(v: Vector3) float3;

export @symbol("MatrixDeterminant") fn MatrixDeterminant(mat: Matrix) f32;

export @symbol("MatrixTrace") fn MatrixTrace(mat: Matrix) f32;

export @symbol("MatrixTranspose") fn MatrixTranspose(mat: Matrix) Matrix;

export @symbol("MatrixInvert") fn MatrixInvert(mat: Matrix) Matrix;

export @symbol("MatrixNormalize") fn MatrixNormalize(mat: Matrix) Matrix;

export @symbol("MatrixIdentity") fn MatrixIdentity() Matrix;

export @symbol("MatrixAdd") fn MatrixAdd(left: Matrix, right: Matrix) Matrix;

export @symbol("MatrixSubtract") fn MatrixSubtract(left: Matrix, right: Matrix) Matrix;

export @symbol("MatrixMultiply") fn MatrixMultiply(left: Matrix, right: Matrix) Matrix;

export @symbol("MatrixTranslate") fn MatrixTranslate(x: f32, y: f32, z: f32) Matrix;

export @symbol("MatrixRotate") fn MatrixRotate(axis: Vector3, angle: f32) Matrix;

export @symbol("MatrixRotateX") fn MatrixRotateX(angle: f32) Matrix;

export @symbol("MatrixRotateY") fn MatrixRotateY(angle: f32) Matrix;

export @symbol("MatrixRotateZ") fn MatrixRotateZ(angle: f32) Matrix;

export @symbol("MatrixRotateXYZ") fn MatrixRotateXYZ(ang: Vector3) Matrix;

export @symbol("MatrixRotateZYX") fn MatrixRotateZYX(ang: Vector3) Matrix;

export @symbol("MatrixScale") fn MatrixScale(x: f32, y: f32, z: f32) Matrix;

export @symbol("MatrixFrustum") fn MatrixFrustum(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix;

export @symbol("MatrixPerspective") fn MatrixPerspective(fovy: f64, aspect: f64, near: f64, far: f64) Matrix;

export @symbol("MatrixOrtho") fn MatrixOrtho(left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64) Matrix;

export @symbol("MatrixLookAt") fn MatrixLookAt(eye: Vector3, target: Vector3, up: Vector3) Matrix;

export @symbol("MatrixToFloatV") fn MatrixToFloatV(mat: Matrix) float16;

export @symbol("QuaternionAdd") fn QuaternionAdd(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionAddValue") fn QuaternionAddValue(q: Quaternion, add: f32) Quaternion;

export @symbol("QuaternionSubtract") fn QuaternionSubtract(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionSubtractValue") fn QuaternionSubtractValue(q: Quaternion, sub: f32) Quaternion;

export @symbol("QuaternionIdentity") fn QuaternionIdentity() Quaternion;

export @symbol("QuaternionLength") fn QuaternionLength(q: Quaternion) f32;

export @symbol("QuaternionNormalize") fn QuaternionNormalize(q: Quaternion) Quaternion;

export @symbol("QuaternionInvert") fn QuaternionInvert(q: Quaternion) Quaternion;

export @symbol("QuaternionMultiply") fn QuaternionMultiply(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionScale") fn QuaternionScale(q: Quaternion, mul: f32) Quaternion;

export @symbol("QuaternionDivide") fn QuaternionDivide(q1: Quaternion, q2: Quaternion) Quaternion;

export @symbol("QuaternionLerp") fn QuaternionLerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;

export @symbol("QuaternionNlerp") fn QuaternionNlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;

export @symbol("QuaternionSlerp") fn QuaternionSlerp(q1: Quaternion, q2: Quaternion, amount: f32) Quaternion;

export @symbol("QuaternionFromVector3ToVector3") fn QuaternionFromVector3ToVector3(from: Vector3, to: Vector3) Quaternion;

export @symbol("QuaternionFromMatrix") fn QuaternionFromMatrix(mat: Matrix) Quaternion;

export @symbol("QuaternionToMatrix") fn QuaternionToMatrix(q: Quaternion) Matrix;

export @symbol("QuaternionFromAxisAngle") fn QuaternionFromAxisAngle(axis: Vector3, angle: f32) Quaternion;

export @symbol("QuaternionToAxisAngle") fn QuaternionToAxisAngle(q: Quaternion, outAxis: *Vector3, outAngle: *f32) void;

export @symbol("QuaternionFromEuler") fn QuaternionFromEuler(pitch: f32, yaw: f32, roll: f32) Quaternion;

export @symbol("QuaternionToEuler") fn QuaternionToEuler(q: Quaternion) Vector3;

export @symbol("QuaternionTransform") fn QuaternionTransform(q: Quaternion, mat: Matrix) Quaternion;