Epok Engine

EPOK RUNTIME

epok::clip_polygon

Function template · 1 overload

Function template

Sutherland-Hodgman against the frustum planes named by `planes` (bit i = plane i of frustum_outcode).

Belongs to
epok
Header
polygon.hpp
Overloads
1

Declaration

template
Declaration
template<class Units> inline int clip_polygon(ClipVertex (&buffers)[2][12], int count, uint8_t planes, int& from)

Sutherland-Hodgman against the frustum planes named by `planes` (bit i = plane i of frustum_outcode).

ParameterTypeMeaning
buffersClipVertex (&)[2][12]Value supplied for buffers. Keep referenced or pointed-to data valid for the complete call.
countintValue supplied for count. Keep referenced or pointed-to data valid for the complete call.
planesuint8_tValue supplied for planes. Keep referenced or pointed-to data valid for the complete call.
fromint &Value supplied for from. Keep referenced or pointed-to data valid for the complete call.

Returns: int. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "polygon.hpp"

// Replace these template arguments with types or values accepted by the declaration:
// Units

// Assume these named values have been initialized with valid data:
// ClipVertex (&)[2][12] buffers
// int count
// uint8_t planes
// int & from

auto result = epok::clip_polygon<Units>(buffers, count, planes, from);

Why use it

Template dispatch is resolved at compile time and normally adds no runtime indirection.

Trade-offs and warnings

Every instantiated type must satisfy the header's compile-time requirements; extra instantiations can increase code size. Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in runtime/polygon.hpp:96

Related members