API Functions

ARGB32

(r: int, g: int, b: int) -> int
(r: int, g: int, b: int, a: int) -> int

Create a 32 bit integer ARGB color.

ARGB32ToRGBA32

(argb: int) -> int

Convert a 32 bit integer ARGB color to RGBA.

Abs

(v: Vec4) -> Vec4
(v: Vec3) -> Vec3
(v: float) -> float
(v: int) -> int

Return the absolute value of the function input. For vectors, the absolute value is applied to each component individually and the resulting vector is returned.

AddAssetsFolder

(path: str) -> bool

Mount a local filesystem folder as an assets source.

See Resources & Assets.

AddAssetsPackage

(path: str) -> bool

Mount an archive stored on the local filesystem as an assets source.

See Resources & Assets.

AlphaScale

(color: Color, k: float) -> Color

Scale the alpha component of the input color.

ApplyBloom

(view_id: int, rect: IntRect, input: Texture, output: FrameBufferHandle, bloom: Bloom, threshold: float, smoothness: float, intensity: float) -> int

Process input texture and generate a bloom overlay on top of output, input and output must be of the same size.

Use CreateBloomFromFile/CreateBloomFromAssets to create a Bloom object and DestroyBloom to destroy its internal resources after usage.

AudioInit

() -> bool

Initialize the audio system.

AudioShutdown

() -> None

Shutdown the audio system.

BaseToEuler

(z: Vec3) -> Vec3
(z: Vec3, y: Vec3) -> Vec3

Compute the Euler angles triplet for the provided z direction. The up-vector y can be provided to improve coherency of the returned values over time.

BeginProfilerSection

(name: str) -> int
(name: str, section_details: str) -> int

Begin a named profiler section. Call EndProfilerSection to end the section.

CaptureProfilerFrame

() -> ProfilerFrame

Capture the current profiler frame but do not end it. See EndProfilerFrame to capture and end the current profiler frame.

See PrintProfilerFrame to print a profiler frame to the console.

CaptureTexture

(view_id: int, resources: PipelineResources, tex: TextureRef, read_back: Texture, pic: Picture) -> int, int

Capture a texture content to a Picture. Return the frame counter at which the capture will be complete.

A Picture object can be accessed by the CPU.

This function is asynchronous and its result will not be available until the returned frame counter is equal or greater to the frame counter returned by Frame.

Cast_Pipeline_To_ForwardPipeline

(o: Pipeline) -> ForwardPipeline

Ceil

(v: Vec3) -> Vec3

Returns a vector whose elements are equal to the nearest integer greater than or equal to the vector elements.

ChromaScale

(color: Color, k: float) -> Color

Return a copy of the color with its saturation scaled as specified.

Clamp

(v: Vec3, min: float, max: float) -> Vec3
(v: Vec3, min: Vec3, max: Vec3) -> Vec3
(v: float, min: float, max: float) -> float
(v: int, min: int, max: int) -> int
(color: Color, min: float, max: float) -> Color
(color: Color, min: Color, max: Color) -> Color

Return a vector whose elements are equal to the vector elements clipped to the specified interval.

ClampLen

(v: Vec3, min: float, max: float) -> Vec3

Returns a vector in the same direction as the specified vector, but with its length clipped by the specified interval.

ClassifyLine

(minmax: MinMax, position: Vec3, direction: Vec3) -> bool, Vec3, Vec3

Return true if the provided line intersect the bounding volume, false otherwise.

ClassifySegment

(minmax: MinMax, p0: Vec3, p1: Vec3) -> bool, Vec3, Vec3

Return true if the provided segment intersect the bounding volume, false otherwise.

CleanPath

(path: str) -> str

Cleanup a local filesystem path according to the host platform conventions.

  • Remove redundant folder separators.
  • Remove redundant . and .. folder entries.
  • Ensure forward slash (/) folder separators on Unix and back slash (\) folder separators on Windows.

ClipSpaceToScreenSpace

(clip: Vec3, resolution: Vec2) -> Vec3

Convert a 3d position in clip space (homogeneous space) to a 2d position on screen.

Close

(file: File) -> bool

Close a file handle.

Cm

(cm: float) -> float

Convert a value in centimeters to the Harfang internal unit system.

See Coordinates and Units System.

ColorFromABGR32

(rgba32: int) -> Color

Create a color from a 32 bit ABGR integer.

ColorFromRGBA32

(rgba32: int) -> Color

Create a color from a 32 bit RGBA integer.

ColorFromVector3

(v: Vec3) -> Color

Create a color from a 3d vector, alpha defaults to 1.

ColorFromVector4

(v: Vec4) -> Color

Return a 4-dimensional vector as a color.

ColorI

(r: int, g: int, b: int) -> Color
(r: int, g: int, b: int, a: int) -> Color

Create a color from integer values in the [0;255] range.

ColorToABGR32

(color: Color) -> int

Return a 32 bit ABGR integer from a color.

ColorToGrayscale

(color: Color) -> float

Return the grayscale representation of a color. A weighted average is used to account for human perception of colors.

ColorToRGBA32

(color: Color) -> int

Return a 32 bit RGBA integer from a color.

Compute2DProjectionMatrix

(znear: float, zfar: float, res_x: float, res_y: float, y_up: bool) -> Mat44

Returns a projection matrix from a 2D space to the 3D world, as required by SetViewTransform for example.

ComputeAspectRatioX

(width: float, height: float) -> Vec2

Compute the aspect ratio factor for the provided viewport dimensions. Use this method to compute aspect ratio for landscape display.

See ComputeAspectRatioY.

ComputeAspectRatioY

(width: float, height: float) -> Vec2

Compute the aspect ratio factor for the provided viewport dimensions. Use this method to compute aspect ratio for portrait display.

See ComputeAspectRatioX.

ComputeMinMaxBoundingSphere

(minmax: MinMax) -> Vec3, float

Compute the bounding sphere for the provided axis-aligned bounding box.

ComputeOrthographicProjectionMatrix

(znear: float, zfar: float, size: float, aspect_ratio: Vec2) -> Mat44
(znear: float, zfar: float, size: float, aspect_ratio: Vec2, offset: Vec2) -> Mat44

Compute an orthographic projection matrix.

An orthographic projection has no perspective and all lines parrallel in 3d space will still appear parrallel on screen after projection using the returned matrix.

The size parameter controls the extends of the projected view. When projecting a 3d world this parameter is expressed in meters. Use the aspect_ratio parameter to prevent distortion from induced by non-square viewport.

See ComputeAspectRatioX or ComputeAspectRatioY to compute an aspect ratio factor in paysage or portrait mode.

ComputeOrthographicViewState

(world: Mat4, size: float, znear: float, zfar: float, aspect_ratio: Vec2) -> ViewState

Compute an orthographic view state.

The size parameter controls the extends of the projected view. When projecting a 3d world this parameter is expressed in meters. Use the aspect_ratio parameter to prevent distortion from induced by non-square viewport.

See ComputeOrthographicProjectionMatrix, ComputeAspectRatioX and ComputeAspectRatioY.

ComputePerspectiveProjectionMatrix

(znear: float, zfar: float, zoom_factor: float, aspect_ratio: Vec2) -> Mat44
(znear: float, zfar: float, zoom_factor: float, aspect_ratio: Vec2, offset: Vec2) -> Mat44

Compute a perspective projection matrix, , fov is the field of view angle, see Deg and Rad.

See ZoomFactorToFov, FovToZoomFactor, ComputeAspectRatioX and ComputeAspectRatioY.

ComputePerspectiveViewState

(world: Mat4, fov: float, znear: float, zfar: float, aspect_ratio: Vec2) -> ViewState

Compute a perspective view state.

See ComputePerspectiveProjectionMatrix, ZoomFactorToFov, FovToZoomFactor, ComputeAspectRatioX and ComputeAspectRatioY.

ComputeRenderState

(blend: BlendMode) -> RenderState
(blend: BlendMode, depth_test: DepthTest) -> RenderState
(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling) -> RenderState
(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool) -> RenderState
(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool) -> RenderState
(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool, write_g: bool) -> RenderState
(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool, write_g: bool, write_b: bool) -> RenderState
(blend: BlendMode, depth_test: DepthTest, culling: FaceCulling, write_z: bool, write_r: bool, write_g: bool, write_b: bool, write_a: bool) -> RenderState
(blend: BlendMode, write_z: bool) -> RenderState
(blend: BlendMode, write_z: bool, write_r: bool) -> RenderState
(blend: BlendMode, write_z: bool, write_r: bool, write_g: bool) -> RenderState
(blend: BlendMode, write_z: bool, write_r: bool, write_g: bool, write_b: bool) -> RenderState
(blend: BlendMode, write_z: bool, write_r: bool, write_g: bool, write_b: bool, write_a: bool) -> RenderState

Compute a render state to control subsequent render calls culling mode, blending mode, Z mask, etc… The same render state can be used by different render calls.

See DrawLines, DrawTriangles and DrawModel.

ComputeSAO

(view_id: int, rect: IntRect, attr0: Texture, attr1: Texture, noise: Texture, output: FrameBufferHandle, sao: SAO, projection: Mat44, bias: float, radius: float, sample_count: int, sharpness: float) -> None

ComputeSortKey

(view_depth: float) -> int

Compute a sorting key to control the rendering order of a display list, view_depth is expected in view space.

ComputeSortKeyFromWorld

(T: Vec3, view: Mat4) -> int
(T: Vec3, view: Mat4, model: Mat4) -> int

Compute a sorting key to control the rendering order of a display list.

ComputeTextHeight

(font: Font, text: str) -> float

Compute the height of a text string.

ComputeTextRect

(font: Font, text: str) -> Rect
(font: Font, text: str, xpos: float) -> Rect
(font: Font, text: str, xpos: float, ypos: float) -> Rect

Compute the width and height of a text string.

Contains

(minmax: MinMax, position: Vec3) -> bool

Return true if the provided position is inside the bounding volume, false otherwise.

CopyDir

(src: str, dst: str) -> bool

Copy a directory on the local filesystem, this function does not recurse through subdirectories.

See CopyDirRecursive.

CopyDirRecursive

(src: str, dst: str) -> bool

Copy a directory on the local filesystem, recurse through subdirectories.

CopyFile

(src: str, dst: str) -> bool

Copy a file on the local filesystem.

CosineInterpolate

(y0: float, y1: float, t: float) -> float

Compute the cosine interpolated value between y0 and y1 at t.

See LinearInterpolate, CubicInterpolate and HermiteInterpolate.

CreateBloomFromAssets

(path: str, ratio: BackbufferRatio) -> Bloom

CreateBloomFromFile

(path: str, ratio: BackbufferRatio) -> Bloom

CreateCamera

(scene: Scene, mtx: Mat4, znear: float, zfar: float) -> Node
(scene: Scene, mtx: Mat4, znear: float, zfar: float, fov: float) -> Node

Create a new Node with a Transform and Camera components.

CreateCapsuleModel

(decl: VertexLayout, radius: float, height: float, subdiv_x: int, subdiv_y: int) -> Model

Create a capsule render model.

See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.

CreateConeModel

(decl: VertexLayout, radius: float, height: float, subdiv_x: int) -> Model

Create a cone render model.

See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.

CreateCubeModel

(decl: VertexLayout, x: float, y: float, z: float) -> Model

Create a cube render model.

See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.

CreateCylinderModel

(decl: VertexLayout, radius: float, height: float, subdiv_x: int) -> Model

Create a cylinder render model.

See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.

CreateForwardPipeline

() -> ForwardPipeline
(shadow_map_resolution: int) -> ForwardPipeline
(shadow_map_resolution: int, spot_16bit_shadow_map: bool) -> ForwardPipeline

Create a forward pipeline and its resources.

See DestroyForwardPipeline.

CreateForwardPipelineAAAFromAssets

(path: str, config: ForwardPipelineAAAConfig) -> ForwardPipelineAAA
(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio) -> ForwardPipelineAAA
(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio, ssr_ratio: BackbufferRatio) -> ForwardPipelineAAA

CreateForwardPipelineAAAFromFile

(path: str, config: ForwardPipelineAAAConfig) -> ForwardPipelineAAA
(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio) -> ForwardPipelineAAA
(path: str, config: ForwardPipelineAAAConfig, ssgi_ratio: BackbufferRatio, ssr_ratio: BackbufferRatio) -> ForwardPipelineAAA

CreateFrameBuffer

(color: Texture, depth: Texture, name: str) -> FrameBuffer
(color_format: TextureFormat, depth_format: TextureFormat, aa: int, name: str) -> FrameBuffer
(width: int, height: int, color_format: TextureFormat, depth_format: TextureFormat, aa: int, name: str) -> FrameBuffer

Create a framebuffer and its texture attachments.

See DestroyFrameBuffer.

CreateInstanceFromAssets

(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo) -> Node, bool
(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> Node, bool

Helper function to create a Node with a Transform and an Instance component.

The instance component will be setup and its resources loaded from the assets system.

See Resources & Assets.

CreateInstanceFromFile

(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo) -> Node, bool
(scene: Scene, mtx: Mat4, name: str, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> Node, bool

Helper function to create a Node with a Transform and an Instance component.

The instance component will be setup and its resources loaded from the local filesystem.

See Resources & Assets.

CreateLinearLight

(scene: Scene, mtx: Mat4) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, specular: Color) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, specular: Color, priority: float) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType, shadow_bias: float, pssm_split: Vec4) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, diffuse_intensity: float) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, diffuse_intensity: float, specular: Color) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType) -> Node
(scene: Scene, mtx: Mat4, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType, shadow_bias: float, pssm_split: Vec4) -> Node

Helper function to create a Node with a Transform and a Light component.

CreateMaterial

(prg: PipelineProgramRef) -> Material
(prg: PipelineProgramRef, value_name: str, value: Vec4) -> Material
(prg: PipelineProgramRef, value_name_0: str, value_0: Vec4, value_name_1: str, value_1: Vec4) -> Material

Helper function to create a material.

See SetMaterialProgram, SetMaterialValue and SetMaterialTexture.

CreateMissingMaterialProgramValuesFromAssets

(mat: Material, resources: PipelineResources) -> None

This function scans the material program uniforms and creates a corresponding entry in the material if missing.

Resources are loaded from the asset system if a default uniform value requires it.

See Resources & Assets.

CreateMissingMaterialProgramValuesFromFile

(mat: Material, resources: PipelineResources) -> None

This function scans the material program uniforms and creates a corresponding entry in the material if missing.

Resources are loaded from the local filesystem if a default uniform value requires it.

CreateObject

(scene: Scene, mtx: Mat4, model: ModelRef, materials: MaterialList) -> Node

Create a Node with a Transform and Object components.

CreateOrthographicCamera

(scene: Scene, mtx: Mat4, znear: float, zfar: float) -> Node
(scene: Scene, mtx: Mat4, znear: float, zfar: float, size: float) -> Node

Create a Node with a Transform and a Camera component.

CreatePhysicCube

(scene: Scene, size: Vec3, mtx: Mat4, model_ref: ModelRef, materials: MaterialList) -> Node
(scene: Scene, size: Vec3, mtx: Mat4, model_ref: ModelRef, materials: MaterialList, mass: float) -> Node

Create a Node with a Transform, Object and RigidBody components.

CreatePhysicSphere

(scene: Scene, radius: float, mtx: Mat4, model_ref: ModelRef, materials: MaterialList) -> Node
(scene: Scene, radius: float, mtx: Mat4, model_ref: ModelRef, materials: MaterialList, mass: float) -> Node

Create a Node with a Transform, Object and RigidBody components.

CreatePlaneModel

(decl: VertexLayout, width: float, length: float, subdiv_x: int, subdiv_z: int) -> Model

Create a plane render model.

CreatePointLight

(scene: Scene, mtx: Mat4, radius: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color, priority: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType, shadow_bias: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType) -> Node
(scene: Scene, mtx: Mat4, radius: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType, shadow_bias: float) -> Node

