nCine namespace

Root namespace of nCine game engine.

Namespaces

namespace Backends
Platform-specific backends.
namespace Primitives
Primitives.

Classes

class AccelerometerEvent
Accelerometer sensor reading.
class ALAudioDevice
OpenAL implementation of IAudioDevice.
class AndroidApplication
Main entry point and handler for Android applications.
class AnimatedSprite
Textured sprite that cycles through one or more frame animations.
class AppConfiguration
Initialization settings for an nCine application.
class Application
Base class for the main entry point of an nCine application.
class AudioBuffer
Fully decoded OpenAL audio buffer.
class AudioBufferPlayer
Plays back a fully decoded AudioBuffer.
class AudioLoaderMpt
Audio loader for tracker module formats, backed by libopenmpt.
class AudioLoaderOgg
Audio loader for the Ogg Vorbis format, backed by libvorbis.
class AudioLoaderWav
Audio loader for the WAVE (.wav) format.
class AudioReaderMpt
Audio reader for tracker module formats, backed by libopenmpt.
class AudioReaderOgg
Audio reader for the Ogg Vorbis format, backed by libvorbis.
class AudioReaderWav
Audio reader for the WAVE (.wav) format.
class AudioStream
Streams audio decoded on the fly into a rotating set of OpenAL buffers.
class AudioStreamPlayer
Plays back an AudioStream decoded on the fly.
class Barrier
Barrier for thread synchronization.
class BaseSprite
Base class for textured sprites.
class BinaryShaderCache
Caches compiled OpenGL shader programs in binary form on disk.
class BitArray
Dynamically allocated array of bits.
class BitArrayIndex
Proxy referring to a single bit of a BitArray.
template<class T>
class BitSet
Fixed-size sequence of bits backed by an unsigned integer.
class Camera
Provides the projection and view matrices used by shaders.
class Clock
High-resolution monotonic system clock.
class ColorAffector
Affector that animates the color of a particle.
class CondVariable
Condition variable for thread synchronization.
class DisplayMode
Describes the pixel format and buffering properties of a display surface.
class DrawableNode
Base class for scene nodes that can be drawn through the render queue.
template<class K>
class FNV1aHashFunc
Fowler-Noll-Vo (FNV-1a) hash function.
class FrameTimer
Tracks per-frame timing and computes the average FPS and frame time multiplier.
class Geometry
Contains the vertex and index buffer data for a drawable node.
class GfxCapabilities
Stores and retrieves runtime OpenGL device capabilities.
class GLAttribute
Stores information about an active vertex shader attribute.
class GLBlending
Manages the OpenGL blending state.
class GLBufferObject
Wraps an OpenGL buffer object.
class GLBufferObjectMappingFunc
Maps OpenGL buffer object targets to bucket indices.
class GLClearColor
Manages the OpenGL clear color.
class GLCullFace
Manages the OpenGL face culling state.
class GLDebug
Wrapper around OpenGL debug output and object labelling.
class GLDepthTest
Manages the OpenGL depth test state.
class GLFramebuffer
Wraps an OpenGL framebuffer object.
template<std::uint32_t S, class MappingFunc>
class GLHashMap
Naive fixed-size hashmap of OpenGL targets to object ids.
class GLRenderbuffer
Wraps an OpenGL renderbuffer object.
class GLScissorTest
Manages the OpenGL scissor test state.
class GLShader
Wraps an OpenGL shader object.
class GLShaderProgram
Wraps an OpenGL shader program object.
class GLShaderUniformBlocks
Manages the uniform block caches of a shader program.
class GLShaderUniforms
Manages the uniform caches of a shader program.
class GLTexture
Wraps an OpenGL texture object.
class GLTextureMappingFunc
Maps OpenGL texture targets to bucket indices.
class GLUniform
Stores information about an active shader uniform.
class GLUniformBlock
Stores information about an active uniform block.
class GLUniformBlockCache
Caches the contents of a uniform block and uploads it through a buffer object.
class GLUniformCache
Caches the value of a single uniform and uploads it to the shader.
class GLVertexArrayObject
Wraps an OpenGL vertex array object.
class GLVertexFormat
Describes the format of a vertex.
class GLViewport
Manages the OpenGL viewport rectangle.
struct HatState
Bit flags describing the direction of a joystick hat (D-pad).
class I18n
Provides internationalization and translation support.
class IAppEventHandler
Interface for handling nCine application lifecycle and frame events.
class IAudioDevice
Interface for an audio device backend.
class IAudioLoader
Interface for an audio loader.
class IAudioPlayer
Interface for an audio player.
class IAudioReader
Interface for an audio reader.
class IDebugOverlay
Interface for an on-screen debug overlay.
class IGfxCapabilities
Interface to query runtime OpenGL device capabilities.
class IGfxDevice
Represents the interface to the graphics device where everything is rendered.
class IInputEventHandler
Interface for handling input events from keyboard, touch screen, mouse, accelerometer and joysticks.
class IInputManager
Interface for querying input state and dispatching input events.
class ImGuiDebugOverlay
Debug overlay implemented with the ImGui interface.
class ImGuiDrawing
Handles ImGui drawing.
class ITextureLoader
Texture loader interface class.
class IThreadCommand
Thread pool command interface.
class IThreadPool
Thread pool interface.
class JoyAxisEvent
Joystick axis event.
class JoyButtonEvent
Joystick button event.
class JoyConnectionEvent
Joystick connection or disconnection event.
class JoyHatEvent
Joystick hat event.
class JoyMappedAxisEvent
Mapped joystick axis event.
class JoyMappedButtonEvent
Mapped joystick button event.
class JoyMappedState
Current state of a joystick translated through its mapping into unified buttons and axes.
class JoyMapping
Translation layer that maps raw gamepad and joystick inputs to a unified layout.
class JoystickGuid
Parsed 16-byte GUID that identifies a joystick model.
class JoystickState
Current raw state of a joystick.
class KeyboardEvent
Keyboard key event.
class KeyboardState
Current state of the keyboard.
template<class T, class TLock>
class LockedPtr
Pointer wrapper that keeps the object locked for the duration of its existence.
class MainApplication
Main entry point and event loop driver for standard (desktop) applications.
class Material
Contains material data for a drawable node.
class MeshSprite
A scene node representing a mesh with vertices and UVs.
class MouseEvent
Mouse button event.
class MouseState
Current state of the mouse.
class Mutex
Mutex for thread synchronization.
class Object
Base class of all nCine objects.
class Particle
Renders a single particle.
class ParticleAffector
Base class for all particle affectors.
struct ParticleInitializer
Initialization parameters for a batch of emitted particles.
class ParticleSystem
Scene node that emits and simulates a pool of textured particles.
class PositionAffector
Affector that animates the position of a particle.
class RandomGenerator
PCG32 pseudo-random number generator.
class ReadWriteLock
Read/write lock for thread synchronization.
class RectAnimation
Sequence of texture rectangles forming a sprite animation.
class RenderBatcher
Merges compatible render commands into fewer draw calls.
class RenderBuffersManager
Suballocates vertex, index and uniform data from a pool of OpenGL buffer objects.
class RenderCommand
Holds all the state needed to issue a single draw call.
class RenderCommandPool
Pool of reusable render commands.
class RenderDocCapture
In-application integration of the RenderDoc graphics debugger.
class RenderQueue
Sorts and issues the render commands collected during a scene graph visit.
class RenderResources
Creates and holds the OpenGL rendering resources shared by the whole application.
class RenderStatistics
Gathers statistics about the rendering subsystem.
class RenderVaoPool
Pool of reusable Vertex Array Objects.
class RotationAffector
Affector that animates the rotation of a particle.
class SceneNode
Base node of the scene graph transformation hierarchy.
class ScreenViewport
Viewport that renders directly to the screen.
class ScrollEvent
Scroll event (mouse wheel, touchpad gesture, etc.).
class ServiceLocator
Central registry that provides engine services to requesting classes.
class Shader
GPU shader program usable by materials and drawable nodes.
class ShaderState
Binds a custom shader to a drawable node and feeds its uniforms and textures.
class SizeAffector
Affector that animates the scale of a particle.
class Sprite
Scene node that draws a single textured quad.
template<class K, class T, std::uint32_t Capacity, class HashFunc = xxHash32Func<K>>
class StaticHashMap
Statically allocated hashmap with open addressing and leapfrog probing.
template<class K, class T, class HashFunc, std::uint32_t Capacity, bool IsConst>
struct StaticHashMapHelperTraits
Primary template for the StaticHashMapIterator type traits helper.
template<class K, class T, class HashFunc, std::uint32_t Capacity>
struct StaticHashMapHelperTraits<K, T, HashFunc, Capacity, false>
Type traits used by the non-constant StaticHashMapIterator.
template<class K, class T, class HashFunc, std::uint32_t Capacity>
struct StaticHashMapHelperTraits<K, T, HashFunc, Capacity, true>
Type traits used by the constant StaticHashMapIterator.
template<class K, class T, class HashFunc, std::uint32_t Capacity, bool IsConst>
class StaticHashMapIterator
Bidirectional iterator over the elements of a StaticHashMap.
template<typename T>
struct Task
Awaitable result of an asynchronous coroutine operation.
class TextInputEvent
Text input event.
class Texture
Image data uploaded to the GPU and sampled by shaders.
class TextureFormat
OpenGL pixel format of a texture.
class TextureLoaderDds
Texture loader for the DirectDraw Surface (.dds) format.
class TextureLoaderKtx
Texture loader for the Khronos Texture (.ktx) format.
class TextureLoaderPkm
Texture loader for the ETC1 PKM (.pkm) format.
class TextureLoaderPng
Texture loader for the Portable Network Graphics (.png) format.
class TextureLoaderPvr
Texture loader for the PowerVR (.pvr) format.
class TextureLoaderQoi
Texture loader for the Quite OK Image (.qoi) format.
class TextureLoaderRaw
Texture loader that describes an empty raw-format texture.
class Thread
Operating system thread.
class ThreadAffinityMask
CPU affinity mask for a thread.
class ThreadPool
Thread pool.
class Timer
Stopwatch that accumulates elapsed time across start/stop intervals.
class TimeStamp
Wraps a clock counter value representing a point in time or a duration.
class TouchEvent
Screen touch event.
class UwpApplication
Main entry point and handler for UWP (Universal Windows Platform) applications.
class VelocityAffector
Affector that animates the velocity of a particle.
class Viewport
Render target with its own scene root, camera and render queue.
template<class K>
class xxHash32Func
xxHash3 hash function producing a 32-bit value
template<class K>
class xxHash64Func
xxHash3 hash function producing a 64-bit value

