Standard functions

EsAssertionFailure

void EsAssertionFailure(EsCString cFile, int line);

Called by the EsAssert macro when a check fails. Reports the file and line, then crashes the process.

EsCalculateFromUserExpression

EsCalculationValue EsCalculateFromUserExpression(EsCString cExpression);

For user input only; do not rely on consistent behaviour across versions; use with message mutex.

EsPanic

void EsPanic(EsCString format, ...);

Prints a formatted message and then crashes the process. Does not return.

EsPrint

void EsPrint(EsCString format, ...);

Formats a message and writes it to the debug output. Thread safe.

EsPrintDirect

void EsPrintDirect(STRING string);

Writes a string directly to the debug output without formatting.

EsPrintHelloWorld

void EsPrintHelloWorld();

Writes a test message to the debug output.

EsRandomU8

uint8_t EsRandomU8();

Returns a pseudo-random number from 0 to 255. Thread safe.

EsRandomU64

uint64_t EsRandomU64();

Returns a pseudo-random 64-bit number. Thread safe.

EsRandomAddEntropy

void EsRandomAddEntropy(uint64_t x);

Mixes the given value into the random generator state.

EsRandomSeed

void EsRandomSeed(uint64_t x);

Resets the random generator and seeds it with the given value.

EsRectangleAdd

EsRectangle EsRectangleAdd(EsRectangle a, EsRectangle b);

Adds each side of b to the matching side of a.

EsRectangleAddBorder

EsRectangle EsRectangleAddBorder(EsRectangle rectangle, EsRectangle border);

Shrinks the rectangle by the border on each side.

EsRectangleBounding

EsRectangle EsRectangleBounding(EsRectangle a, EsRectangle b);

Returns the smallest rectangle that contains both a and b.

EsRectangleCenter

EsRectangle EsRectangleCenter(EsRectangle parent, EsRectangle child);

Returns the child rectangle centered inside the parent rectangle.

EsRectangleCut

EsRectangle EsRectangleCut(EsRectangle a, int32_t amount, char side);

Cuts amount pixels from one side of the rectangle and returns that piece. side is one of 'l', 'r', 't', or 'b'.

EsRectangleFit

EsRectangle EsRectangleFit(EsRectangle parent, EsRectangle child, bool allowScalingUp);

Preserves aspect ratio.

EsRectangleIntersection

EsRectangle EsRectangleIntersection(EsRectangle a, EsRectangle b);

Returns the region common to both rectangles. The result may be invalid if they do not overlap.

EsRectangleLinearInterpolate

EsRectangle EsRectangleLinearInterpolate(EsRectangle a, EsRectangle b, float progress);

Linearly interpolates each side of the rectangle by progress.

EsRectangleSplit

EsRectangle EsRectangleSplit(EsRectangle *a, int32_t amount, char side, int32_t gap = 0);

Same as EsRectangleCut, but the source rectangle is modified.

EsRectangleSubtract

EsRectangle EsRectangleSubtract(EsRectangle a, EsRectangle b);

Subtracts each side of b from the matching side of a.

EsRectangleTranslate

EsRectangle EsRectangleTranslate(EsRectangle a, EsRectangle b);

Shifts the rectangle by the offset given in b.l and b.t.

EsRectangleEquals

bool EsRectangleEquals(EsRectangle a, EsRectangle b);

Returns true if the two rectangles are identical.

EsRectangleContains

bool EsRectangleContains(EsRectangle a, int32_t x, int32_t y);

Returns true if the point is inside the rectangle. The right and bottom edges are excluded.

EsRectangleContainsAll

bool EsRectangleContainsAll(EsRectangle parent, EsRectangle child);

Returns true iff the child rectangle is entirely contained within parent.