Create a Node with a Transform and a Light component.

CreateSAOFromAssets

(path: str, ratio: BackbufferRatio) -> SAO

CreateSAOFromFile

(path: str, ratio: BackbufferRatio) -> SAO

CreateSceneRootNode

(scene: Scene, name: str, mtx: Mat4) -> Node

Helper function to create a Node with a Transform component then parent all root nodes in the scene to it.

CreateScript

(scene: Scene) -> Node
(scene: Scene, path: str) -> Node

Helper function to create a Node with a Script component.

CreateSphereModel

(decl: VertexLayout, radius: float, subdiv_x: int, subdiv_y: int) -> Model

Create a sphere render model.

See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.

CreateSpotLight

(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, specular: Color) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, specular: Color, priority: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, specular: Color, priority: float, shadow_type: LightShadowType, shadow_bias: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, diffuse_intensity: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, diffuse_intensity: float, specular: Color) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType) -> Node
(scene: Scene, mtx: Mat4, radius: float, inner_angle: float, outer_angle: float, diffuse: Color, diffuse_intensity: float, specular: Color, specular_intensity: float, priority: float, shadow_type: LightShadowType, shadow_bias: float) -> Node

Create a Node with a Transform and a Light component.

CreateTexture

(width: int, height: int, name: str, flags: TextureFlags) -> Texture
(width: int, height: int, name: str, flags: TextureFlags, format: TextureFormat) -> Texture

Create an empty texture.

See CreateTextureFromPicture and UpdateTextureFromPicture.

CreateTextureFromPicture

(pic: Picture, name: str, flags: TextureFlags) -> Texture
(pic: Picture, name: str, flags: TextureFlags, format: TextureFormat) -> Texture

Create a texture from a picture.

See Picture, CreateTexture and UpdateTextureFromPicture.

Crop

(rect: Rect, left: float, top: float, right: float, bottom: float) -> Rect
(rect: IntRect, left: int, top: int, right: int, bottom: int) -> IntRect

Crop a rectangle. Remove the specified amount of units on each side of the rectangle.

See Grow.

Cross

(a: Vec3, b: Vec3) -> Vec3

Return the cross product of two vectors.

CrossProductMat3

(V: Vec3) -> Mat3

Creates a matrix M so that Mv = p⨯v.

Simply put, multiplying this matrix to any vector v is equivalent to compute the cross product between p and v.

CubicInterpolate

(y0: float, y1: float, y2: float, y3: float, t: float) -> float
(v0: Vec3, v1: Vec3, v2: Vec3, v3: Vec3, t: float) -> Vec3

Perform a cubic interpolation across four values with t in the [0;1] range between y1 and y2.

See LinearInterpolate, CosineInterpolate and HermiteInterpolate.

CutFileExtension

(path: str) -> str

Return a file path with its extension stripped.

See CutFilePath and CutFileName.

CutFileName

(path: str) -> str

Return the name part of a file path. All folder navigation and extension are stripped.

See CutFileExtension and CutFilePath.

CutFilePath

(path: str) -> str

Return the folder navigation part of a file path. The file name and its extension are stripped.

See CutFileExtension and CutFileName.

Debug

(msg: str) -> None
(msg: str, details: str) -> None

DebugSceneExplorer

(scene: Scene, name: str) -> None

Decompose

(m: Mat4) -> Vec3, Vec3, Vec3
(m: Mat4, rotation_order: RotationOrder) -> Vec3, Vec3, Vec3

Decompose a transformation matrix into its translation, scaling and rotation components.

Deg

(degrees: float) -> float

Convert an angle in degrees to the engine unit system.

See Coordinates and Units System.

Deg3

(x: float, y: float, z: float) -> Vec3

Convert a triplet of angles in degrees to the engine unit system.

See Coordinates and Units System.

DegreeToRadian

(degrees: float) -> float

Convert an angle in degrees to radians.

DestroyBloom

(bloom: Bloom) -> None

Destroy a bloom post process object and all associated resources.

DestroyForwardPipeline

(pipeline: ForwardPipeline) -> None

Destroy a forward pipeline object.

DestroyForwardPipelineAAA

(pipeline: ForwardPipelineAAA) -> None

DestroyFrameBuffer

(frameBuffer: FrameBuffer) -> None

Destroy a frame buffer and its resources.

DestroyProgram

(h: ProgramHandle) -> None

Destroy a shader program.

DestroySAO

(sao: SAO) -> None

Destroy an ambient occlusion post process object and its resources.

DestroyTexture

(tex: Texture) -> None

Destroy a texture object.

DestroyWindow

(window: Window) -> bool

Destroy a window object.

Det

(m: Mat3) -> float

Return the determinant of a matrix.

DisableCursor

() -> None

Dist

(a: Vec2, b: Vec2) -> float
(a: iVec2, b: iVec2) -> int
(a: Quaternion, b: Quaternion) -> float
(a: Vec3, b: Vec3) -> float

Return the Euclidean distance between two vectors.

Dist2

(a: Vec2, b: Vec2) -> float
(a: iVec2, b: iVec2) -> int
(a: Vec3, b: Vec3) -> float

Return the squared Euclidean distance between two vectors.

DistanceToPlane

(plane: Vec4, p: Vec3) -> float

Return the signed distance from point p to a plane.

  • Distance is positive if p is in front of the plane, meaning that the plane normal is pointing towards p.
  • Distance is negative if p is behind the plane, meaning that the plane normal is pointing away from p.
  • Distance is 0.0 if p is lying on the plane.

Dot

(a: Vec2, b: Vec2) -> float
(a: iVec2, b: iVec2) -> int
(a: Vec3, b: Vec3) -> float

Return the dot product of two vectors.

DrawLines

(view_id: int, vtx: Vertices, prg: ProgramHandle) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, render_state: RenderState) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, render_state: RenderState, depth: int) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState, depth: int) -> None
(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState) -> None
(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, render_state: RenderState, depth: int) -> None

Draw a list of lines to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DrawModel

(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrix: Mat4) -> None
(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrix: Mat4, render_state: RenderState) -> None
(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrix: Mat4, render_state: RenderState, depth: int) -> None
(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrices: Mat4List) -> None
(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrices: Mat4List, render_state: RenderState) -> None
(view_id: int, mdl: Model, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, matrices: Mat4List, render_state: RenderState, depth: int) -> None

Draw a model to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DrawSprites