Enums

enum class SamplerFilter { Unknown, Nearest, Linear, NearestMipmapNearest, LinearMipmapNearest, NearestMipmapLinear, LinearMipmapLinear }
Texture minification and magnification filtering modes.
enum class SamplerWrapping { Unknown, ClampToEdge, MirroredRepeat, Repeat }
Texture coordinate wrapping modes.
enum class SwizzleChannel { Red, Green, Blue, Alpha, Zero, One }
Source for a sampled texture channel (see Texture::SetSwizzle()).
enum class JoystickGuidType { Unknown, Standard, Default, Hidapi, Xinput }
Well-known joystick GUID layouts.
enum class ButtonName : std::int16_t { Unknown = -1, A = 0, B, X, Y, Back, Guide, Start, LeftStick, RightStick, LeftBumper, RightBumper, Up, Down, Left, Right, Misc1, Paddle1, Paddle2, Paddle3, Paddle4, Touchpad, Count }
Gamepad buttons.
enum class AxisName : std::int16_t { Unknown = -1, LeftX = 0, LeftY, RightX, RightY, LeftTrigger, RightTrigger }
Gamepad axes.
enum class TouchEventType { Down, Up, Move, PointerDown, PointerUp }
Type of a touch event.
enum class MouseButton : short int { Left, Right, Middle, Fourth, Fifth }
Mouse buttons.
enum class Keys { Backspace, Tab, Return, Escape, Space, Quote, Plus, Comma, Minus, Period, Slash, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, Semicolon, LeftBracket, Backslash, RightBracket, Backquote, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, Delete, NumPad0, NumPad1, NumPad2, NumPad3, NumPad4, NumPad5, NumPad6, NumPad7, NumPad8, NumPad9, NumPadPeriod, NumPadDivide, NumPadMultiply, NumPadMinus, NumPadPlus, NumPadEnter, NumPadEquals, Up, Down, Right, Left, Insert, Home, End, PageUp, PageDown, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, NumLock, CapsLock, ScrollLock, RShift, LShift, RCtrl, LCtrl, RAlt, LAlt, RSuper, LSuper, PrintScreen, Pause, Menu, Clear, Exclaim, QuoteDbl, Hash, Dollar, Ampersand, LeftParen, RightParen, Asterisk, Colon, Less, Equals, Greater, Question, At, Caret, Underscore, Mode, Application, Help, SysReq, Power, Undo, World1, World2, SoftLeft, SoftRight, Back, Call, EndCall, Star, Pound, DpadCenter, VolumeUp, VolumeDown, Camera, Sym, Explorer, Envelope, Num, HeadsetHook, Focus, Notification, Search, MediaPlayPause, MediaStop, MediaNext, MediaPrevious, MediaRewind, MediaFastForward, Mute, PictSymbols, SwitchCharset, ButtonA, ButtonB, ButtonC, ButtonX, ButtonY, ButtonZ, ButtonL1, ButtonR1, ButtonL2, ButtonR2, ButtonThumbLeft, ButtonThumbRight, ButtonStart, ButtonSelect, ButtonMode, FunctionKey, MoveHome, MoveEnd, Forward, MediaPlay, MediaPause, MediaClose, MediaEject, MediaRecord, NumPadComma, NumPadLeftParen, NumPadRightParen, VolumeMute, Info, ChannelUp, ChannelDown, ZoomIn, ZoomOut, TV, Window, Guide, DVR, Bookmark, Captions, Settings, TVPower, TVInput, STBPower, STBInput, AVRPower, AVRInput, ProgRed, ProgGreen, ProgYellow, ProgBlue, AppSwitch, Button1, Button2, Button3, Button4, Button5, Button6, Button7, Button8, Button9, Button10, Button11, Button12, Button13, Button14, Button15, Button16, Count, Unknown = Count }
Keyboard key symbols.
enum KeyMod { None = 0x0000, LShift = 0x0001, RShift = 0x0002, LCtrl = 0x0040, RCtrl = 0x0080, LAlt = 0x0100, RAlt = 0x0200, LSuper = 0x0400, RSuper = 0x0800, NumLock = 0x1000, CapsLock = 0x2000, Mode = 0x4000, Sym = 0x8000, Ctrl = (LCtrl | RCtrl), Shift = (LShift | RShift), Alt = (LAlt | RAlt), Super = (LSuper | RSuper), Mask = (Ctrl | Shift | Alt | Super), Count }
Keyboard modifier flags.