(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle) -> None
(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, state: RenderState) -> None
(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, state: RenderState, depth: int) -> None
(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
(view_id: int, inv_view_R: Mat3, vtx_layout: VertexLayout, pos: Vec3List, size: Vec2, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None

Draw a list of sprites to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

Note: This function prepares the sprite on the CPU before submitting them all to the GPU as a single draw call.

DrawText

(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4) -> None
(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3) -> None
(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign) -> None
(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign, values: UniformSetValueList, textures: UniformSetTextureList) -> None
(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
(view_id: int, font: Font, text: str, prg: ProgramHandle, page_uniform: str, page_stage: int, mtx: Mat4, pos: Vec3, halign: DrawTextHAlign, valign: DrawTextVAlign, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None

Write text to the specified view using the provided shader program and uniform values.

DrawTriangles

(view_id: int, vtx: Vertices, prg: ProgramHandle) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, state: RenderState) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, state: RenderState, depth: int) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
(view_id: int, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None
(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList) -> None
(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState) -> None
(view_id: int, idx: UInt16List, vtx: Vertices, prg: ProgramHandle, values: UniformSetValueList, textures: UniformSetTextureList, state: RenderState, depth: int) -> None

Draw a list of triangles to the specified view.

Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.

DuplicateNodeAndChildrenFromAssets

(scene: Scene, node: Node, resources: PipelineResources, pipeline: PipelineInfo) -> NodeList

Duplicate a node and its child hierarchy. Resources will be loaded from the assets system.

See Resources & Assets.

DuplicateNodeAndChildrenFromFile

(scene: Scene, node: Node, resources: PipelineResources, pipeline: PipelineInfo) -> NodeList

Duplicate a node and its child hierarchy. Resources will be loaded from the local filesystem.

See Resources & Assets.

DuplicateNodeFromAssets

(scene: Scene, node: Node, resources: PipelineResources, pipeline: PipelineInfo) -> Node

Duplicate a node. Resources will be loaded from the assets system.

See Resources & Assets.

DuplicateNodeFromFile

(scene: Scene, node: Node, resources: PipelineResources, pipeline: PipelineInfo) -> Node

Duplicate a node. Resources will be loaded from the local filesystem.

See Resources & Assets.

DuplicateNodesAndChildrenFromAssets

(scene: Scene, nodes: NodeList, resources: PipelineResources, pipeline: PipelineInfo) -> NodeList

Duplicate each node and children hierarchy of a list. Resources will be loaded from the assets system.

See Resources & Assets.

DuplicateNodesAndChildrenFromFile

(scene: Scene, nodes: NodeList, resources: PipelineResources, pipeline: PipelineInfo) -> NodeList

Duplicate each node and children hierarchy of a list. Resources will be loaded from the local filesystem.

See Resources & Assets.

DuplicateNodesFromAssets

(scene: Scene, nodes: NodeList, resources: PipelineResources, pipeline: PipelineInfo) -> NodeList

Duplicate each node of a list. Resources will be loaded from the assets system.

DuplicateNodesFromFile

(scene: Scene, nodes: NodeList, resources: PipelineResources, pipeline: PipelineInfo) -> NodeList

Duplicate each node of a list. Resources will be loaded from the local filesystem.

See Resources & Assets.

EndProfilerFrame

() -> ProfilerFrame

End a profiler frame and return it.

See PrintProfilerFrame to print a profiler frame to the console.

EndProfilerSection

(section_idx: int) -> None

End a named profiler section. Call BeginProfilerSection to begin a new section.

Error

(msg: str) -> None
(msg: str, details: str) -> None

Exists

(path: str) -> bool

Return true if a file exists on the local filesystem, false otherwise.

ExtractZRangeFromOrthographicProjectionMatrix

(m: Mat44) -> float, float

ExtractZRangeFromPerspectiveProjectionMatrix

(m: Mat44) -> float, float

ExtractZRangeFromProjectionMatrix

(m: Mat44) -> float, float

Extract z near and z far clipping range from a projection matrix.

ExtractZoomFactorFromProjectionMatrix

(m: Mat44, aspect_ratio: Vec2) -> float

Extract zoom factor from a projection matrix.

See ZoomFactorToFov.

FRRand

() -> float
(range_start: float) -> float
(range_start: float, range_end: float) -> float

Return a random floating point value in the provided range, default range is [-1;1].

FRand

() -> float
(range: float) -> float

Return a random floating point value in the provided range, default range is [0;1].

See Rand to generate a random integer value.

FaceForward

(v: Vec3, d: Vec3) -> Vec3

Return the provided vector facing toward the provided direction. If the angle between v and d is less than 90° then v is returned unchanged, v will be returned reversed otherwise.

FactorizePath

(path: str) -> str

Return the input path with all redundant navigation entries stripped (folder separator, .. and . entries).

FileToString

(path: str) -> str

Return the content of a local filesystem as a string.

FitsInside

(a: Rect, b: Rect) -> bool
(a: IntRect, b: IntRect) -> bool

Return wether a fits in b.

Floor

(v: Vec3) -> Vec3

Returns a vector whose elements are equal to the nearest integer less than or equal to the vector elements.

FovToZoomFactor

(fov: float) -> float

Convert from a fov value in radian to a zoom factor value in meters.

FpsController

(key_up: bool, key_down: bool, key_left: bool, key_right: bool, btn: bool, dx: float, dy: float, pos: Vec3, rot: Vec3, speed: float, dt_t: int) -> None
(keyboard: Keyboard, mouse: Mouse, pos: Vec3, rot: Vec3, speed: float, dt: int) -> None

Implement a first-person-shooter like controller.

The input position and rotation parameters are returned modified according to the state of the control keys.

This function is usually used by passing the current camera position and rotation then updating the camera transformation with the returned values.

Frame

() -> int

Advance the rendering backend to the next frame, execute all queued rendering commands. This function returns the backend current frame.

The frame counter is used by asynchronous functions such as CaptureTexture. You must wait for the frame counter to reach or exceed the value returned by an asynchronous function before accessing its result.

FromHLS

(color: Color) -> Color

Convert input hue/luminance/saturation color to RGBA, alpha channel is left unmodified.

GaussianBlurIsoSurface

(surface: IsoSurface, width: int, height: int, depth: int) -> IsoSurface

Apply a Gaussian blur to an iso-surface.

GetArea

(minmax: MinMax) -> float

Return the area of the volume.

GetCenter

(minmax: MinMax) -> Vec3

Return the center position of the volume.

GetClock

() -> int

Return the current clock since the last call to TickClock or ResetClock.

See time_to_sec_f to convert the returned time to second.

GetClockDt

() -> int

Return the elapsed time recorded during the last call to TickClock.

GetColorTexture

(frameBuffer: FrameBuffer) -> Texture

Retrieves color texture attachment.

GetColumn

(m: Mat3, n: int) -> Vec3
(m: Mat4, n: int) -> Vec3
(m: Mat44, idx: int) -> Vec4

Returns the nth column.

GetCurrentWorkingDirectory

() -> str

Return the system current working directory.

GetDepthTexture

(frameBuffer: FrameBuffer) -> Texture

Retrieves depth texture attachment.

GetFileExtension

(path: str) -> str

Return the extension part of a file path.

GetFileName

(path: str) -> str

Return the name part of a file path (including its extension).

GetFilePath

(path: str) -> str

Return the path part of a file path (excluding file name and extension).

GetForwardPipelineInfo

() -> PipelineInfo

Return the pipeline info object for the forward pipeline.

GetGamepadNames

() -> StringList

Return a list of names for all supported gamepad devices on the system.

See ReadGamepad.

GetHandJointAngularVelocity

(hand: HandsSide, handJoint: XrHandJoint) -> Vec3

GetHandJointLinearVelocity

(hand: HandsSide, handJoint: XrHandJoint) -> Vec3

GetHandJointPose

(hand: HandsSide, handJoint: XrHandJoint) -> Mat4

GetHandJointRadius

(hand: HandsSide, handJoint: XrHandJoint) -> float

GetHeight

(rect: Rect) -> float
(rect: IntRect) -> int

Return the height of a rectangle.

GetJoystickDeviceNames

() -> StringList

GetJoystickNames

() -> StringList

GetJsonBool

(js: JSON, key: str) -> bool, bool

Return the value of a boolean JSON key.

GetJsonFloat

(js: JSON, key: str) -> bool, float

Return the value of a float JSON key.

GetJsonInt

(js: JSON, key: str) -> bool, int

Return the value of an integer JSON key.

GetJsonString

(js: JSON, key: str) -> bool, str

Return the value of a string JSON key.

GetKeyName

(key: Key) -> str
(key: Key, name: str) -> str

Return the name for a keyboard key.

GetKeyboardNames

() -> StringList

Return a list of names for all supported keyboard devices on the system.

See ReadKeyboard.

GetMaterialAlphaCut

(mat: Material) -> bool

GetMaterialAmbientUsesUV1

(mat: Material) -> bool

GetMaterialBlendMode

(mat: Material) -> BlendMode

Return a material blending mode.

GetMaterialDepthTest

(mat: Material) -> DepthTest

Return a material depth test function.

GetMaterialDiffuseUsesUV1

(mat: Material) -> bool

GetMaterialFaceCulling

(mat: Material) -> FaceCulling

Return a material culling mode.

GetMaterialNormalMapInWorldSpace

(mat: Material) -> bool

GetMaterialSkinning

(mat: Material) -> bool

GetMaterialSpecularUsesUV1

(mat: Material) -> bool

GetMaterialTexture

(mat: Material, name: str) -> TextureRef

Return the texture reference assigned to a material named uniform.

GetMaterialTextures

(mat: Material) -> StringList

Return the list of names of a material texture uniforms.

GetMaterialValues

(mat: Material) -> StringList

Return the list of names of a material value uniforms.

GetMaterialWriteRGBA

(mat: Material) -> bool, bool, bool, bool

Return the material color mask.

GetMaterialWriteZ

(mat: Material) -> bool

Return the material depth write mask.

GetMonitorModes

(monitor: Monitor) -> bool, MonitorModeList

Return the list of supported monitor modes.

GetMonitorName

(monitor: Monitor) -> str

Return the monitor name.

GetMonitorRect

(monitor: Monitor) -> IntRect

Returns a rectangle going from the position, in screen coordinates, of the upper-left corner of the specified monitor to the position of the lower-right corner.

GetMonitorSizeMM

(monitor: Monitor) -> iVec2

Returns the size, in millimetres, of the display area of the specified monitor.

GetMonitors

() -> MonitorList

Return a list of monitors connected to the system.

GetMouseNames

() -> StringList

Return a list of names for all supported mouse devices on the system.

See ReadKeyboard.

GetNodePairContacts

(first: Node, second: Node, node_pair_contacts: NodePairContacts) -> ContactList

GetNodesInContact

(scene: Scene, with: Node, node_pair_contacts: NodePairContacts) -> NodeList

GetR

(m: Mat4) -> Vec3
(m: Mat4, rotation_order: RotationOrder) -> Vec3

See GetRotation.

GetRMatrix

(m: Mat4) -> Mat3

See GetRotationMatrix.

GetRotation

(m: Mat4) -> Vec3
(m: Mat4, rotation_order: RotationOrder) -> Vec3

Return the rotation component of a transformation matrix as a Euler triplet.

GetRotationMatrix

(m: Mat4) -> Mat3

Return the rotation component of a transformation matrix as a Mat3 rotation matrix.

GetRow

(m: Mat3, n: int) -> Vec3
(m: Mat4, n: int) -> Vec4
(m: Mat44, idx: int) -> Vec4

Returns the nth row of a matrix.

GetS

(m: Mat4) -> Vec3

See GetScale.

GetScale

(m: Mat3) -> Vec3
(m: Mat4) -> Vec3

Return the scale component of a matrix a scale vector.

GetSceneForwardPipelineFog

(scene: Scene) -> ForwardPipelineFog

GetSceneForwardPipelineLights

(scene: Scene) -> ForwardPipelineLightList

Filter through the scene lights and return a list of pipeline lights to be used by the scene forward pipeline.

GetSceneForwardPipelinePassViewId

(views: SceneForwardPipelinePassViewId, pass: SceneForwardPipelinePass) -> int

Return the view id for a scene forward pipeline pass id.

GetSize

(file: File) -> int
(rect: Rect) -> Vec2
(rect: IntRect) -> iVec2

Return the size in bytes of a local file.

GetSourceDuration

(source: SourceRef) -> int

Return the duration of an audio source.

GetSourceState

(source: SourceRef) -> SourceState

Return the state of an audio source.

GetSourceTimecode

(source: SourceRef) -> int

Return the current timecode of a playing audio source.

GetT

(m: Mat4) -> Vec3

See GetTranslation.

GetTextures

(framebuffer: FrameBuffer) -> Texture, Texture

Returns color and depth texture attachments.

GetTranslation

(m: Mat3) -> Vec3
(m: Mat4) -> Vec3

Return the translation part of a tranformation matrix as a translation vector.

GetUserFolder

() -> str

Return the system user folder for the current user.

GetVRControllerNames

() -> StringList

Return a list of names for all supported VR controller devices on the system.

See ReadVRController.

GetVRGenericTrackerNames

() -> StringList

Return a list of names for all supported VR tracker devices on the system.

GetWidth

(rect: Rect) -> float
(rect: IntRect) -> int

Return the width of a rectangle.

GetWindowClientSize

(window: Window) -> bool, int, int

Return a window client rectangle. The client area of a window does not include its decorations.

GetWindowContentScale

(window: Window) -> Vec2

GetWindowHandle

(window: Window) -> VoidPointer

Return the system native window handle.

GetWindowInFocus

() -> Window

Return the system window with input focus.

GetWindowPos

(window: Window) -> iVec2

Return a window position on screen.

GetWindowTitle

(window: Window) -> bool, str

Return a window title.

GetX

(m: Mat3) -> Vec3
(m: Mat4) -> Vec3
(rect: Rect) -> float
(rect: IntRect) -> int

Return the scaled X axis of a transformation matrix.

GetY

(m: Mat3) -> Vec3
(m: Mat4) -> Vec3
(rect: Rect) -> float
(rect: IntRect) -> int

Return the scaled Y axis of a transformation matrix.

GetZ

(m: Mat3) -> Vec3
(m: Mat4) -> Vec3

Return the scaled Z axis of a transformation matrix.

Grow

(rect: Rect, border: float) -> Rect
(rect: IntRect, border: int) -> IntRect

Grow a rectangle by the specified amount of units.

See Crop.

HasFileExtension

(path: str) -> bool

Test the extension of a file path.

HermiteInterpolate

(y0: float, y1: float, y2: float, y3: float, t: float, tension: float, bias: float) -> float

Perform a Hermite interpolation across four values with t in the [0;1] range between y1 and y2. The tension and bias parameters can be used to control the shape of underlying interpolation curve.

See LinearInterpolate, CosineInterpolate and CubicInterpolate.

HideCursor

() -> None

Hide the system mouse cursor.

See ShowCursor.

ImGuiAlignTextToFramePadding

() -> None

Vertically align upcoming text baseline to FramePadding y coordinate so that it will align properly to regularly framed items.

ImGuiBegin

(name: str) -> bool
(name: str, open: bool, flags: ImGuiWindowFlags) -> bool, bool

Start a new window.

ImGuiBeginChild

(id: str) -> bool
(id: str, size: Vec2) -> bool
(id: str, size: Vec2, border: bool) -> bool
(id: str, size: Vec2, border: bool, flags: ImGuiWindowFlags) -> bool

Begin a scrolling region.

ImGuiBeginCombo

(label: str, preview_value: str) -> bool
(label: str, preview_value: str, flags: ImGuiComboFlags) -> bool

Begin a ImGui Combo Box.

ImGuiBeginFrame

(width: int, height: int, dt_clock: int, mouse: MouseState, keyboard: KeyboardState) -> None
(ctx: DearImguiContext, width: int, height: int, dt_clock: int, mouse: MouseState, keyboard: KeyboardState) -> None

Begin an ImGui frame. This function must be called once per frame before any other ImGui call.

When using multiple contexts, it must be called for each context you intend to use during the current frame.

See ImGuiEndFrame.

ImGuiBeginGroup

() -> None

Lock horizontal starting position. Once closing a group it is seen as a single item (so you can use ImGuiIsItemHovered on a group, ImGuiSameLine between groups, etc…).

ImGuiBeginMainMenuBar

() -> bool

Create and append to a full screen menu-bar.

Note: Only call ImGuiEndMainMenuBar if this returns true.

ImGuiBeginMenu

(label: str) -> bool
(label: str, enabled: bool) -> bool

Create a sub-menu entry.

Note: Only call ImGuiEndMenu if this returns true.

ImGuiBeginMenuBar

() -> bool

Start append to the menu-bar of the current window (requires the WindowFlags_MenuBar flag).

Note: Only call ImGuiEndMenuBar if this returns true.

ImGuiBeginPopup

(id: str) -> bool

Return true if popup is opened and starts outputting to it.

Note: Only call ImGuiEndPopup if this returns true.

ImGuiBeginPopupContextItem

(id: str) -> bool
(id: str, mouse_button: int) -> bool

ImGui helper to open and begin popup when clicked on last item.

ImGuiBeginPopupContextVoid

() -> bool
(id: str) -> bool
(id: str, mouse_button: int) -> bool

ImGui helper to open and begin popup when clicked in void (where there are no ImGui windows)

ImGuiBeginPopupContextWindow

() -> bool
(id: str) -> bool
(id: str, flags: ImGuiPopupFlags) -> bool

ImGui helper to open and begin popup when clicked on current window.

ImGuiBeginPopupModal

(name: str) -> bool
(name: str, open: bool) -> bool
(name: str, open: bool, flags: ImGuiWindowFlags) -> bool

Begin an ImGui modal dialog.

ImGuiBeginTooltip

() -> None

Used to create full-featured tooltip windows that aren’t just text.

ImGuiBullet

() -> None

Draw a small circle and keep the cursor on the same line. Advances by the same distance as an empty ImGuiTreeNode call.

ImGuiBulletText

(label: str) -> None

Draw a bullet followed by a static text.

ImGuiButton

(label: str) -> bool
(label: str, size: Vec2) -> bool

Button widget returning True if the button was pressed.

ImGuiCalcItemWidth

() -> float

Returns the width of item given pushed settings and current cursor position.

Note: This is not necessarily the width of last item.

ImGuiCalcTextSize

(text: str) -> Vec2
(text: str, hide_text_after_double_dash: bool) -> Vec2
(text: str, hide_text_after_double_dash: bool, wrap_width: float) -> Vec2

Compute the bounding rectangle for the provided text.

ImGuiCaptureKeyboardFromApp

(capture: bool) -> None

Force capture keyboard when your widget is being hovered.

ImGuiCaptureMouseFromApp

(capture: bool) -> None

Force capture mouse when your widget is being hovered.

ImGuiCheckbox

(label: str, value: bool) -> bool, bool

Display a checkbox widget. Returns an interaction flag (user interacted with the widget) and the current widget state (checked or not after user interaction).

was_clicked, my_value = gs.ImGuiCheckBox('My value', my_value)

ImGuiClearInputBuffer

() -> None

Force a reset of the ImGui input buffer.

ImGuiCloseCurrentPopup

() -> None

Close the popup we have begin-ed into. Clicking on a menu item or selectable automatically closes the current popup.

ImGuiCollapsingHeader

(label: str) -> bool
(label: str, flags: ImGuiTreeNodeFlags) -> bool
(label: str, p_open: bool) -> bool, bool
(label: str, p_open: bool, flags: ImGuiTreeNodeFlags) -> bool, bool

Draw a collapsing header, returns False if the header is collapsed so that you may skip drawing the header content.

ImGuiColorButton

(id: str, color: Color) -> bool
(id: str, color: Color, flags: ImGuiColorEditFlags) -> bool
(id: str, color: Color, flags: ImGuiColorEditFlags, size: Vec2) -> bool

Color button widget, display a small colored rectangle.

ImGuiColorEdit

(label: str, color: Color) -> bool, Color
(label: str, color: Color, flags: ImGuiColorEditFlags) -> bool, Color

Color editor, returns the widget current color.

ImGuiColumns

() -> None
(count: int) -> None
(count: int, id: str) -> None
(count: int, id: str, with_border: bool) -> None

Begin a column layout section.

To move to the next column use ImGuiNextColumn. To end a column layout section pass 1 to this function.

Note: Current implementation supports a maximum of 64 columns.

ImGuiCombo

(label: str, current_item: int, items: StringList) -> bool, int
(label: str, current_item: int, items: StringList, height_in_items: int) -> bool, int

Combo box widget, return the current selection index. Combo items are passed as an array of string.

ImGuiDragFloat

(label: str, v: float) -> bool, float
(label: str, v: float, v_speed: float) -> bool, float
(label: str, v: float, v_speed: float, v_min: float, v_max: float) -> bool, float

Declare a widget to edit a float value. The widget can be dragged over to modify the underlying value.

ImGuiDragIntVec2

(label: str, v: iVec2) -> bool, iVec2
(label: str, v: iVec2, v_speed: float) -> bool, iVec2
(label: str, v: iVec2, v_speed: float, v_min: int, v_max: int) -> bool, iVec2

Declare a widget to edit an iVec2 value. The widget can be dragged over to modify the underlying value.

ImGuiDragVec2

(label: str, v: Vec2) -> bool, Vec2
(label: str, v: Vec2, v_speed: float) -> bool, Vec2
(label: str, v: Vec2, v_speed: float, v_min: float, v_max: float) -> bool, Vec2

Declare a float edit widget that can be dragged over to modify its value.

ImGuiDragVec3

(label: str, v: Vec3) -> bool, Vec3
(label: str, v: Vec3, v_speed: float) -> bool, Vec3
(label: str, v: Vec3, v_speed: float, v_min: float, v_max: float) -> bool, Vec3

Declare a widget to edit a Vec3 value. The widget can be dragged over to modify the underlying value.

ImGuiDragVec4

(label: str, v: Vec4) -> bool, Vec4
(label: str, v: Vec4, v_speed: float) -> bool, Vec4
(label: str, v: Vec4, v_speed: float, v_min: float, v_max: float) -> bool, Vec4

Declare a widget to edit a Vec4 value. The widget can be dragged over to modify the underlying value.

ImGuiDummy

(size: Vec2) -> None

Add a dummy item of given size.

ImGuiEnd

() -> None

End the current window.

ImGuiEndChild

() -> None

End a scrolling region.

ImGuiEndCombo

() -> None

End a combo widget.

ImGuiEndFrame

(ctx: DearImguiContext) -> None
(ctx: DearImguiContext, view_id: int) -> None
() -> None
(view_id: int) -> None

End the current ImGui frame.

All ImGui rendering is sent to the specified view. If no view is specified, view 255 is used.

See Drawing to Views.

ImGuiEndGroup

() -> None

End the current group.

ImGuiEndMainMenuBar

() -> None

End the main menu bar.

See ImGuiBeginMainMenuBar.

ImGuiEndMenu

() -> None

End the current sub-menu entry.

ImGuiEndMenuBar

() -> None

End the current menu bar.

ImGuiEndPopup

() -> None

End the current popup.

ImGuiEndTooltip

() -> None

End the current tooltip window.

See ImGuiBeginTooltip.

ImGuiGetColorU32

(idx: ImGuiCol) -> int
(idx: ImGuiCol, alpha_multiplier: float) -> int
(color: Color) -> int

Return a style color component as a 32 bit unsigned integer.

See ImGuiPushStyleColor.

ImGuiGetColumnIndex

() -> int

Returns the index of the current column.

ImGuiGetColumnOffset

() -> float
(column_index: int) -> float

Returns the current column offset in pixels, from the left side of the content region.

ImGuiGetColumnWidth

() -> float
(column_index: int) -> float

Returns the current column width in pixels.

ImGuiGetColumnsCount

() -> int

Return the number of columns in the current layout section.

See ImGuiColumns.

ImGuiGetContentRegionAvail

() -> Vec2

Get available space for content in the current layout.

ImGuiGetContentRegionAvailWidth

() -> float

Helper function to return the available width of current content region.

See ImGuiGetContentRegionAvail.

ImGuiGetContentRegionMax

() -> Vec2

Return the available content space including window decorations and scrollbar.

ImGuiGetCursorPos

() -> Vec2

Return the layout cursor position in window space. Next widget declaration will take place at the cursor position.

See ImGuiSetCursorPos and ImGuiSameLine.

ImGuiGetCursorPosX

() -> float

Helper for ImGuiGetCursorPos.

ImGuiGetCursorPosY

() -> float

Helper for ImGuiGetCursorPos.

ImGuiGetCursorScreenPos

() -> Vec2

Return the current layout cursor position in screen space.

ImGuiGetCursorStartPos

() -> Vec2

Return the current layout “line” starting position.

See ImGuiSameLine.

ImGuiGetFont

() -> ImFont

Return the current ImGui font.

ImGuiGetFontSize

() -> float

Return the font size (height in pixels) of the current ImGui font with the current scale applied.

ImGuiGetFontTexUvWhitePixel

() -> Vec2

Get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API.

ImGuiGetFrameCount

() -> int

Return the ImGui frame counter.

See ImGuiBeginFrame and ImGuiEndFrame.

ImGuiGetFrameHeightWithSpacing

() -> float

Return the following value: FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)

ImGuiGetID

(id: str) -> int

Return a unique ImGui ID.

ImGuiGetItemRectMax

() -> Vec2

Get bounding rect maximum of last item in screen space.

ImGuiGetItemRectMin

() -> Vec2

Get bounding rect minimum of last item in screen space.

ImGuiGetItemRectSize

() -> Vec2

Get bounding rect size of last item in screen space.

ImGuiGetMouseDragDelta

() -> Vec2
(button: ImGuiMouseButton) -> Vec2
(button: ImGuiMouseButton, lock_threshold: float) -> Vec2

Return the distance covered by the mouse cursor since the last button press.

ImGuiGetMousePos

() -> Vec2

Return the mouse cursor coordinates in screen space.

ImGuiGetMousePosOnOpeningCurrentPopup

() -> Vec2

Retrieve a backup of the mouse position at the time of opening the current popup.

See ImGuiBeginPopup.

ImGuiGetScrollMaxX

() -> float

Get maximum scrolling amount on the horizontal axis.

ImGuiGetScrollMaxY

() -> float

Get maximum scrolling amount on the vertical axis.

ImGuiGetScrollX

() -> float

Get scrolling amount on the horizontal axis.

ImGuiGetScrollY

() -> float

Get scrolling amount on the vertical axis.

ImGuiGetTextLineHeight

() -> float

Return the height of a text line using the current font.

See ImGuiPushFont.

ImGuiGetTextLineHeightWithSpacing

() -> float

Return the height of a text line using the current font plus vertical spacing between two layout lines.

See ImGuiGetTextLineHeight.

ImGuiGetTime

() -> float

Return the current ImGui time in seconds.

ImGuiGetTreeNodeToLabelSpacing

() -> float

Return the horizontal distance preceding label when using ImGuiTreeNode or ImGuiBullet.

The value g.FontSize + style.FramePadding.x * 2 is returned for a regular unframed TreeNode.

ImGuiGetWindowContentRegionMax

() -> Vec2

Return the content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with ImGuiSetNextWindowContentSize, in window space.

ImGuiGetWindowContentRegionMin

() -> Vec2

Content boundaries min (roughly (0,0)-Scroll), in window space.

ImGuiGetWindowContentRegionWidth

() -> float

Return the width of the content region.

ImGuiGetWindowDrawList

() -> ImDrawList

Get the draw list associated to the current window, to append your own drawing primitives.

ImGuiGetWindowHeight

() -> float

Return the current window height.

ImGuiGetWindowPos

() -> Vec2

Return the current window position in screen space.

See ImGuiSetWindowPos.

ImGuiGetWindowSize

() -> Vec2

Return the current window size.

See ImGuiSetWindowSize.

ImGuiGetWindowWidth

() -> float

Return the current window width.

ImGuiImage

(tex: Texture, size: Vec2) -> None
(tex: Texture, size: Vec2, uv0: Vec2) -> None
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2) -> None
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, tint_col: Color) -> None
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, tint_col: Color, border_col: Color) -> None

Display a texture as an image widget.

See ImGuiImageButton.

ImGuiImageButton

(tex: Texture, size: Vec2) -> bool
(tex: Texture, size: Vec2, uv0: Vec2) -> bool
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2) -> bool
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, frame_padding: int) -> bool
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, frame_padding: int, bg_col: Color) -> bool
(tex: Texture, size: Vec2, uv0: Vec2, uv1: Vec2, frame_padding: int, bg_col: Color, tint_col: Color) -> bool

Declare an image button displaying the provided texture.

See ImGuiImage.

ImGuiIndent

() -> None
(width: float) -> None

Move content position toward the right.

ImGuiInit

(font_size: float, imgui_program: ProgramHandle, imgui_image_program: ProgramHandle) -> None

Initialize the global ImGui context. This function must be called once before any other ImGui function using the global context.

See ImGuiInitContext.

ImGuiInitContext

(font_size: float, imgui_program: ProgramHandle, imgui_image_program: ProgramHandle) -> DearImguiContext

Initialize an ImGui context. This function must be called once before any other ImGui function using the context.

See ImGuiInit.

ImGuiInputFloat

(label: str, v: float) -> bool, float
(label: str, v: float, step: float, step_fast: float) -> bool, float
(label: str, v: float, step: float, step_fast: float, decimal_precision: int) -> bool, float
(label: str, v: float, step: float, step_fast: float, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, float

Float field widget.

ImGuiInputInt

(label: str, v: int) -> bool, int
(label: str, v: int, step: int, step_fast: int) -> bool, int
(label: str, v: int, step: int, step_fast: int, flags: ImGuiInputTextFlags) -> bool, int

Integer field widget.

ImGuiInputIntVec2

(label: str, v: iVec2) -> bool, iVec2
(label: str, v: iVec2, flags: ImGuiInputTextFlags) -> bool, iVec2

ImGuiInputText

(label: str, text: str, max_size: int) -> bool, str
(label: str, text: str, max_size: int, flags: ImGuiInputTextFlags) -> bool, str

Text input widget, returns the current widget buffer content.

ImGuiInputVec2

(label: str, v: Vec2) -> bool, Vec2
(label: str, v: Vec2, decimal_precision: int) -> bool, Vec2
(label: str, v: Vec2, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, Vec2

Vec2 field widget.

ImGuiInputVec3

(label: str, v: Vec3) -> bool, Vec3
(label: str, v: Vec3, decimal_precision: int) -> bool, Vec3
(label: str, v: Vec3, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, Vec3

Vec3 field widget.

ImGuiInputVec4

(label: str, v: Vec4) -> bool, Vec4
(label: str, v: Vec4, decimal_precision: int) -> bool, Vec4
(label: str, v: Vec4, decimal_precision: int, flags: ImGuiInputTextFlags) -> bool, Vec4

Vec4 field widget.

ImGuiInvisibleButton

(text: str, size: Vec2) -> bool

Invisible button widget, return True if the button was pressed.

ImGuiIsAnyItemActive

() -> bool

Return true if any item is active, false otherwise.

ImGuiIsAnyItemHovered

() -> bool

Return true if any item is hovered by the mouse cursor, false otherwise.

ImGuiIsItemActive

() -> bool

Was the last item active.

e.g. button being held, text field being edited - items that do not interact will always return false.

ImGuiIsItemClicked

() -> bool
(mouse_button: int) -> bool

Was the last item clicked.

ImGuiIsItemHovered

() -> bool
(flags: ImGuiHoveredFlags) -> bool

Was the last item hovered by mouse.

ImGuiIsItemVisible

() -> bool

Was the last item visible and not out of sight due to clipping/scrolling.

ImGuiIsKeyDown

(key_index: int) -> bool

Was the specified key down during the last frame?

ImGuiIsKeyPressed

(key_index: int) -> bool
(key_index: int, repeat: bool) -> bool

Was the specified key pressed? A key press implies that the key was down and is currently released.

ImGuiIsKeyReleased

(key_index: int) -> bool

Was the specified key released during the last frame?

ImGuiIsMouseClicked

(button: int) -> bool
(button: int, repeat: bool) -> bool

Was the specified mouse button clicked during the last frame? A mouse click implies that the button pressed earlier and released during the last frame.

ImGuiIsMouseDoubleClicked

(button: int) -> bool

Was the specified mouse button double-clicked during the last frame? A double-click implies two rapid successive clicks of the same button with the mouse cursor staying in the same position.

ImGuiIsMouseDown

(button: int) -> bool

Was the specified mouse button down during the last frame?

ImGuiIsMouseDragging

(button: ImGuiMouseButton) -> bool
(button: ImGuiMouseButton, lock_threshold: float) -> bool

Is mouse dragging?

ImGuiIsMouseHoveringRect

(rect_min: Vec2, rect_max: Vec2) -> bool
(rect_min: Vec2, rect_max: Vec2, clip: bool) -> bool

Test whether the mouse cursor is hovering the specified rectangle.

ImGuiIsMouseReleased

(button: int) -> bool

Was the specified mouse button released during the last frame?

ImGuiIsRectVisible

(size: Vec2) -> bool
(rect_min: Vec2, rect_max: Vec2) -> bool

Test if a rectangle of the specified size starting from cursor position is visible/not clipped. Or test if a rectangle in screen space is visible/not clipped.

ImGuiIsWindowCollapsed

() -> bool

Is the current window collapsed.

ImGuiIsWindowFocused

() -> bool
(flags: ImGuiFocusedFlags) -> bool

Is the current window focused.

ImGuiIsWindowHovered

() -> bool
(flags: ImGuiHoveredFlags) -> bool

Is the current window hovered and hoverable (not blocked by a popup), differentiates child windows from each others.

ImGuiLabelText

(label: str, text: str) -> None

Display text+label aligned the same way as value+label widgets.

ImGuiListBox

(label: str, current_item: int, items: StringList) -> bool, int
(label: str, current_item: int, items: StringList, height_in_items: int) -> bool, int

List widget.

ImGuiMenuItem

(label: str) -> bool
(label: str, shortcut: str) -> bool
(label: str, shortcut: str, selected: bool) -> bool
(label: str, shortcut: str, selected: bool, enabled: bool) -> bool

Return true when activated. Shortcuts are displayed for convenience but not processed at the moment.

ImGuiMouseDrawCursor

(draw_cursor: bool) -> None

Enable/disable the ImGui software mouse cursor.

ImGuiNewFrame

() -> None

ImGuiNewLine

() -> None

Undo a ImGuiSameLine call or force a new line when in an horizontal layout.

ImGuiNextColumn

() -> None

Start the next column in multi-column layout.

See ImGuiColumns.

ImGuiOpenPopup

(id: str) -> None

Mark a named popup as open.

Popup windows are closed when the user:

Popup identifiers are relative to the current ID stack so ImGuiOpenPopup and ImGuiBeginPopup need to be at the same level of the ID stack.

ImGuiPopAllowKeyboardFocus

() -> None

Undo the last call to ImGuiPushAllowKeyboardFocus.

ImGuiPopButtonRepeat

() -> None

Undo the last call to ImGuiPushButtonRepeat.

ImGuiPopClipRect

() -> None

Undo the last call to ImGuiPushClipRect.

ImGuiPopFont

() -> None

Undo the last call to ImGuiPushFont.

ImGuiPopID

() -> None

Undo the last call to ImGuiPushID.

ImGuiPopItemWidth

() -> None

Undo the last call to ImGuiPushItemWidth.

ImGuiPopStyleColor

() -> None
(count: int) -> None

Undo the last call to ImGuiPushStyleColor.

ImGuiPopStyleVar

() -> None
(count: int) -> None

Undo the last call to ImGuiPushStyleVar.

ImGuiPopTextWrapPos

() -> None

Undo the last call to ImGuiPushTextWrapPos.

ImGuiProgressBar

(fraction: float) -> None
(fraction: float, size: Vec2) -> None
(fraction: float, size: Vec2, overlay: str) -> None

Draw a progress bar, fraction must be between 0.0 and 1.0.

ImGuiPushAllowKeyboardFocus

(v: bool) -> None

Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.

ImGuiPushButtonRepeat

(repeat: bool) -> None

In repeat mode, ButtonXXX functions return repeated true in a typematic manner.

Note that you can call ImGuiIsItemActive after any Button to tell if the button is held in the current frame.

ImGuiPushClipRect

(clip_rect_min: Vec2, clip_rect_max: Vec2, intersect_with_current_clip_rect: bool) -> None

Push a new clip rectangle onto the clipping stack.

ImGuiPushFont

(font: ImFont) -> None

Push a font on top of the font stack and make it current for subsequent text rendering operations.

ImGuiPushID

(id: str) -> None
(id: int) -> None

Push a string into the ID stack.

ImGuiPushItemWidth

(item_width: float) -> None

Set the width of items for common large item+label widgets.

  • >0: width in pixels
  • <0: align x pixels to the right of window (so -1 always align width to the right side)
  • =0: default to ~2/3 of the window width

See ImGuiPopItemWidth.

ImGuiPushStyleColor

(idx: ImGuiCol, color: Color) -> None

Push a value on the style stack for the specified style color.

See ImGuiPopStyleColor.

ImGuiPushStyleVar

(idx: ImGuiStyleVar, value: float) -> None
(idx: ImGuiStyleVar, value: Vec2) -> None

Push a value on the style stack for the specified style variable.

See ImGuiPopStyleVar.

ImGuiPushTextWrapPos

() -> None
(wrap_pos_x: float) -> None

Push word-wrapping position for text commands.

  • <0: No wrapping.
  • =0: Wrap to the end of the window or column.
  • >0: Wrap at wrap_pos_x position in window local space.

See ImGuiPopTextWrapPos.

ImGuiRadioButton

(label: str, active: bool) -> bool
(label: str, v: int, v_button: int) -> bool, int

Radio button widget, return the button state.

ImGuiRender

() -> None

ImGuiResetMouseDragDelta

() -> None
(button: ImGuiMouseButton) -> None

ImGuiSameLine

() -> None
(pos_x: float) -> None
(pos_x: float, spacing_w: float) -> None

Call between widgets or groups to layout them horizontally.

ImGuiSelectable

(label: str) -> bool
(label: str, selected: bool) -> bool
(label: str, selected: bool, flags: ImGuiSelectableFlags) -> bool
(label: str, selected: bool, flags: ImGuiSelectableFlags, size: Vec2) -> bool

Selectable item.

The following width values are possible:

  • = 0.0: Use remaining width.
  • > 0.0: Specific width.

The following height values are possible:

  • = 0.0: Use label height.
  • > 0.0: Specific height.

ImGuiSeparator

() -> None

Output an horizontal line to separate two distinct UI sections.

ImGuiSetColumnOffset

(column_index: int, offset_x: float) -> None

Set the position of a column line in pixels, from the left side of the contents region.

ImGuiSetColumnWidth

(column_index: int, width: float) -> None

Set the column width in pixels.

ImGuiSetCursorPos

(local_pos: Vec2) -> None

Set the current widget output cursor position in window space.

ImGuiSetCursorPosX

(x: float) -> None

See ImGuiSetCursorPos.

ImGuiSetCursorPosY

(y: float) -> None

See ImGuiSetCursorPos.

ImGuiSetCursorScreenPos

(pos: Vec2) -> None

Set the widget cursor output position in screen space.

ImGuiSetItemAllowOverlap

() -> None

Allow the last item to be overlapped by a subsequent item. Sometimes useful with invisible buttons, selectables, etc… to catch unused areas.

ImGuiSetItemDefaultFocus

() -> None

Make the last item the default focused item of a window.

ImGuiSetKeyboardFocusHere

() -> None
(offset: int) -> None

Focus keyboard on the next widget.

Use positive offset value to access sub components of a multiple component widget. Use -1 to access the previous widget.

ImGuiSetNextItemOpen

(is_open: bool) -> None
(is_open: bool, condition: ImGuiCond) -> None

Set next item open state.

ImGuiSetNextWindowCollapsed

(collapsed: bool, condition: ImGuiCond) -> None

Set next window collapsed state, call before ImGuiBegin.

ImGuiSetNextWindowContentSize

(size: Vec2) -> None

Set the size of the content area of the next declared window. Call before ImGuiBegin.

ImGuiSetNextWindowContentWidth

(width: float) -> None

See ImGuiSetNextWindowContentSize.

ImGuiSetNextWindowFocus

() -> None

Set the next window to be focused/top-most. Call before ImGuiBegin.

ImGuiSetNextWindowPos

(pos: Vec2) -> None
(pos: Vec2, condition: ImGuiCond) -> None

Set next window position, call before ImGuiBegin.

ImGuiSetNextWindowPosCenter

() -> None
(condition: ImGuiCond) -> None

Set next window position to be centered on screen, call before ImGuiBegin.

ImGuiSetNextWindowSize

(size: Vec2) -> None
(size: Vec2, condition: ImGuiCond) -> None

Set next window size, call before ImGuiBegin. A value of 0 for an axis will auto-fit it.

ImGuiSetNextWindowSizeConstraints

(size_min: Vec2, size_max: Vec2) -> None

Set the next window size limits.

Use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down.

ImGuiSetScrollFromPosY

(pos_y: float) -> None
(pos_y: float, center_y_ratio: float) -> None

Adjust scrolling amount to make a given position visible. Generally ImGuiGetCursorStartPos + offset to compute a valid position.

ImGuiSetScrollHereY

() -> None
(center_y_ratio: float) -> None

Adjust scrolling amount to make current cursor position visible.

  • 0: Top.
  • 0.5: Center.
  • 1: Bottom.

When using to make a default/current item visible, consider using ImGuiSetItemDefaultFocus instead.

ImGuiSetScrollX

(scroll_x: float) -> None

Set scrolling amount between [0;ImGuiGetScrollMaxX].

ImGuiSetScrollY

(scroll_y: float) -> None

Set scrolling amount between [0;ImGuiGetScrollMaxY].

ImGuiSetTooltip

(text: str) -> None

Set tooltip under mouse-cursor, typically used with ImGuiIsItemHovered/ImGuiIsAnyItemHovered. Last call wins.

ImGuiSetWindowCollapsed

(name: str, collapsed: bool) -> None
(name: str, collapsed: bool, condition: ImGuiCond) -> None

Set named window collapsed state, prefer using ImGuiSetNextWindowCollapsed.

ImGuiSetWindowFocus

(name: str) -> None

Set named window to be focused/top-most.

ImGuiSetWindowFontScale

(scale: float) -> None

Per-window font scale.

ImGuiSetWindowPos

(name: str, pos: Vec2) -> None
(name: str, pos: Vec2, condition: ImGuiCond) -> None

Set named window position.

ImGuiSetWindowSize

(name: str, size: Vec2) -> None
(name: str, size: Vec2, condition: ImGuiCond) -> None

Set named window size.

ImGuiShutdown

() -> None

Shutdown the global ImGui context.

ImGuiSliderFloat

(label: str, v: float, v_min: float, v_max: float) -> bool, float
(label: str, v: float, v_min: float, v_max: float, format: str) -> bool, float

Float slider widget.

ImGuiSliderInt

(label: str, v: int, v_min: int, v_max: int) -> bool, int
(label: str, v: int, v_min: int, v_max: int, format: str) -> bool, int

Integer slider widget.

ImGuiSliderIntVec2

(label: str, v: iVec2, v_min: int, v_max: int) -> bool, iVec2
(label: str, v: iVec2, v_min: int, v_max: int, format: str) -> bool, iVec2

ImGuiSliderVec2

(label: str, v: Vec2, v_min: float, v_max: float) -> bool, Vec2
(label: str, v: Vec2, v_min: float, v_max: float, format: str) -> bool, Vec2

Vec2 slider widget.

ImGuiSliderVec3

(label: str, v: Vec3, v_min: float, v_max: float) -> bool, Vec3
(label: str, v: Vec3, v_min: float, v_max: float, format: str) -> bool, Vec3

Vec3 slider widget.

ImGuiSliderVec4

(label: str, v: Vec4, v_min: float, v_max: float) -> bool, Vec4
(label: str, v: Vec4, v_min: float, v_max: float, format: str) -> bool, Vec4

Vec4 slider widget.

ImGuiSmallButton

(label: str) -> bool

Small button widget fitting the height of a text line, return True if the button was pressed.

ImGuiSpacing

() -> None

Add spacing.

ImGuiText

(text: str) -> None

Static text.

ImGuiTextColored

(color: Color, text: str) -> None

Colored static text.

ImGuiTextDisabled

(text: str) -> None

Disabled static text.

ImGuiTextUnformatted

(text: str) -> None

Raw text without formatting. Roughly equivalent to ImGuiText but faster, recommended for long chunks of text.

ImGuiTextWrapped

(text: str) -> None

Wrapped static text.

Note that this won’t work on an auto-resizing window if there’s no other widgets to extend the window width, you may need to set a size using ImGuiSetNextWindowSize.

ImGuiTreeNode

(label: str) -> bool

If returning true the node is open and the user is responsible for calling ImGuiTreePop.

ImGuiTreeNodeEx

(label: str, flags: ImGuiTreeNodeFlags) -> bool

See ImGuiTreeNode.

ImGuiTreePop

() -> None

Pop the current tree node.

ImGuiTreePush

(id: str) -> None

Already called by ImGuiTreeNode, but you can call ImGuiTreePush/ImGuiTreePop yourself for layouting purpose.

ImGuiUnindent

() -> None
(width: float) -> None

Move content position back to the left (cancel ImGuiIndent).

ImGuiWantCaptureMouse

() -> bool

ImGui wants mouse capture. Use this function to determine when to pause mouse processing from other parts of your program.

Inch

(inch: float) -> float

Convert a value in inches to the Harfang internal unit system.

See Coordinates and Units System.

InputInit

() -> None

Initialize the Input system. Must be invoked before any call to WindowSystemInit to work properly.

hg.InputInit()
hg.WindowSystemInit()

InputShutdown

() -> None

Shutdown the Input system.

Inside

(rect: Rect, v: iVec2) -> bool
(rect: Rect, v: Vec2) -> bool
(rect: Rect, v: Vec3) -> bool
(rect: Rect, v: Vec4) -> bool
(rect: IntRect, v: iVec2) -> bool
(rect: IntRect, v: Vec2) -> bool
(rect: IntRect, v: Vec3) -> bool
(rect: IntRect, v: Vec4) -> bool

Test if a value is inside a containing volume.

IntersectRay

(minmax: MinMax, origin: Vec3, direction: Vec3) -> bool, float, float

Intersect an infinite ray with an axis-aligned bounding box, if the first returned value is true it is followed by the near and far intersection points.

Intersection

(a: Rect, b: Rect) -> Rect
(a: IntRect, b: IntRect) -> IntRect

Return the intersection of two rectangles.

Intersects

(a: Rect, b: Rect) -> bool
(a: IntRect, b: IntRect) -> bool

Return true if rect a intersects rect b.

Inverse

(q: Quaternion) -> Quaternion
(m: Mat3) -> bool, Mat3
(m: Mat4) -> bool, Mat4
(m: Mat44) -> Mat44, bool
(v: Vec3) -> Vec3

Return the inverse of a matrix, vector or quaternion.

InverseFast

(m: Mat4) -> Mat4

Compute the inverse of an orthonormal transformation matrix. This function is faster than the generic Inverse function but can only deal with a specific set of matrices.

See Inverse.

IsAssetFile

(name: str) -> bool

Test if an asset file exists in the assets system.

See Resources & Assets.

IsDir

(path: str) -> bool

Returns true if path is a directory on the local filesystem, false otherwise.

IsEOF

(file: File) -> bool

Returns true if the cursor is at the end of the file, false otherwise.

IsFile

(path: str) -> bool

Test if a file exists on the local filesystem.

IsFinite

(v: float) -> bool

Test if a floating point value is finite.

IsHandJointActive

(hand: HandsSide) -> bool

IsMonitorConnected

(monitor: Monitor) -> bool

Test if the specified monitor is connected to the host device.

IsPathAbsolute

(path: str) -> bool

Test if the provided path is an absolute or relative path.

IsPrimaryMonitor

(monitor: Monitor) -> bool

Return true if the monitor is the primary host device monitor, false otherwise.

IsValid

(file: File) -> bool
(t: Texture) -> bool
(fb: FrameBuffer) -> bool
(pipeline: ForwardPipelineAAA) -> bool
(streamer: IVideoStreamer) -> bool

Test if a resource if valid.

IsWindowOpen

(window: Window) -> bool

Return true if the window is open, false otherwise.

IsoSurfaceSphere

(surface: IsoSurface, width: int, height: int, depth: int, x: float, y: float, z: float, radius: float) -> None
(surface: IsoSurface, width: int, height: int, depth: int, x: float, y: float, z: float, radius: float, value: float) -> None
(surface: IsoSurface, width: int, height: int, depth: int, x: float, y: float, z: float, radius: float, value: float, exponent: float) -> None

Output a sphere to an iso-surface.

IsoSurfaceToModel

(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int) -> bool
(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int, material: int) -> bool
(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int, material: int, isolevel: float) -> bool
(builder: ModelBuilder, surface: IsoSurface, width: int, height: int, depth: int, material: int, isolevel: float, scale_x: float, scale_y: float, scale_z: float) -> bool

Convert an iso-surface to a render model, this function is geared toward efficiency and meant for realtime.

int_to_VoidPointer

(ptr: pointer) -> VoidPointer

Cast an integer to a void pointer.

This function is only used to provide access to low-level structures and should not be needed most of the time.

Km

(km: float) -> float

Convert a value in kilometers to the Harfang internal unit system.

See Coordinates and Units System.

Len

(v: Vec2) -> float
(v: iVec2) -> int
(q: Quaternion) -> float
(v: Vec3) -> float

Return the length of the vector.

Len2

(v: Vec2) -> float
(v: iVec2) -> int
(q: Quaternion) -> float
(v: Vec3) -> float

Return the length of the vector squared.

Lerp

(a: int, b: int, t: float) -> int
(a: float, b: float, t: float) -> float
(a: Vec3, b: Vec3, t: float) -> Vec3
(a: Vec4, b: Vec4, t: float) -> Vec4

See LinearInterpolate.

LerpAsOrthonormalBase

(from: Mat4, to: Mat4, k: float) -> Mat4
(from: Mat4, to: Mat4, k: float, fast: bool) -> Mat4

Linear interpolate between two transformation matrices on the [0;1] interval.

LinearInterpolate

(y0: float, y1: float, t: float) -> float

Linear interpolate between two values on the [0;1] interval.

See CosineInterpolate, CubicInterpolate and HermiteInterpolate.

ListDir

(path: str, type: DirEntryType) -> DirEntryList

Get the content of a directory on the local filesystem, this function does not recurse into subfolders.

See ListDirRecursive.

ListDirRecursive

(path: str, type: DirEntryType) -> DirEntryList

Get the content of a directory on the local filesystem, this function recurses into subfolders.

See ListDir.

LoadBMP

(pict: Picture, path: str) -> bool

Load a Picture in BMP file format.

LoadDataFromFile

(path: str, data: Data) -> bool

LoadFontFromAssets

(name: str) -> Font
(name: str, size: float) -> Font
(name: str, size: float, resolution: int) -> Font
(name: str, size: float, resolution: int, padding: int) -> Font
(name: str, size: float, resolution: int, padding: int, glyphs: str) -> Font

Load a TrueType (TTF) font from the assets system.

See Resources & Assets.

LoadFontFromFile

(path: str) -> Font
(path: str, size: float) -> Font
(path: str, size: float, resolution: int) -> Font
(path: str, size: float, resolution: int, padding: int) -> Font
(path: str, size: float, resolution: int, padding: int, glyphs: str) -> Font

Load a TrueType (TTF) font from the local filesystem.

See Resources & Assets.

LoadForwardPipelineAAAConfigFromAssets

(path: str, config: ForwardPipelineAAAConfig) -> bool

LoadForwardPipelineAAAConfigFromFile

(path: str, config: ForwardPipelineAAAConfig) -> bool

LoadGIF

(pict: Picture, path: str) -> bool

Load a Picture in GIF file format.

LoadJPG

(pict: Picture, path: str) -> bool

Load a Picture in JPEG file format.

LoadJsonFromAssets

(name: str) -> JSON

Load a JSON from the assets system.

See Resources & Assets.

LoadJsonFromFile

(path: str) -> JSON

Load a JSON from the local filesystem.

LoadModelFromAssets

(name: str) -> Model

Load a render model from the assets system.

See DrawModel and Resources & Assets.

LoadModelFromFile

(path: str) -> Model

Load a render model from the local filesystem.

LoadOGGSoundAsset

(name: str) -> SoundRef

LoadOGGSoundFile

(path: str) -> SoundRef

LoadPNG

(pict: Picture, path: str) -> bool

Load a Picture in PNG file format.

LoadPSD

(pict: Picture, path: str) -> bool

Load a Picture in PSD file format.

LoadPicture

(pict: Picture, path: str) -> bool

Load a Picture content from the filesystem.

LoadPipelineProgramFromAssets

(name: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgram

Load a pipeline shader program from the assets system.

See Resources & Assets.

LoadPipelineProgramFromFile

(path: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgram

Load a pipeline shader program from the local filesystem.

LoadPipelineProgramRefFromAssets

(name: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgramRef

LoadPipelineProgramRefFromFile

(path: str, resources: PipelineResources, pipeline: PipelineInfo) -> PipelineProgramRef

LoadProgramFromAssets

(name: str) -> ProgramHandle
(vertex_shader_name: str, fragment_shader_name: str) -> ProgramHandle

Load a shader program from the assets system.

See Resources & Assets.

LoadProgramFromFile

(path: str) -> ProgramHandle
(vertex_shader_path: str, fragment_shader_path: str) -> ProgramHandle

Load a shader program from the local filesystem.

LoadSceneBinaryFromAssets

(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

Load a scene in binary format from the assets system. Loaded content is added to the existing scene content.

See Resources & Assets.

LoadSceneBinaryFromDataAndAssets

(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneBinaryFromDataAndFile

(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(data: Data, name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneBinaryFromFile

(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

Load a scene in binary format from the local filesystem. Loaded content is added to the existing scene content.

LoadSceneFromAssets

(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneFromFile

(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

LoadSceneJsonFromAssets

(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(name: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

Load a scene in JSON format from the assets system. Loaded content is added to the existing scene content.

See Resources & Assets.

LoadSceneJsonFromFile

(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo) -> bool
(path: str, scene: Scene, resources: PipelineResources, pipeline: PipelineInfo, flags: LoadSaveSceneFlags) -> bool

Load a scene in JSON format from the local filesystem. Loaded content is added to the existing scene content.

LoadTGA

(pict: Picture, path: str) -> bool

Load a Picture in TGA file format.

LoadTextureFlagsFromAssets

(name: str) -> TextureFlags

Load texture flags in the texture metafile from the assets system.

See Resources & Assets.

LoadTextureFlagsFromFile

(path: str) -> TextureFlags

Load texture flags in the texture metafile from the local filesystem.

LoadTextureFromAssets

(path: str, flags: TextureFlags) -> Texture, TextureInfo
(path: str, flags: int, resources: PipelineResources) -> TextureRef

Load a texture from the assets system.

  • When not using pipeline resources the texture informations are returned directly.
  • When using pipeline resources the texture informations can be retrieved from the PipelineResources object.

See Resources & Assets.

LoadTextureFromFile

(path: str, flags: TextureFlags) -> Texture, TextureInfo
(path: str, flags: int, resources: PipelineResources) -> TextureRef

Load a texture from the local filesystem.

  • When not using pipeline resources the texture informations are returned directly.
  • When using pipeline resources the texture informations can be retrieved from the PipelineResources object.

LoadWAVSoundAsset

(name: str) -> SoundRef

Load a sound in WAV format from the assets system and return a reference to it.

See Resources & Assets.

LoadWAVSoundFile

(path: str) -> SoundRef

Load a sound in WAV format from the local filesystem and return a reference to it.

Log

(msg: str) -> None
(msg: str, details: str) -> None

MakeForwardPipelineLinearLight

(world: Mat4, diffuse: Color, specular: Color) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4, priority: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4, priority: float, shadow_type: ForwardPipelineShadowType) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, pssm_split: Vec4, priority: float, shadow_type: ForwardPipelineShadowType, shadow_bias: float) -> ForwardPipelineLight

Create a forward pipeline linear light.

See ForwardPipelineLights, PrepareForwardPipelineLights and [SubmitModelToForwardPipeline].

MakeForwardPipelinePointLight

(world: Mat4, diffuse: Color, specular: Color) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, priority: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, priority: float, shadow_type: ForwardPipelineShadowType) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, priority: float, shadow_type: ForwardPipelineShadowType, shadow_bias: float) -> ForwardPipelineLight

Create a forward pipeline point light.

See ForwardPipelineLights, PrepareForwardPipelineLights and [SubmitModelToForwardPipeline].

MakeForwardPipelineSpotLight

(world: Mat4, diffuse: Color, specular: Color) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float, priority: float) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float, priority: float, shadow_type: ForwardPipelineShadowType) -> ForwardPipelineLight
(world: Mat4, diffuse: Color, specular: Color, radius: float, inner_angle: float, outer_angle: float, priority: float, shadow_type: ForwardPipelineShadowType, shadow_bias: float) -> ForwardPipelineLight

Create a forward pipeline spot light.

See ForwardPipelineLights, PrepareForwardPipelineLights and [SubmitModelToForwardPipeline].

MakeFrustum

(projection: Mat44) -> Frustum
(projection: Mat44, mtx: Mat4) -> Frustum

Create a projection frustum. This object can then be used to perform culling using TestVisibility.

# Compute a perspective matrix
proj = hg.ComputePerspectiveProjectionMatrix(0.1, 1000, hg.FovToZoomFactor(math.pi/4), 1280/720)
# Make a frustum from this projection matrix
frustum = hg.MakeFrustum(proj)

MakePlane

(p: Vec3, n: Vec3) -> Vec4
(p: Vec3, n: Vec3, m: Mat4) -> Vec4

Geometrical plane in 3D space.

  • p: a point lying on the plane.
  • n: the plane normal.
  • m: an affine transformation matrix that will be applied to p and n.

MakeRectFromWidthHeight

(x: float, y: float, w: float, h: float) -> Rect
(x: int, y: int, w: int, h: int) -> IntRect

Make a rectangle from width and height.

MakeUniformSetTexture

(name: str, texture: Texture, stage: int) -> UniformSetTexture

Create a uniform set texture object.

This object can be added to a UniformSetTextureList to control the shader program uniform values for a subsequent call to DrawModel.

MakeUniformSetValue

(name: str, v: float) -> UniformSetValue
(name: str, v: Vec2) -> UniformSetValue
(name: str, v: Vec3) -> UniformSetValue
(name: str, v: Vec4) -> UniformSetValue
(name: str, v: Mat3) -> UniformSetValue
(name: str, v: Mat4) -> UniformSetValue
(name: str, v: Mat44) -> UniformSetValue

Create a uniform set value object.

This object can be added to a UniformSetValueList to control the shader program uniform values for a subsequent call to DrawModel.

MakeVec3

(v: Vec4) -> Vec3

Make a Vec3 from a Vec4. The input vector w component is discarded.

MakeVertex

(pos: Vec3) -> Vertex
(pos: Vec3, nrm: Vec3) -> Vertex
(pos: Vec3, nrm: Vec3, uv0: Vec2) -> Vertex
(pos: Vec3, nrm: Vec3, uv0: Vec2, color0: Color) -> Vertex

MakeVideoStreamer

(module_path: str) -> IVideoStreamer

Mat3LookAt

(front: Vec3) -> Mat3
(front: Vec3, up: Vec3) -> Mat3

Return a rotation matrix looking down the provided vector. The input vector does not need to be normalized.

Mat4LookAt

(position: Vec3, at: Vec3) -> Mat4
(position: Vec3, at: Vec3, scale: Vec3) -> Mat4

Return a look at matrix whose orientation points at the specified position.

Mat4LookAtUp

(position: Vec3, at: Vec3, up: Vec3) -> Mat4
(position: Vec3, at: Vec3, up: Vec3, scale: Vec3) -> Mat4

Return a look at matrix whose orientation points at the specified position and up direction.

Mat4LookToward

(position: Vec3, direction: Vec3) -> Mat4
(position: Vec3, direction: Vec3, scale: Vec3) -> Mat4

Return a look at matrix whose orientation points toward the specified direction.

Mat4LookTowardUp

(position: Vec3, direction: Vec3, up: Vec3) -> Mat4
(position: Vec3, direction: Vec3, up: Vec3, scale: Vec3) -> Mat4

Return a look at matrix whose orientation points toward the specified directions.

Max

(a: Vec2, b: Vec2) -> Vec2
(a: iVec2, b: iVec2) -> iVec2
(a: Vec3, b: Vec3) -> Vec3
(a: float, b: float) -> float
(a: int, b: int) -> int

Return a vector whose elements are the maximum of each of the two specified vectors.

Min

(a: Vec2, b: Vec2) -> Vec2
(a: iVec2, b: iVec2) -> iVec2
(a: Vec3, b: Vec3) -> Vec3
(a: float, b: float) -> float
(a: int, b: int) -> int

Return a vector whose elements are the minimum of each of the two specified vectors.

MinMaxFromPositionSize

(position: Vec3, size: Vec3) -> MinMax

Set min = p - size/2 and max = p + size/2.

MkDir

(path: str) -> bool
(path: str, permissions: int) -> bool

Create a new directory.

See MkTree.

MkTree

(path: str) -> bool
(path: str, permissions: int) -> bool

Create a directory tree on the local filesystem. This function is recursive and creates each missing directory in the path.

See MkDir.

Mm

(mm: float) -> float

Convert a value in millimeters to the Harfang internal unit system.

See Coordinates and Units System.

Ms

(milliseconds: float) -> float

Convert a value in milliseconds to the Harfang internal unit system.

See Coordinates and Units System.

Mtr

(m: float) -> float

Convert a value in meters to the Harfang internal unit system.

See Coordinates and Units System.

NewFullscreenWindow

(monitor: Monitor, mode_index: int) -> Window
(monitor: Monitor, mode_index: int, rotation: MonitorRotation) -> Window
(title: str, monitor: Monitor, mode_index: int) -> Window
(title: str, monitor: Monitor, mode_index: int, rotation: MonitorRotation) -> Window

Create a new fullscreen window.

NewIsoSurface

(width: int, height: int, depth: int) -> IsoSurface

Return a new iso-surface object.

See IsoSurfaceSphere to draw to an iso-surface and IsoSurfaceToModel to draw it.

NewWindow

(width: int, height: int) -> Window
(width: int, height: int, bpp: int) -> Window
(width: int, height: int, bpp: int, visibility: WindowVisibility) -> Window
(title: str, width: int, height: int) -> Window
(title: str, width: int, height: int, bpp: int) -> Window
(title: str, width: int, height: int, bpp: int, visibility: WindowVisibility) -> Window

Create a new window.

NewWindowFrom

(handle: VoidPointer) -> Window

Wrap a native window handle in a Window object.

Normalize

(v: Vec2) -> Vec2
(v: iVec2) -> iVec2
(v: Vec4) -> Vec4
(q: Quaternion) -> Quaternion
(m: Mat3) -> Mat3
(v: Vec3) -> Vec3

Return the input vector scaled so that its length is one.

NormalizePath

(path: str) -> str

Normalize a path according to the following conventions:

  • Replace all whitespaces by underscores.

Offset

(rect: Rect, x: float, y: float) -> Rect
(rect: IntRect, x: int, y: int) -> IntRect

Offset a rectangle by the specified amount of units.

Open

(path: str) -> File

Open a file in binary mode.

See OpenText, OpenWrite, OpenWriteText

OpenFileDialog

(title: str, filters: FileFilterList, file: str) -> bool, str
(title: str, filters: FileFilterList, file: str, initial_dir: str) -> bool, str

Open a native OpenFile dialog.

OpenFolderDialog

(title: str, folder_name: str) -> bool, str
(title: str, folder_name: str, initial_dir: str) -> bool, str

Open a native OpenFolder dialog.

OpenTemp

(template_path: str) -> File

Return a handle to a temporary file on the local filesystem.

OpenText

(path: str) -> File

Open a file as text. Return a handle to the opened file.

See Open, OpenWrite, OpenWriteText

OpenVRCreateEyeFrameBuffer

() -> OpenVREyeFrameBuffer
(aa: OpenVRAA) -> OpenVREyeFrameBuffer

Creates and returns an Virtual Reality eye framebuffer, with the desired level of anti-aliasing. This function must be invoked twice, for the left and right eyes.

OpenVRDestroyEyeFrameBuffer

(eye_fb: OpenVREyeFrameBuffer) -> None

Destroy an eye framebuffer.

OpenVRGetColorTexture

(eye: OpenVREyeFrameBuffer) -> Texture

Return the color texture attached to an eye framebuffer.

OpenVRGetDepthTexture

(eye: OpenVREyeFrameBuffer) -> Texture

Return the depth texture attached to an eye framebuffer.

OpenVRGetFrameBufferSize

() -> iVec2

OpenVRGetState

(body: Mat4, znear: float, zfar: float) -> OpenVRState

Returns the current OpenVR state including the body, head and eye transformations.

OpenVRInit

() -> bool

Initialize OpenVR. Start the device display, its controllers and trackers.

OpenVRIsHMDMounted

() -> bool

OpenVRPostPresentHandoff

() -> None

Signal to the OpenVR compositor that it can immediatly start processing the current frame.

OpenVRShutdown

() -> None

Shutdown OpenVR.

OpenVRStateToViewState

(state: OpenVRState) -> ViewState, ViewState

Compute the left and right eye view states from an OpenVR state.

See OpenVRGetState.

OpenVRSubmitFrame

(left: OpenVREyeFrameBuffer, right: OpenVREyeFrameBuffer) -> None

Submit the left and right eye textures to the OpenVR compositor.

See OpenVRCreateEyeFrameBuffer.

OpenWrite

(path: str) -> File

Open a file as binary in write mode.

See Open, OpenText, OpenWriteText

OpenWriteText

(path: str) -> File

Open a file as text in write mode.

See Open, OpenText, OpenWrite

OpenXRCreateEyeFrameBuffer

() -> OpenXREyeFrameBufferList
(aa: OpenXRAA) -> OpenXREyeFrameBufferList

OpenXRDestroyEyeFrameBuffer

(eye_fb: OpenXREyeFrameBuffer) -> None

OpenXRFinishSubmitFrameBuffer

(frameInfo: OpenXRFrameInfo) -> None

OpenXRGetColorTexture

(eye: OpenXREyeFrameBuffer) -> Texture

OpenXRGetColorTextureFromId

(eyes: OpenXREyeFrameBufferList, frame_info: OpenXRFrameInfo, index: int) -> Texture

OpenXRGetDepthTexture

(eye: OpenXREyeFrameBuffer) -> Texture

OpenXRGetDepthTextureFromId

(eyes: OpenXREyeFrameBufferList, frame_info: OpenXRFrameInfo, index: int) -> Texture

OpenXRGetEyeGaze

() -> bool, Mat4

OpenXRGetHeadPose

() -> bool, Mat4

OpenXRGetInstanceInfo

() -> str

OpenXRInit

() -> bool
(ExtensionsFlagsEnable: int) -> bool

OpenXRShutdown

() -> None

OpenXRSubmitSceneToForwardPipeline

(cam_offset: Mat4, update_controllers: update_controllersCallback, draw_scene: draw_sceneCallback, view_id: int, z_near: float, z_far: float) -> OpenXRFrameInfo, int

Orthonormalize

(m: Mat3) -> Mat3
(m: Mat4) -> Mat4

Return a matrix where the row vectors form an orthonormal basis. All vectors are normalized and perpendicular to each other.

Overlap

(minmax_a: MinMax, minmax_b: MinMax) -> bool
(minmax_a: MinMax, minmax_b: MinMax, axis: Axis) -> bool

Return true if the provided volume overlaps with this volume, false otherwise. The test can optionally be restricted to a specific axis.

PathJoin

(elements: StringList) -> str

Return a file path from a set of string elements.

PathStartsWith

(path: str, with: str) -> bool

Test if the provided path starts with the provided prefix.

PathStripPrefix

(path: str, prefix: str) -> str

Return a copy of the input path stripped of the provided prefix.

PathStripSuffix

(path: str, suffix: str) -> str

Return a copy of the input path stripped of the provided suffix.

PathToDisplay

(path: str) -> str

Format a path for display.

PauseSource

(source: SourceRef) -> None

Pause a playing audio source.

See PlayStereo and PlaySpatialized.

PlaySpatialized

(snd: SoundRef, state: SpatializedSourceState) -> SourceRef

Start playing a spatialized sound. Return a handle to the started source.

PlayStereo

(snd: SoundRef, state: StereoSourceState) -> SourceRef

Start playing a stereo sound. Return a handle to the started source.

PrepareForwardPipelineLights

(lights: ForwardPipelineLightList) -> ForwardPipelineLights

Prepare a list of forward pipeline lights into a structure ready for submitting to the forward pipeline.

Lights are sorted by priority/type and the most important lights are assigned to available lighting slot of the forward pipeline.

See [SubmitModelToForwardPipeline].

PrepareSceneForwardPipelineCommonRenderData

(view_id: int, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId) -> int, SceneForwardPipelinePassViewId
(view_id: int, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId, debug_name: str) -> int, SceneForwardPipelinePassViewId

Prepare the common render data to submit a scene to the forward pipeline.

Note: When rendering multiple views of the same scene, common data only needs to be prepared once.

See PrepareSceneForwardPipelineViewDependentRenderData.

PrepareSceneForwardPipelineViewDependentRenderData

(view_id: int, view_state: ViewState, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId) -> int, SceneForwardPipelinePassViewId
(view_id: int, view_state: ViewState, scene: Scene, render_data: SceneForwardPipelineRenderData, pipeline: ForwardPipeline, resources: PipelineResources, views: SceneForwardPipelinePassViewId, debug_name: str) -> int, SceneForwardPipelinePassViewId

Prepare the view dependent render data to submit a scene to the forward pipeline.

See PrepareSceneForwardPipelineCommonRenderData.

PrintProfilerFrame

(profiler_frame: ProfilerFrame) -> None

Print a profiler frame to the console. Print all sections in the frame, their duration and event count.

ProcessLoadQueues

(res: PipelineResources) -> int
(res: PipelineResources, t_budget: int) -> int

ProcessModelLoadQueue

(res: PipelineResources) -> int
(res: PipelineResources, t_budget: int) -> int

ProcessTextureLoadQueue

(res: PipelineResources) -> int
(res: PipelineResources, t_budget: int) -> int

Process the texture load queue. This function must be called to load textures queued while loading a scene or model with the LSSF_QueueTextureLoads flag.

See LoadSaveSceneFlags.

ProjectOrthoToClipSpace

(proj: Mat44, view: Vec3) -> bool, Vec3

ProjectOrthoToScreenSpace

(proj: Mat44, view: Vec3, resolution: Vec2) -> bool, Vec3

ProjectToClipSpace

(proj: Mat44, view: Vec3) -> bool, Vec3

Project a world position to the clipping space.

ProjectToScreenSpace

(proj: Mat44, view: Vec3, resolution: Vec2) -> bool, Vec3

Project a world position to screen coordinates.

ProjectZToClipSpace

(z: float, proj: Mat44) -> float

Project a depth value to clip space.

Quantize

(v: float, q: float) -> float

Return the provided value quantized to the specified step.

QuaternionFromAxisAngle

(angle: float, axis: Vec3) -> Quaternion

Return a quaternion rotation from a 3d axis and a rotation around that axis.

QuaternionFromEuler

(x: float, y: float, z: float) -> Quaternion
(x: float, y: float, z: float, rotation_order: RotationOrder) -> Quaternion
(euler: Vec3) -> Quaternion
(euler: Vec3, rotation_order: RotationOrder) -> Quaternion

Return a quaternion 3d rotation from its Euler vector representation.

QuaternionFromMatrix3

(m: Mat3) -> Quaternion

Return a quaternion rotation from its Mat3 representation.

QuaternionLookAt

(at: Vec3) -> Quaternion

Return a quaternion 3d rotation oriented toward the specified position when sitting on the world’s origin {0, 0, 0}.

RGBA32

(r: int, g: int, b: int) -> int
(r: int, g: int, b: int, a: int) -> int

Create a 32 bit integer RGBA color.

Rad

(radians: float) -> float

Convert an angle in radians to the engine unit system.

See Coordinates and Units System.

Rad3

(x: float, y: float, z: float) -> Vec3

Convert a triplet of angles in radians to the engine unit system.

See Coordinates and Units System.

RadianToDegree

(radians: float) -> float

Convert an angle in radians to degrees.

Rand

() -> int
(range: int) -> int

Return a random integer value in the provided range, default range is [0;65535].

See FRand to generate a random floating point value.

RandomVec3

(min: float, max: float) -> Vec3
(min: Vec3, max: Vec3) -> Vec3

Return a vector with each component randomized in the inclusive provided range.

RandomVec4

(min: float, max: float) -> Vec4
(min: Vec4, max: Vec4) -> Vec4

Return a vector with each component randomized in the inclusive provided range.

ReadFloat

(file: File) -> float

Read a binary 32 bit floating point value from a local file.

ReadGamepad

() -> GamepadState
(name: str) -> GamepadState

Read the current state of a named gamepad. If no name is passed, default is implied.

See GetGamepadNames.

ReadJoystick

() -> JoystickState
(name: str) -> JoystickState

ReadKeyboard

() -> KeyboardState
(name: str) -> KeyboardState

Read the current state of a named keyboard. If no name is passed, default is implied.

See GetKeyboardNames.

ReadMouse

() -> MouseState
(name: str) -> MouseState

Read the current state of a named mouse. If no name is passed, default is implied.

See GetMouseNames.

ReadString

(file: File) -> str

Read a binary string from a local file.

Strings are stored as a uint32_t length field followed by the string content in UTF-8.

ReadUInt16

(file: File) -> int

Read a binary 16 bit unsigned integer value from a local file.

ReadUInt32

(file: File) -> int

Read a binary 32 bit unsigned integer value from a local file.

ReadUInt8

(file: File) -> int

Read a binary 8 bit unsigned integer value from a local file.

ReadVRController

() -> VRControllerState
(name: str) -> VRControllerState

Read the current state of a named VR controller. If no name is passed, default is implied.

See GetVRControllerNames.

ReadVRGenericTracker

() -> VRGenericTrackerState
(name: str) -> VRGenericTrackerState

Read the current state of a named VR generic tracked. If no name is passed, default is implied.

See GetVRGenericTrackerNames.

Reflect

(v: Vec3, n: Vec3) -> Vec3

Return the input vector reflected around the specified normal.

Refract

(v: Vec3, n: Vec3) -> Vec3
(v: Vec3, n: Vec3, k_in: float) -> Vec3
(v: Vec3, n: Vec3, k_in: float, k_out: float) -> Vec3

Return the input vector refracted around the provided surface normal.

  • k_in: IOR of the medium the vector is exiting.
  • k_out: IOR of the medium the vector is entering.

RemoveAssetsFolder

(path: str) -> None

Remove a folder from the assets system.

See Resources & Assets.

RemoveAssetsPackage

(path: str) -> None

Remove a package from the assets system.

See Resources & Assets.

RenderInit

(window: Window) -> bool
(window: Window, type: RendererType) -> bool
(width: int, height: int, reset_flags: ResetFlags) -> Window
(width: int, height: int, reset_flags: ResetFlags, format: TextureFormat) -> Window
(width: int, height: int, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window
(width: int, height: int, type: RendererType) -> Window
(width: int, height: int, type: RendererType, reset_flags: ResetFlags) -> Window
(width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat) -> Window
(width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window
(window_title: str, width: int, height: int, reset_flags: ResetFlags) -> Window
(window_title: str, width: int, height: int, reset_flags: ResetFlags, format: TextureFormat) -> Window
(window_title: str, width: int, height: int, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window
(window_title: str, width: int, height: int, type: RendererType) -> Window
(window_title: str, width: int, height: int, type: RendererType, reset_flags: ResetFlags) -> Window
(window_title: str, width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat) -> Window
(window_title: str, width: int, height: int, type: RendererType, reset_flags: ResetFlags, format: TextureFormat, debug_flags: DebugFlags) -> Window

Initialize the render system.

To change the states of the render system afterward use RenderReset.

RenderReset

(width: int, height: int) -> None
(width: int, height: int, flags: ResetFlags) -> None
(width: int, height: int, flags: ResetFlags, format: TextureFormat) -> None

Change the states of the render system at runtime.

RenderResetToWindow

(win: Window, width: int, height: int) -> bool, int, int
(win: Window, width: int, height: int, reset_flags: int) -> bool, int, int

Resize the renderer backbuffer to the provided window client area dimensions. Return true if a reset was needed and carried out.

RenderShutdown

() -> None

Shutdown the render system.

ResetClock

() -> None

Reset the elapsed time counter.

Reverse

(a: Vec2) -> Vec2
(a: iVec2) -> iVec2
(v: Vec3) -> Vec3

Return the provided vector pointing in the opposite direction.

ReverseRotationOrder

(rotation_order: RotationOrder) -> RotationOrder

Return the rotation order processing each axis in the reverse order of the input rotation order.

Rewind

(file: File) -> None

Rewind the read/write cursor of an open file.

RmDir

(path: str) -> bool

Remove an empty folder on the local filesystem.

See RmTree.

RmTree

(path: str) -> bool

Remove a folder on the local filesystem.

Warning: This function will through all subfolders and erase all files and folders in the target folder.

RotationMat2D

(angle: float, pivot: Vec2) -> Mat3

Return a 2D rotation matrix by a radians around the specified pivot point.

RotationMat3

(x: float, y: float, z: float) -> Mat3
(x: float, y: float, z: float, rotation_order: RotationOrder) -> Mat3
(euler: Vec3) -> Mat3
(euler: Vec3, rotation_order: RotationOrder) -> Mat3

Return a 3x3 rotation matrix.

RotationMat4

(euler: Vec3) -> Mat4
(euler: Vec3, order: RotationOrder) -> Mat4

Return a 4x3 rotation matrix from euler angles. The default rotation order is YXZ.

RotationMatX

(angle: float) -> Mat3

Return a 3x3 rotation matrix around the world X axis {1, 0, 0}.

RotationMatXY

(x: float, y: float) -> Mat3

Return a 3x3 rotation matrix around the X axis followed by a rotation around the Y axis.

RotationMatXYZ

(x: float, y: float, z: float) -> Mat3

Return a 3x3 rotation matrix around the X axis followed by a rotation around the Y axis then a rotation around the Z axis.

RotationMatXZY

(x: float, y: float, z: float) -> Mat3

Return a 3x3 rotation matrix around the X axis followed by a rotation around the Z axis then a rotation around the Y axis.

RotationMatY

(angle: float) -> Mat3

Return a 3x3 rotation matrix around the world Y axis {0, 1, 0}.

RotationMatYXZ

(x: float, y: float, z: float) -> Mat3

Return a 3x3 rotation matrix around the Y axis followed by a rotation around the X axis then a rotation around the Z axis.

RotationMatYZX

(x: float, y: float, z: float) -> Mat3

Return a 3x3 rotation matrix around the Y axis followed by a rotation around the Z axis then a rotation around the X axis.

RotationMatZ

(angle: float) -> Mat3

Return a 3x3 rotation matrix around the world Z axis {0, 0, 1}.

RotationMatZXY

(x: float, y: float, z: float) -> Mat3

Return a 3x3 rotation matrix around the Z axis followed by a rotation around the X axis then a rotation around the Y axis.

RotationMatZYX

(x: float, y: float, z: float) -> Mat3

Return a 3x3 rotation matrix around the Z axis followed by a rotation around the Y axis then a rotation around the X axis.

SRanipalGetState

() -> SRanipalState

Return the current SRanipal device state.

SRanipalInit

() -> bool

Initial the SRanipal eye detection SDK.

SRanipalIsViveProEye

() -> bool

Return true if the eye detection device in use is Vive Pro Eye.

SRanipalLaunchEyeCalibration

() -> None

Launch the eye detection calibration sequence.

SRanipalShutdown

() -> None

Shutdown the SRanipal eye detection SDK.

SaveBMP

(pict: Picture, path: str) -> bool

Save a Picture in BMP file format.

SaveDataToFile

(path: str, data: Data) -> bool

SaveFileDialog

(title: str, filters: FileFilterList, file: str) -> bool, str
(title: str, filters: FileFilterList, file: str, initial_dir: str) -> bool, str

Open a native SaveFile dialog.

SaveForwardPipelineAAAConfigToFile

(path: str, config: ForwardPipelineAAAConfig) -> bool

SaveGeometryToFile

(path: str, geo: Geometry) -> bool

Save a geometry to the local filesystem.

Note that in order to render a geometry it must have been converted to model by the asset compiler.

See GeometryBuilder and ModelBuilder.

SaveJsonToFile

(js: JSON, path: str) -> bool

Save a JSON object to the local filesystem.

SavePNG

(pict: Picture, path: str) -> bool

Save a Picture in PNG file format.

SaveSceneBinaryToData

(data: Data, scene: Scene, resources: PipelineResources) -> bool
(data: Data, scene: Scene, resources: PipelineResources, flags: LoadSaveSceneFlags) -> bool

SaveSceneBinaryToFile

(path: str, scene: Scene, resources: PipelineResources) -> bool
(path: str, scene: Scene, resources: PipelineResources, flags: LoadSaveSceneFlags) -> bool

SaveSceneJsonToFile

(path: str, scene: Scene, resources: PipelineResources) -> bool
(path: str, scene: Scene, resources: PipelineResources, flags: LoadSaveSceneFlags) -> bool

SaveTGA

(pict: Picture, path: str) -> bool

Save a Picture in TGA file format.

ScaleMat3

(S: Vec2) -> Mat3
(S: Vec3) -> Mat3

Return a 3x3 scale matrix from a 2D vector.

ScaleMat4

(scale: Vec3) -> Mat4
(scale: float) -> Mat4

Return a 4x3 scale matrix from the parameter scaling vector.

SceneClearSystems

(scene: Scene) -> None
(scene: Scene, vm: SceneLuaVM) -> None
(scene: Scene, physics: SceneBullet3Physics) -> None
(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> None

Clear scene and all optional systems.

SceneGarbageCollectSystems

(scene: Scene) -> int
(scene: Scene, vm: SceneLuaVM) -> int
(scene: Scene, physics: SceneBullet3Physics) -> int
(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> int

Garbage collect a scene and all its optional systems.

SceneSyncToSystemsFromAssets

(scene: Scene, vm: SceneLuaVM) -> None
(scene: Scene, physics: SceneBullet3Physics) -> None
(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> None

Synchronize optional systems (eg. physics or script) states with the scene states. Load resources from the assets system if required.

See Resources & Assets.

SceneSyncToSystemsFromFile

(scene: Scene, vm: SceneLuaVM) -> None
(scene: Scene, physics: SceneBullet3Physics) -> None
(scene: Scene, physics: SceneBullet3Physics, vm: SceneLuaVM) -> None

Synchronize optional systems (eg. physics or script) states with the scene states. Load resources from the local filesystem if required.

See Resources & Assets.

SceneUpdateSystems

(scene: Scene, clocks: SceneClocks, dt: int) -> None
(scene: Scene, clocks: SceneClocks, dt: int, vm: SceneLuaVM) -> None
(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, step: int, max_physics_step: int) -> None
(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, step: int, max_physics_step: int, vm: SceneLuaVM) -> None
(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, contacts: NodePairContacts, step: int, max_physics_step: int) -> None
(scene: Scene, clocks: SceneClocks, dt: int, physics: SceneBullet3Physics, contacts: NodePairContacts, step: int, max_physics_step: int, vm: SceneLuaVM) -> None

Update a scene and all its optional systems.

ScreenSpaceToClipSpace

(screen: Vec3, resolution: Vec2) -> Vec3

Transform a screen position to clip space.

Sec

(seconds: float) -> float

Convert a value in seconds to the Harfang internal unit system.

See Coordinates and Units System.

Seed

(seed: int) -> None

Set the starting seed of the pseudo-random number generator.

Seek

(file: File, offset: int, mode: SeekMode) -> bool

Move the handle cursor to a specific position in the file.

SendVRControllerHapticPulse

(duration: int) -> None
(duration: int, name: str) -> None

Send an haptic pulse to a named VR controller.

See GetVRControllerNames.

SetAxises

(m: Mat3, X: Vec3, Y: Vec3, Z: Vec3) -> None

Inject X, Y and Z axises into a 3x3 matrix.

SetColumn

(m: Mat3, n: int, column: Vec3) -> None
(m: Mat4, n: int, v: Vec3) -> None
(m: Mat44, idx: int, v: Vec4) -> None

Returns the nth column.

SetHeight

(rect: Rect, height: float) -> None
(rect: IntRect, height: int) -> None

Set a rectangle height.

SetJsonValue

(js: JSON, key: str, value: str) -> None
(js: JSON, key: str, value: bool) -> None
(js: JSON, key: str, value: int) -> None
(js: JSON, key: str, value: float) -> None

Set a JSON key value.

SetListener

(world: Mat4, velocity: Vec3) -> None

Set the listener transformation and velocity for spatialization by the audio system.

SetLogDetailed

(is_detailed: bool) -> None

Display the details field of log outputs.

SetLogLevel

(log_level: LogLevel) -> None

Control which log levels should be displayed.

See Log, Warn, Error and Debug.

SetMaterialAlphaCut

(mat: Material, enable: bool) -> None

SetMaterialAmbientUsesUV1

(mat: Material, enable: bool) -> None

SetMaterialBlendMode

(mat: Material, mode: BlendMode) -> None

Set material blend mode.

SetMaterialDepthTest

(mat: Material, test: DepthTest) -> None

Set material depth test.

SetMaterialDiffuseUsesUV1

(mat: Material, enable: bool) -> None

SetMaterialFaceCulling

(mat: Material, culling: FaceCulling) -> None

Set material face culling.

SetMaterialNormalMapInWorldSpace

(mat: Material, enable: bool) -> None

SetMaterialProgram

(mat: Material, program: PipelineProgramRef) -> None

Set material pipeline program.

You should call UpdateMaterialPipelineProgramVariant after changing a material pipeline program so that the correct variant is selected according to the material states.

SetMaterialSkinning

(mat: Material, enable: bool) -> None

SetMaterialSpecularUsesUV1

(mat: Material, enable: bool) -> None

SetMaterialTexture

(mat: Material, name: str, texture: TextureRef, stage: int) -> None

Set a material uniform texture and texture stage.

Note: The texture stage specified should match the uniform declaration in the shader program.

SetMaterialTextureRef

(mat: Material, name: str, texture: TextureRef) -> None

Set a material uniform texture reference.

See PipelineResources.

SetMaterialValue

(mat: Material, name: str, v: float) -> None
(mat: Material, name: str, v: Vec2) -> None
(mat: Material, name: str, v: Vec3) -> None
(mat: Material, name: str, v: Vec4) -> None
(mat: Material, name: str, m: Mat3) -> None
(mat: Material, name: str, m: Mat4) -> None
(mat: Material, name: str, m: Mat44) -> None

Set a material uniform value.

SetMaterialWriteRGBA

(mat: Material, write_r: bool, write_g: bool, write_b: bool, write_a: bool) -> None

Set a material color write mask.

SetMaterialWriteZ

(mat: Material, enable: bool) -> None

Set a material depth write mask.

SetRenderDebug

(flags: DebugFlags) -> None

Set render system debug flags.

SetRow

(m: Mat3, n: int, row: Vec3) -> None
(m: Mat4, n: int, v: Vec4) -> None
(m: Mat44, idx: int, v: Vec4) -> None

Sets the nth row of a matrix.

SetS

(m: Mat4, scale: Vec3) -> None

Shortcut for SetScale.

SetSaturation

(color: Color, saturation: float) -> Color

Return a copy of the input RGBA color with its saturation set to the specified value, alpha channel is left unmodified.

See ToHLS and FromHLS.

SetScale

(m: Mat3, S: Vec3) -> None
(m: Mat4, scale: Vec3) -> None

Set the scaling part of the transformation matrix.

SetSourcePanning

(source: SourceRef, panning: float) -> None

Set a playing audio source panning.

SetSourceRepeat

(source: SourceRef, repeat: SourceRepeat) -> None

Set audio source repeat mode.

SetSourceTimecode

(source: SourceRef, t: int) -> bool

Set timecode of the audio source.

SetSourceTransform

(source: SourceRef, world: Mat4, velocity: Vec3) -> None

Set a playing spatialized audio source transformation.

SetSourceVolume

(source: SourceRef, volume: float) -> None

Set audio source volume.

SetT

(m: Mat4, T: Vec3) -> None

Shortcut for SetTranslation.

SetTransform

(mtx: Mat4) -> None

Set the model matrix for the next drawn primitive.

If not called, model will be rendered with the identity model matrix.

SetTranslation

(m: Mat3, T: Vec3) -> None
(m: Mat3, T: Vec2) -> None
(m: Mat4, T: Vec3) -> None

Sets the 2D translation part, i.e. the first 2 elements of the last matrix row.

SetView2D

(id: int, x: int, y: int, res_x: int, res_y: int) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, znear: float, zfar: float) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, znear: float, zfar: float, flags: ClearFlags, color: Color, depth: float, stencil: int) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, znear: float, zfar: float, flags: ClearFlags, color: Color, depth: float, stencil: int, y_up: bool) -> None

High-level wrapper function to setup a view for 2D rendering.

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewClear

(view_id: int, flags: ClearFlags) -> None
(view_id: int, flags: ClearFlags, rgba: int) -> None
(view_id: int, flags: ClearFlags, rgba: int, depth: float) -> None
(view_id: int, flags: ClearFlags, rgba: int, depth: float, stencil: int) -> None
(view_id: int, flags: ClearFlags, col: Color) -> None
(view_id: int, flags: ClearFlags, col: Color, depth: float) -> None
(view_id: int, flags: ClearFlags, col: Color, depth: float, stencil: int) -> None

Set a view clear parameters.

See Drawing to Views.

SetViewFrameBuffer

(view_id: int, handle: FrameBufferHandle) -> None

Set view output framebuffer.

See Drawing to Views.

SetViewMode

(view_id: int, mode: ViewMode) -> None

Set view draw ordering mode.

SetViewOrthographic

(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, size: float) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, size: float, flags: ClearFlags, color: Color, depth: float, stencil: int) -> None

High-level wrapper function to setup a view for 3D orthographic rendering.

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewPerspective

(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, zoom_factor: float) -> None
(id: int, x: int, y: int, res_x: int, res_y: int, world: Mat4, znear: float, zfar: float, zoom_factor: float, flags: ClearFlags, color: Color, depth: float, stencil: int) -> None

High-level wrapper function to setup a view for 3D perspective rendering.

This function calls SetViewClear, SetViewRect then SetViewTransform.

SetViewRect

(view_id: int, x: int, y: int, w: int, h: int) -> None

SetViewTransform

(view_id: int, view: Mat4, proj: Mat44) -> None

Set view transforms, namely the view and projection matrices.

SetWidth

(rect: Rect, width: float) -> None
(rect: IntRect, width: int) -> None

Set a rectangle width.

SetWindowClientSize

(window: Window, width: int, height: int) -> bool

Set the window client size. The client area of a window excludes its decoration.

SetWindowPos

(window: Window, position: iVec2) -> bool

Set window position.

SetWindowTitle

(window: Window, title: str) -> bool

Set window title.

SetX

(m: Mat3, X: Vec3) -> None
(m: Mat4, X: Vec3) -> None
(rect: Rect, x: float) -> None
(rect: IntRect, x: int) -> None

Sets the first row.

SetY

(m: Mat3, Y: Vec3) -> None
(m: Mat4, Y: Vec3) -> None
(rect: Rect, y: float) -> None
(rect: IntRect, y: int) -> None

Sets the second row.

SetZ

(m: Mat3, Z: Vec3) -> None
(m: Mat4, Z: Vec3) -> None

Sets the third row.

ShowCursor

() -> None

Show the system mouse cursor.

See HideCursor.

Sign

(v: Vec3) -> Vec3

Returns a vector whose elements are -1 if the corresponding vector element is < 0 and 1 if it’s >= 0.

SkipClock

() -> None

Skip elapsed time since the last call to TickClock.

Sleep

(duration: int) -> None

Sleep the caller thread, this function will resume execution after waiting for at least the specified amount of time.

Slerp

(a: Quaternion, b: Quaternion, t: float) -> Quaternion

Interpolate between the rotation represented by two quaternions. The Spherical Linear Interpolation will always take the shortest path between the two rotations.

StopAllSources

() -> None

Stop all playing audio sources.

StopSource

(source: SourceRef) -> None

Stop a playing audio source.

StreamOGGAssetSpatialized

(name: str, state: SpatializedSourceState) -> SourceRef

StreamOGGAssetStereo

(name: str, state: StereoSourceState) -> SourceRef

StreamOGGFileSpatialized

(path: str, state: SpatializedSourceState) -> SourceRef

StreamOGGFileStereo

(path: str, state: StereoSourceState) -> SourceRef

StreamWAVAssetSpatialized

(name: str, state: SpatializedSourceState) -> SourceRef

Start an audio stream from a WAV file from the assets system.

See SetSourceTransform and Resources & Assets.

StreamWAVAssetStereo

(name: str, state: StereoSourceState) -> SourceRef

Start an audio stream from a WAV file from the assets system.

See Resources & Assets.

StreamWAVFileSpatialized

(path: str, state: SpatializedSourceState) -> SourceRef

Start an audio stream from a WAV file on the local filesystem.

See SetSourceTransform.

StreamWAVFileStereo

(path: str, state: StereoSourceState) -> SourceRef

Start an audio stream from a WAV file on the local filesystem.

See Resources & Assets.

StringToFile

(path: str, value: str) -> bool

Return the content of a file on the local filesystem as a string.

SubmitSceneToForwardPipeline

(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, frame_buffer: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, frame_buffer: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, views: SceneForwardPipelinePassViewId, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int) -> int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, views: SceneForwardPipelinePassViewId, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle) -> int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, render_data: SceneForwardPipelineRenderData, resources: PipelineResources, views: SceneForwardPipelinePassViewId, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle, debug_name: str) -> int

Submit a scene to a forward pipeline.

See PrepareSceneForwardPipelineCommonRenderData and PrepareSceneForwardPipelineViewDependentRenderData if you need to render the same scene from different points of view.

SubmitSceneToPipeline

(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, fb: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, view_state: ViewState, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle) -> SceneForwardPipelinePassViewId, int
(view_id: int, scene: Scene, rect: IntRect, fov_axis_is_horizontal: bool, pipeline: ForwardPipeline, resources: PipelineResources, aaa: ForwardPipelineAAA, aaa_config: ForwardPipelineAAAConfig, frame: int, frame_buffer: FrameBufferHandle, debug_name: str) -> SceneForwardPipelinePassViewId, int

See SubmitSceneToForwardPipeline.

SwapFileExtension

(path: str, ext: str) -> str

Return the input file path with its extension replaced.

Tell

(file: File) -> int

Return the current handle cursor position in bytes.

TestVisibility

(frustum: Frustum, count: int, points: Vec3) -> Visibility
(frustum: Frustum, count: int, points: Vec3, distance: float) -> Visibility
(frustum: Frustum, origin: Vec3, radius: float) -> Visibility
(frustum: Frustum, minmax: MinMax) -> Visibility

Test if a list of 3d points are inside or outside a Frustum.

TickClock

() -> int

Advance the engine clock and return the elapsed time since the last call to this function. See GetClock to retrieve the current clock.

See GetClockDt.

ToEuler

(q: Quaternion) -> Vec3
(q: Quaternion, rotation_order: RotationOrder) -> Vec3
(m: Mat3) -> Vec3
(m: Mat3, rotation_order: RotationOrder) -> Vec3

Convert a quaternion rotation to its Euler vector representation.

ToFloatRect

(rect: IntRect) -> Rect

Return an integer rectangle as a floating point rectangle.

ToHLS

(color: Color) -> Color

Convert input RGBA color to hue/luminance/saturation, alpha channel is left unmodified.

ToIntRect

(rect: Rect) -> IntRect

Return a floating point rectangle as an integer rectangle.

ToMatrix3

(q: Quaternion) -> Mat3

Convert a quaternion rotation to its Mat3 representation.

Touch

(view_id: int) -> None

Submit an empty primitive to the view.

See Frame.

TransformFrustum

(frustum: Frustum, mtx: Mat4) -> Frustum

Return the input frustum transformed by the provided world matrix.

TransformationMat4

(pos: Vec3, rot: Vec3) -> Mat4
(pos: Vec3, rot: Vec3, scale: Vec3) -> Mat4
(pos: Vec3, rot: Mat3) -> Mat4
(pos: Vec3, rot: Mat3, scale: Vec3) -> Mat4

Creates a 4x3 transformation matrix from the translation vector p, the 3x3 rotation Matrix m (or YXZ euler rotation vector e) and the scaling vector s.

This is a more efficient version of TranslationMat4(p) * ScaleMat4(s) * m

TranslationMat3

(T: Vec2) -> Mat3
(T: Vec3) -> Mat3

Return a 2D translation 3x3 matrix from the first 2 components (x,y) of the parameter vector.

TranslationMat4

(t: Vec3) -> Mat4

Return a 4x3 translation matrix from the parameter displacement vector.

Transpose

(m: Mat3) -> Mat3

Return the transpose of the input matrix.

For a pure rotation matrix this returns the opposite transformation so that M*MT=I.

time_from_day

(day: int) -> int

Convert days to time.

See Coordinates and Units System.

time_from_hour

(hour: int) -> int

Convert hours to time.

See Coordinates and Units System.

time_from_min

(min: int) -> int

Convert minutes to time.

See Coordinates and Units System.

time_from_ms

(ms: int) -> int

Convert milliseconds to time.

See Coordinates and Units System.

time_from_ms_f

(ms: float) -> int

Convert milliseconds to time.

See Coordinates and Units System.

time_from_ns

(ns: int) -> int

Convert nanoseconds to time.

See Coordinates and Units System.

time_from_sec

(sec: int) -> int

Convert seconds to time.

See Coordinates and Units System.

time_from_sec_f

(sec: float) -> int

Convert fractional seconds to time.

See Coordinates and Units System.

time_from_us

(us: int) -> int

Convert microseconds to time.

See Coordinates and Units System.

time_from_us_f

(us: float) -> int

Convert fractional microseconds to time.

See Coordinates and Units System.

time_now

() -> int

Return the current system time.

time_to_day

(t: int) -> int

Convert time to days.

time_to_hour

(t: int) -> int

Convert time to hours.

time_to_min

(t: int) -> int

Convert time to minutes.

time_to_ms

(t: int) -> int

Convert time to milliseconds.

time_to_ms_f

(t: int) -> float

Convert time to miliseconds.

time_to_ns

(t: int) -> int

Convert time to nanoseconds.

time_to_sec

(t: int) -> int

Convert time to seconds.

time_to_sec_f

(t: int) -> float

Convert time to fractional seconds.

time_to_string

(t: int) -> str

Return time as a human-readable string.

time_to_us

(t: int) -> int

Convert time to microseconds.

time_to_us_f

(t: int) -> float

Convert time to fractional microseconds.

Union

(minmax_a: MinMax, minmax_b: MinMax) -> MinMax
(minmax: MinMax, position: Vec3) -> MinMax

Compute the union of this bounding volume with another volume or a 3d position.

(path: str) -> bool

Remove a file from the local filesystem.

UnloadSound

(snd: SoundRef) -> None

Unload a sound from the audio system.

UnprojectFromClipSpace

(inv_proj: Mat44, clip: Vec3) -> bool, Vec3

Unproject a clip space position to view space.

UnprojectFromScreenSpace

(inv_proj: Mat44, screen: Vec3, resolution: Vec2) -> bool, Vec3

Unproject a screen space position to view space.

UnprojectOrthoFromClipSpace

(inv_proj: Mat44, clip: Vec3) -> bool, Vec3

UnprojectOrthoFromScreenSpace

(inv_proj: Mat44, screen: Vec3, resolution: Vec2) -> bool, Vec3

UpdateMaterialPipelineProgramVariant

(mat: Material, resources: PipelineResources) -> None

Select the proper pipeline program variant for the current material state.

UpdateTexture

(streamer: IVideoStreamer, handle: pointer, texture: Texture, size: iVec2, format: TextureFormat) -> bool, Texture, iVec2, TextureFormat
(streamer: IVideoStreamer, handle: pointer, texture: Texture, size: iVec2, format: TextureFormat, destroy: bool) -> bool, Texture, iVec2, TextureFormat

UpdateTextureFromPicture

(tex: Texture, pic: Picture) -> None

Update texture content from the provided picture.

Note: The picture is expected to be in a format compatible with the texture format.

UpdateWindow

(window: Window) -> bool

Update a window on the host system.

Vec3I

(x: int, y: int, z: int) -> Vec3

Create a vector from integer values in the [0;255] range.

Vec4I

(x: int, y: int, z: int) -> Vec4
(x: int, y: int, z: int, w: int) -> Vec4

Create a vector from integer values in the [0;255] range.

VectorMat3

(V: Vec3) -> Mat3

Return a vector as a matrix.

VertexLayoutPosFloatColorFloat

() -> VertexLayout

VertexLayoutPosFloatColorUInt8

() -> VertexLayout

VertexLayoutPosFloatNormFloat

() -> VertexLayout

Simple vertex layout with float position and normal.

vtx_layout = VertexLayout()
vtx_layout.Begin()
vtx_layout.Add(hg.A_Position, 3, hg.AT_Float)
vtx_layout.Add(hg.A_Normal, 3, hg.AT_Float)
vtx_layout.End()

VertexLayoutPosFloatNormUInt8

() -> VertexLayout

Simple vertex layout with float position and 8-bit unsigned integer normal.

vtx_layout = VertexLayout()
vtx_layout.Begin()
vtx_layout.Add(hg.A_Position, 3, hg.AT_Float)
vtx_layout.Add(hg.A_Normal, 3, hg.AT_Uint8, True, True)
vtx_layout.End()

VertexLayoutPosFloatNormUInt8TexCoord0UInt8

() -> VertexLayout

VertexLayoutPosFloatTexCoord0UInt8

() -> VertexLayout

Warn

(msg: str) -> None
(msg: str, details: str) -> None

WindowHasFocus

(window: Window) -> bool

Return true if the provided window has focus, false otherwise.

WindowSystemInit

() -> None

Initialize the Window system.

WindowSystemShutdown

() -> None

Shutdown the window system.

See WindowSystemInit.

Wrap

(v: float, start: float, end: float) -> float
(v: int, start: int, end: int) -> int

Wrap the input value so that it fits in the specified inclusive range.

WriteFloat

(file: File, value: float) -> bool

Write a binary 32 bit floating point value to a file.

WriteString

(file: File, value: str) -> bool

Write a string to a file as 32 bit integer size followed by the string content in UTF8.

WriteUInt16

(file: File, value: int) -> bool

Write a binary 16 bit unsigned integer to a file.

WriteUInt32

(file: File, value: int) -> bool

Write a binary 32 bit unsigned integer to a file.

WriteUInt8

(file: File, value: int) -> bool

Write a binary 8 bit unsigned integer to a file.

ZoomFactorToFov

(zoom_factor: float) -> float

Convert from a zoom factor value in meters to a fov value in radian.