Typedefs

using CreateAppEventHandlerDelegate = std::unique_ptr<IAppEventHandler>(*)()
Delegate that creates an instance of IAppEventHandler.
using hash_t = std::uint32_t
32-bit hash value
using hash64_t = std::uint64_t
64-bit hash value
template<class K, class V, class Hash = xxHash64Func<K>, class Eq = phmap::priv::hash_default_eq<K>>
using HashMap = phmap::flat_hash_map<K, V, Hash, Eq>
Generic hash map.
using key_t = GLenum
Key type, an OpenGL target enum.
using value_t = GLuint
Value type, an OpenGL object id.
using NativeArgument = char*
Native argument type, wchar_t* on Windows, otherwise char*.

Functions

auto theApplication() -> Application&
Returns the application instance.
auto lerp(float a, float b, float ratio) -> float
Linearly interpolates between two values by the given ratio.
auto lerp(std::int32_t a, std::int32_t b, float ratio) -> std::int32_t
Linearly interpolates between two integers by the given ratio, rounding the result.
auto lerpByTime(float a, float b, float ratio, float timeMult) -> float
Frame-rate independent interpolation between two values.
auto copyStringFirst(char* dest, std::int32_t destSize, const char* source, std::int32_t count = -1) -> std::int32_t
Copies the beginning of a string into a fixed-size buffer, always null-terminating it.
template<std::size_t size>
auto copyStringFirst(char(&dest)[size], const char* source, std::int32_t count = -1) -> std::int32_t
Copies the beginning of a string into a fixed-size array, deducing its size.
template<std::size_t size>
auto copyStringFirst(char(&dest)[size], Containers::StringView source) -> std::int32_t
Copies the beginning of a string view into a fixed-size array, deducing its size.
auto formatString(char* buffer, std::size_t maxLen, const char* format, ...) -> std::int32_t
Writes a printf-style formatted string into a buffer.
template<std::size_t size, class ... TArg>
auto formatString(char(&dest)[size], const char* format, const TArg&... args) -> std::int32_t
Writes a printf-style formatted string into a fixed-size array, deducing its size.
void u32tos(std::uint32_t value, char* buffer)
Writes an unsigned 32-bit integer to a buffer as a decimal string.
void i32tos(std::int32_t value, char* buffer)
Writes a signed 32-bit integer to a buffer as a decimal string.
void u64tos(std::uint64_t value, char* buffer)
Writes an unsigned 64-bit integer to a buffer as a decimal string.
void i64tos(std::int64_t value, char* buffer)
Writes a signed 64-bit integer to a buffer as a decimal string.
void ftos(double value, char* buffer, std::int32_t bufferSize)
Writes a floating-point value to a buffer as a decimal string.
auto isDigit(char c) -> bool constexpr
Returns true if the character is a decimal digit.
auto stou32(const char* str, std::size_t length) -> std::uint32_t constexpr
Parses up to length leading decimal digits into an unsigned 32-bit integer.
auto stou64(const char* str, std::size_t length) -> std::uint64_t constexpr
Parses up to length leading decimal digits into an unsigned 64-bit integer.
template<class Iter, class Compare>
void sort(Iter begin, Iter end, Compare comp)
Sorts the range in place using the given comparator.
template<class Iter>
void sort(Iter begin, Iter end)
Sorts the range in place into ascending order.
auto halfToFloat(std::uint16_t value) -> float
Converts a 16-bit half-precision value to a single-precision float.
auto floatToHalf(float value) -> std::uint16_t
Converts a single-precision float to a 16-bit half-precision value.
auto parseVersion(Containers::StringView version) -> std::uint64_t constexpr
Packs a dotted version string into a single 64-bit number.
template<class Iterator>
static auto toBase64Url(const Iterator begin, const Iterator end) -> std::string
Encodes the byte range into a URL-safe Base64 string (without padding).
auto crc32(Containers::ArrayView<std::uint8_t> data) -> std::uint32_t
Returns the CRC-32 checksum of the given byte buffer.
auto crc32(IO::Stream& stream) -> std::uint32_t
Returns the CRC-32 checksum of the remaining contents of the given stream.
auto clock() -> Clock&
Returns the shared system clock instance.
auto Random() -> RandomGenerator& noexcept
Returns the shared random number generator instance.
auto theServiceLocator() -> ServiceLocator&
Returns the singleton service locator instance.
auto _(const char* text) -> StringView
Translates text in singular form using the primary translation catalog.
auto _x(StringView context, const char* text) -> StringView
Translates text in singular form using the primary translation catalog and the specified context.
auto _n(const char* singular, const char* plural, std::int32_t n) -> StringView
Translates text in singular or plural form (selected by count n) using the primary translation catalog.
auto _nx(StringView context, const char* singular, const char* plural, std::int32_t n) -> StringView
Translates text in singular or plural form (selected by count n) using the primary translation catalog and the specified context.
template<class ... Args>
auto _f(const char* text, const Args&... args) -> String
Translates and formats text in singular form using the primary translation catalog.
template<class ... Args>
auto _fn(const char* textSingular, const char* textPlural, std::int32_t n, const Args&... args) -> String
Translates and formats text in singular or plural form (selected by count n) using the primary translation catalog.

Variables

const hash_t NullHash
Reserved hash value marking an empty or invalid entry.
const unsigned int StepsInitialSize
Initial capacity reserved for the step array of each affector.

Constants

double Pi constexpr
3.1415... (double)
float fPi constexpr
3.1415...
float fPiOver2 constexpr
3.1415... / 2
float fPiOver3 constexpr
3.1415... / 3
float fPiOver4 constexpr
3.1415... / 4
float fPiOver6 constexpr
3.1415... / 6
float fTwoPi constexpr
3.1415... * 2
double DegToRad constexpr
Multiply to convert degrees to radians (double).
float fDegToRad constexpr
Multiply to convert degrees to radians.
double RadToDeg constexpr
Multiply to convert radians to degrees (double).
float fRadToDeg constexpr
Multiply to convert radians to degrees.
float fRadAngle1 constexpr
1 degree as radians
float fRadAngle30 constexpr
30 degrees as radians
float fRadAngle45 constexpr
45 degrees as radians
float fRadAngle90 constexpr
90 degrees as radians
float fRadAngle180 constexpr
180 degrees as radians
float fRadAngle270 constexpr
270 degrees as radians
float fRadAngle360 constexpr
360 degrees as radians

Enum documentation

enum class nCine::SamplerFilter

Texture minification and magnification filtering modes.

enum class nCine::SamplerWrapping

Texture coordinate wrapping modes.

enum class nCine::SwizzleChannel

Source for a sampled texture channel (see Texture::SetSwizzle()).

enum class nCine::JoystickGuidType

Well-known joystick GUID layouts.

Identifies how the bytes of a JoystickGuid are laid out so they can be parsed accordingly.

enum class nCine::ButtonName : std::int16_t

Gamepad buttons.

Unified button names a mapped joystick can report, regardless of the physical controller layout.

enum class nCine::AxisName : std::int16_t

Gamepad axes.

Unified axis names a mapped joystick can report, regardless of the physical controller layout.

enum class nCine::TouchEventType

Type of a touch event.

Enumerators
Down

The first pointer touched the screen

Up

The last pointer was released

Move

A pointer moved

PointerDown

An additional pointer touched the screen

PointerUp

An additional pointer was released

enum class nCine::MouseButton : short int

Mouse buttons.

enum class nCine::Keys

Keyboard key symbols.

Platform-independent key codes. Not every value is produced by every backend; comments mark values specific to SDL, GLFW or Android.

enum nCine::KeyMod

Keyboard modifier flags.

Bit flags reported in KeyboardEvent::mod. The combined values (Ctrl, Shift, etc.) match either the left or the right modifier.

Typedef documentation

using nCine::CreateAppEventHandlerDelegate = std::unique_ptr<IAppEventHandler>(*)()

Delegate that creates an instance of IAppEventHandler.

Passed to MainApplication::Run() so the engine can instantiate the user's event handler.

using nCine::hash_t = std::uint32_t

32-bit hash value

using nCine::hash64_t = std::uint64_t

64-bit hash value

template<class K, class V, class Hash = xxHash64Func<K>, class Eq = phmap::priv::hash_default_eq<K>>
using nCine::HashMap = phmap::flat_hash_map<K, V, Hash, Eq>

Generic hash map.

Alias for phmap::flat_hash_map from the Parallel Hashmap library, defaulting to the xxHash3 hash function sized to the target architecture.

using nCine::key_t = GLenum

Key type, an OpenGL target enum.

using nCine::value_t = GLuint

Value type, an OpenGL object id.

typedef char* nCine::NativeArgument

Native argument type, wchar_t* on Windows, otherwise char*.

Function documentation

Application& nCine::theApplication()

Returns the application instance.

Returns the singleton application instance.

float nCine::lerp(float a, float b, float ratio)

Linearly interpolates between two values by the given ratio.

std::int32_t nCine::lerp(std::int32_t a, std::int32_t b, float ratio)

Linearly interpolates between two integers by the given ratio, rounding the result.

float nCine::lerpByTime(float a, float b, float ratio, float timeMult)

Frame-rate independent interpolation between two values.

Applies ratio per nominal frame and scales it by timeMult so the result is independent of the actual frame duration.

std::int32_t nCine::copyStringFirst(char* dest, std::int32_t destSize, const char* source, std::int32_t count = -1)

Copies the beginning of a string into a fixed-size buffer, always null-terminating it.

Parameters
dest Destination buffer
destSize Size of the destination buffer in bytes
source Source string
count Maximum number of characters to copy, or -1 to copy the whole source
Returns Number of characters written, excluding the null terminator

template<std::size_t size>
std::int32_t nCine::copyStringFirst(char(&dest)[size], const char* source, std::int32_t count = -1)

Copies the beginning of a string into a fixed-size array, deducing its size.

template<std::size_t size>
std::int32_t nCine::copyStringFirst(char(&dest)[size], Containers::StringView source)

Copies the beginning of a string view into a fixed-size array, deducing its size.

std::int32_t nCine::formatString(char* buffer, std::size_t maxLen, const char* format, ...)

Writes a printf-style formatted string into a buffer.

Returns Number of characters written, excluding the null terminator

template<std::size_t size, class ... TArg>
std::int32_t nCine::formatString(char(&dest)[size], const char* format, const TArg&... args)

Writes a printf-style formatted string into a fixed-size array, deducing its size.

void nCine::u32tos(std::uint32_t value, char* buffer)

Writes an unsigned 32-bit integer to a buffer as a decimal string.

void nCine::i32tos(std::int32_t value, char* buffer)

Writes a signed 32-bit integer to a buffer as a decimal string.

void nCine::u64tos(std::uint64_t value, char* buffer)

Writes an unsigned 64-bit integer to a buffer as a decimal string.

void nCine::i64tos(std::int64_t value, char* buffer)

Writes a signed 64-bit integer to a buffer as a decimal string.

void nCine::ftos(double value, char* buffer, std::int32_t bufferSize)

Writes a floating-point value to a buffer as a decimal string.

bool nCine::isDigit(char c) constexpr

Returns true if the character is a decimal digit.

std::uint32_t nCine::stou32(const char* str, std::size_t length) constexpr

Parses up to length leading decimal digits into an unsigned 32-bit integer.

std::uint64_t nCine::stou64(const char* str, std::size_t length) constexpr

Parses up to length leading decimal digits into an unsigned 64-bit integer.

template<class Iter, class Compare>
void nCine::sort(Iter begin, Iter end, Compare comp)

Sorts the range in place using the given comparator.

template<class Iter>
void nCine::sort(Iter begin, Iter end)

Sorts the range in place into ascending order.

float nCine::halfToFloat(std::uint16_t value)

Converts a 16-bit half-precision value to a single-precision float.

std::uint16_t nCine::floatToHalf(float value)

Converts a single-precision float to a 16-bit half-precision value.

std::uint64_t nCine::parseVersion(Containers::StringView version) constexpr

Packs a dotted version string into a single 64-bit number.

Parses a "major.minor.patch" string into a 64-bit value with the major part in bits 48-63, the minor part in bits 32-47 and the patch part in the low 32 bits. A patch part beginning with 'r' (a Git revision) is encoded with a special maximum value so it always compares as the latest.

template<class Iterator>
static std::string nCine::toBase64Url(const Iterator begin, const Iterator end)

Encodes the byte range into a URL-safe Base64 string (without padding).

std::uint32_t nCine::crc32(Containers::ArrayView<std::uint8_t> data)

Returns the CRC-32 checksum of the given byte buffer.

std::uint32_t nCine::crc32(IO::Stream& stream)

Returns the CRC-32 checksum of the remaining contents of the given stream.

Clock& nCine::clock()

Returns the shared system clock instance.

RandomGenerator& nCine::Random() noexcept

Returns the shared random number generator instance.

ServiceLocator& nCine::theServiceLocator()

Returns the singleton service locator instance.

Variable documentation

const hash_t nCine::NullHash

Reserved hash value marking an empty or invalid entry.

const unsigned int nCine::StepsInitialSize

Initial capacity reserved for the step array of each affector.

double nCine::Pi constexpr

3.1415... (double)

float nCine::fPi constexpr

3.1415...

float nCine::fPiOver2 constexpr

3.1415... / 2

float nCine::fPiOver3 constexpr

3.1415... / 3

float nCine::fPiOver4 constexpr

3.1415... / 4

float nCine::fPiOver6 constexpr

3.1415... / 6

float nCine::fTwoPi constexpr

3.1415... * 2

double nCine::DegToRad constexpr

Multiply to convert degrees to radians (double).

float nCine::fDegToRad constexpr

Multiply to convert degrees to radians.

double nCine::RadToDeg constexpr

Multiply to convert radians to degrees (double).

float nCine::fRadToDeg constexpr

Multiply to convert radians to degrees.

float nCine::fRadAngle1 constexpr

1 degree as radians

float nCine::fRadAngle30 constexpr

30 degrees as radians

float nCine::fRadAngle45 constexpr

45 degrees as radians

float nCine::fRadAngle90 constexpr

90 degrees as radians

float nCine::fRadAngle180 constexpr

180 degrees as radians

float nCine::fRadAngle270 constexpr

270 degrees as radians

float nCine::fRadAngle360 constexpr

360 degrees as radians