API Functions Lua
Abs Function
number Abs(number v)integer Abs(integer v)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 Function
boolean AddAssetsFolder(string path)Mount a local filesystem folder as an assets source.
See Resources & Assets.
AddAssetsPackage Function
boolean AddAssetsPackage(string path)Mount an archive stored on the local filesystem as an assets source.
See Resources & Assets.
AlphaScale Function
Scale the alpha component of the input color.
ApplyBloom Function
integer ApplyBloom(integer view_id, IntRect rect, Texture input, FrameBufferHandle output, Bloom bloom, number threshold, number smoothness, number intensity)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.
ARGB32 Function
integer ARGB32(integer r, integer g, integer b)integer ARGB32(integer r, integer g, integer b, integer a)Create a 32 bit integer ARGB color.
ARGB32ToRGBA32 Function
integer ARGB32ToRGBA32(integer argb)Convert a 32 bit integer ARGB color to RGBA.
AudioInit Function
boolean AudioInit()Initialize the audio system.
AudioShutdown Function
nil AudioShutdown()Shutdown the audio system.
BaseToEuler Function
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 Function
integer BeginProfilerSection(string name)integer BeginProfilerSection(string name, string section_details)Begin a named profiler section. Call EndProfilerSection to end the section.
CaptureProfilerFrame Function
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 Function
integer, integer CaptureTexture(integer view_id, PipelineResources resources, TextureRef tex, Texture read_back, Picture pic)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 Function
Ceil Function
Returns a vector whose elements are equal to the nearest integer greater than or equal to the vector elements.
ChromaScale Function
Return a copy of the color with its saturation scaled as specified.
Clamp Function
number Clamp(number v, number min, number max)integer Clamp(integer v, integer min, integer max)Return a vector whose elements are equal to the vector elements clipped to the specified interval.
ClampLen Function
Returns a vector in the same direction as the specified vector, but with its length clipped by the specified interval.
ClassifyLine Function
Return true if the provided line intersect the bounding volume, false otherwise.
ClassifySegment Function
Return true if the provided segment intersect the bounding volume, false otherwise.
CleanPath Function
string CleanPath(string path)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 Function
Convert a 3d position in clip space (homogeneous space) to a 2d position on screen.
Close Function
boolean Close(File file)Close a file handle.
Cm Function
number Cm(number cm)Convert a value in centimeters to the Harfang internal unit system.
ColorFromABGR32 Function
integer rgba32)Create a color from a 32 bit ABGR integer.
ColorFromRGBA32 Function
integer rgba32)Create a color from a 32 bit RGBA integer.
ColorFromVector3 Function
Create a color from a 3d vector, alpha defaults to 1.
ColorFromVector4 Function
Return a 4-dimensional vector as a color.
ColorI Function
Create a color from integer values in the [0;255] range.
ColorToABGR32 Function
integer ColorToABGR32(Color color)Return a 32 bit ABGR integer from a color.
ColorToGrayscale Function
number ColorToGrayscale(Color color)Return the grayscale representation of a color. A weighted average is used to account for human perception of colors.
ColorToRGBA32 Function
integer ColorToRGBA32(Color color)Return a 32 bit RGBA integer from a color.
Compute2DProjectionMatrix Function
number znear, number zfar, number res_x, number res_y, boolean y_up)Returns a projection matrix from a 2D space to the 3D world, as required by SetViewTransform for example.
ComputeAspectRatioX Function
Compute the aspect ratio factor for the provided viewport dimensions. Use this method to compute aspect ratio for landscape display.
See ComputeAspectRatioY.
ComputeAspectRatioY Function
Compute the aspect ratio factor for the provided viewport dimensions. Use this method to compute aspect ratio for portrait display.
See ComputeAspectRatioX.
ComputeMinMaxBoundingSphere Function
Compute the bounding sphere for the provided axis-aligned bounding box.
ComputeOrthographicProjectionMatrix Function
number znear, number zfar, number size, Vec2 aspect_ratio)number znear, number zfar, number size, Vec2 aspect_ratio, Vec2 offset)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 Function
number size, number znear, number zfar, Vec2 aspect_ratio)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 Function
number znear, number zfar, number zoom_factor, Vec2 aspect_ratio)number znear, number zfar, number zoom_factor, Vec2 aspect_ratio, Vec2 offset)Compute a perspective projection matrix, , fov is the field of view angle, see Deg and Rad.
See ZoomFactorToFov, FovToZoomFactor, ComputeAspectRatioX and ComputeAspectRatioY.
ComputePerspectiveViewState Function
number fov, number znear, number zfar, Vec2 aspect_ratio)Compute a perspective view state.
See ComputePerspectiveProjectionMatrix, ZoomFactorToFov, FovToZoomFactor, ComputeAspectRatioX and ComputeAspectRatioY.
ComputeRenderState Function
boolean write_z)boolean write_z, boolean write_r)boolean write_z, boolean write_r, boolean write_g)boolean write_z, boolean write_r, boolean write_g, boolean write_b)boolean write_z, boolean write_r, boolean write_g, boolean write_b, boolean write_a)boolean write_z, boolean write_r, boolean write_g, boolean write_b)boolean write_z, boolean write_r, boolean write_g, boolean write_b, boolean write_a)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 Function
ComputeSortKey Function
integer ComputeSortKey(number view_depth)Compute a sorting key to control the rendering order of a display list, view_depth is expected in view space.
ComputeSortKeyFromWorld Function
Compute a sorting key to control the rendering order of a display list.
ComputeTextHeight Function
Compute the height of a text string.
ComputeTextRect Function
Compute the width and height of a text string.
ConfigureCrowdAgent Function
number radius, number height, number max_acceleration, number max_speed, number collision_query_range, number path_optimization_range, number separation_weight)Create a parameter structure for a crowd agent to be used with a Crowd object.
Contains Function
Return true if the provided position is inside the bounding volume, false otherwise.
CopyDir Function
boolean CopyDir(string src, string dst)Copy a directory on the local filesystem, this function does not recurse through subdirectories.
See CopyDirRecursive.
CopyDirRecursive Function
boolean CopyDirRecursive(string src, string dst)Copy a directory on the local filesystem, recurse through subdirectories.
CopyFile Function
boolean CopyFile(string src, string dst)Copy a file on the local filesystem.
CosineInterpolate Function
number CosineInterpolate(number y0, number y1, number t)Compute the cosine interpolated value between y0 and y1 at t.
See LinearInterpolate, CubicInterpolate and HermiteInterpolate.
CreateBloomFromAssets Function
CreateBloomFromFile Function
CreateCamera Function
CreateCapsuleModel Function
number radius, number height, integer subdiv_x, integer subdiv_y)Create a capsule render model.
See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.
CreateConeModel Function
Create a cone render model.
See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.
CreateCubeModel Function
Create a cube render model.
See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.
CreateCylinderModel Function
Create a cylinder render model.
See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.
CreateForwardPipeline Function
integer shadow_map_resolution)Create a forward pipeline and its resources.
CreateForwardPipelineAAAFromAssets Function
string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio)string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio, BackbufferRatio ssr_ratio)CreateForwardPipelineAAAFromFile Function
string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio)string path, ForwardPipelineAAAConfig config, BackbufferRatio ssgi_ratio, BackbufferRatio ssr_ratio)CreateFrameBuffer Function
integer aa, string name)integer width, integer height, TextureFormat color_format, TextureFormat depth_format, integer aa, string name)Create a framebuffer and its texture attachments.
See DestroyFrameBuffer.
CreateInstanceFromAssets Function
boolean CreateInstanceFromAssets(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline)boolean CreateInstanceFromAssets(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)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 Function
boolean CreateInstanceFromFile(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline)boolean CreateInstanceFromFile(Scene scene, Mat4 mtx, string name, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)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 Function
number priority, LightShadowType shadow_type)number priority, LightShadowType shadow_type, number shadow_bias, Vec4 pssm_split)number diffuse_intensity, Color specular)number diffuse_intensity, Color specular, number specular_intensity)number diffuse_intensity, Color specular, number specular_intensity, number priority)number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type)CreateMaterial Function
string value_name_0, Vec4 value_0, string value_name_1, Vec4 value_1)Helper function to create a material.
See SetMaterialProgram, SetMaterialValue and SetMaterialTexture.
CreateMissingMaterialProgramValuesFromAssets Function
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 Function
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 Function
CreateOrthographicCamera Function
CreatePhysicCube Function
CreatePhysicSphere Function
number radius, Mat4 mtx, ModelRef model_ref, MaterialList materials)number radius, Mat4 mtx, ModelRef model_ref, MaterialList materials, number mass)CreatePlaneModel Function
number width, number length, integer subdiv_x, integer subdiv_z)Create a plane render model.
CreatePointLight Function
number radius, Color diffuse, Color specular, number priority)number radius, Color diffuse, Color specular, number priority, LightShadowType shadow_type)number radius, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias)number radius, Color diffuse, number diffuse_intensity)number radius, Color diffuse, number diffuse_intensity, Color specular)number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity)number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority)number radius, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type)CreateSAOFromAssets Function
CreateSAOFromFile Function
CreateSceneRootNode Function
CreateScript Function
CreateSphereModel Function
Create a sphere render model.
See CreateCubeModel, CreateConeModel, CreateCylinderModel, CreatePlaneModel, CreateSphereModel and DrawModel.
CreateSpotLight Function
number radius, number inner_angle, number outer_angle, Color diffuse)number radius, number inner_angle, number outer_angle, Color diffuse, Color specular)number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority)number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type)number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias)number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near)number radius, number inner_angle, number outer_angle, Color diffuse, Color specular, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near, number shadow_far)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias)number radius, number inner_angle, number outer_angle, Color diffuse, number diffuse_intensity, Color specular, number specular_intensity, number priority, LightShadowType shadow_type, number shadow_bias, number shadow_near)CreateTexture Function
integer width, integer height, string name, TextureFlags flags, TextureFormat format)Create an empty texture.
CreateTextureFromPicture Function
string name, TextureFlags flags, TextureFormat format)Create a texture from a picture.
See Picture, CreateTexture and UpdateTextureFromPicture.
Crop Function
Crop a rectangle. Remove the specified amount of units on each side of the rectangle.
See Grow.
Cross Function
Return the cross product of two vectors.
CrossProductMat3 Function
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 Function
number CubicInterpolate(number y0, number y1, number y2, number y3, number t)Perform a cubic interpolation across four values with t in the [0;1] range between y1 and y2.
See LinearInterpolate, CosineInterpolate and HermiteInterpolate.
CutFileExtension Function
string CutFileExtension(string path)Return a file path with its extension stripped.
See CutFilePath and CutFileName.
CutFileName Function
string CutFileName(string path)Return the name part of a file path. All folder navigation and extension are stripped.
See CutFileExtension and CutFilePath.
CutFilePath Function
string CutFilePath(string path)Return the folder navigation part of a file path. The file name and its extension are stripped.
See CutFileExtension and CutFileName.
Debug Function
nil Debug(string msg)nil Debug(string msg, string details)DebugSceneExplorer Function
Decompose Function
Decompose a transformation matrix into its translation, scaling and rotation components.
Deg Function
number Deg(number degrees)Convert an angle in degrees to the engine unit system.
Deg3 Function
Convert a triplet of angles in degrees to the engine unit system.
DegreeToRadian Function
number DegreeToRadian(number degrees)Convert an angle in degrees to radians.
DestroyBloom Function
nil DestroyBloom(Bloom bloom)Destroy a bloom post process object and all associated resources.
DestroyForwardPipeline Function
nil DestroyForwardPipeline(ForwardPipeline pipeline)Destroy a forward pipeline object.
DestroyForwardPipelineAAA Function
nil DestroyForwardPipelineAAA(ForwardPipelineAAA pipeline)DestroyFrameBuffer Function
nil DestroyFrameBuffer(FrameBuffer frameBuffer)Destroy a frame buffer and its resources.
DestroyProgram Function
nil DestroyProgram(ProgramHandle h)Destroy a shader program.
DestroySAO Function
nil DestroySAO(SAO sao)Destroy an ambient occlusion post process object and its resources.
DestroyTexture Function
nil DestroyTexture(Texture tex)Destroy a texture object.
DestroyWindow Function
boolean DestroyWindow(Window window)Destroy a window object.
Det Function
number Det(Mat3 m)Return the determinant of a matrix.
DisableCursor Function
nil DisableCursor()Dist Function
Return the Euclidean distance between two vectors.
Dist2 Function
Return the squared Euclidean distance between two vectors.
DistanceToPlane Function
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 Function
Return the dot product of two vectors.
DrawLines Function
nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, RenderState render_state, integer depth)nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state)nil DrawLines(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state, integer depth)nil DrawLines(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)nil DrawLines(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state)nil DrawLines(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState render_state, integer depth)Draw a list of lines to the specified view.
Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.
DrawModel Function
nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4 matrix)nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4 matrix, RenderState render_state)nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4 matrix, RenderState render_state, integer depth)nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4List matrices)nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4List matrices, RenderState render_state)nil DrawModel(integer view_id, Model mdl, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, Mat4List matrices, RenderState render_state, integer depth)Draw a model to the specified view.
Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.
DrawSprites Function
nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg)nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, RenderState state)nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, RenderState state, integer depth)nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)nil DrawSprites(integer view_id, Mat3 inv_view_R, VertexLayout vtx_layout, Vec3List pos, Vec2 size, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)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 Function
nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx)nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos)nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign)nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign, UniformSetValueList values, UniformSetTextureList textures)nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign, UniformSetValueList values, UniformSetTextureList textures, RenderState state)nil DrawText(integer view_id, Font font, string text, ProgramHandle prg, string page_uniform, integer page_stage, Mat4 mtx, Vec3 pos, DrawTextHAlign halign, DrawTextVAlign valign, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)Write text to the specified view using the provided shader program and uniform values.
DrawTriangles Function
nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, RenderState state, integer depth)nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)nil DrawTriangles(integer view_id, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)nil DrawTriangles(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures)nil DrawTriangles(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state)nil DrawTriangles(integer view_id, UInt16List idx, Vertices vtx, ProgramHandle prg, UniformSetValueList values, UniformSetTextureList textures, RenderState state, integer depth)Draw a list of triangles to the specified view.
Use UniformSetValueList and UniformSetTextureList to pass uniform values to the shader program.
DuplicateNodeAndChildrenFromAssets Function
Duplicate a node and its child hierarchy. Resources will be loaded from the assets system.
See Resources & Assets.
DuplicateNodeAndChildrenFromFile Function
Duplicate a node and its child hierarchy. Resources will be loaded from the local filesystem.
See Resources & Assets.
DuplicateNodeFromAssets Function
Duplicate a node. Resources will be loaded from the assets system.
See Resources & Assets.
DuplicateNodeFromFile Function
Duplicate a node. Resources will be loaded from the local filesystem.
See Resources & Assets.
DuplicateNodesAndChildrenFromAssets Function
Duplicate each node and children hierarchy of a list. Resources will be loaded from the assets system.
See Resources & Assets.
DuplicateNodesAndChildrenFromFile Function
Duplicate each node and children hierarchy of a list. Resources will be loaded from the local filesystem.
See Resources & Assets.
DuplicateNodesFromAssets Function
Duplicate each node of a list. Resources will be loaded from the assets system.
DuplicateNodesFromFile Function
Duplicate each node of a list. Resources will be loaded from the local filesystem.
See Resources & Assets.
EndProfilerFrame Function
End a profiler frame and return it.
See PrintProfilerFrame to print a profiler frame to the console.
EndProfilerSection Function
nil EndProfilerSection(integer section_idx)End a named profiler section. Call BeginProfilerSection to begin a new section.
Error Function
nil Error(string msg)nil Error(string msg, string details)Exists Function
boolean Exists(string path)Return true if a file exists on the local filesystem, false otherwise.
ExtractZoomFactorFromProjectionMatrix Function
Extract zoom factor from a projection matrix.
See ZoomFactorToFov.
ExtractZRangeFromOrthographicProjectionMatrix Function
ExtractZRangeFromPerspectiveProjectionMatrix Function
ExtractZRangeFromProjectionMatrix Function
Extract z near and z far clipping range from a projection matrix.
FaceForward Function
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 Function
string FactorizePath(string path)Return the input path with all redundant navigation entries stripped (folder separator, .. and . entries).
FileToString Function
string FileToString(string path)Return the content of a local filesystem as a string.
FitsInside Function
Return wether a fits in b.
Floor Function
Returns a vector whose elements are equal to the nearest integer less than or equal to the vector elements.
FovToZoomFactor Function
number FovToZoomFactor(number fov)Convert from a fov value in radian to a zoom factor value in meters.
FpsController Function
nil FpsController(boolean key_up, boolean key_down, boolean key_left, boolean key_right, boolean btn, number dx, number dy, Vec3 pos, Vec3 rot, number speed, integer dt_t)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 Function
integer Frame()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.
FRand Function
number FRand()number FRand(number range)Return a random floating point value in the provided range, default range is [0;1].
See Rand to generate a random integer value.
FromHLS Function
Convert input hue/luminance/saturation color to RGBA, alpha channel is left unmodified.
FRRand Function
number FRRand()number FRRand(number range_start)number FRRand(number range_start, number range_end)Return a random floating point value in the provided range, default range is [-1;1].
GaussianBlurIsoSurface Function
Apply a Gaussian blur to an iso-surface.
GetArea Function
number GetArea(MinMax minmax)Return the area of the volume.
GetCenter Function
Return the center position of the volume.
GetClock Function
integer GetClock()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 Function
integer GetClockDt()Return the elapsed time recorded during the last call to TickClock.
GetColorTexture Function
Retrieves color texture attachment.
GetColumn Function
Returns the nth column.
GetCurrentWorkingDirectory Function
string GetCurrentWorkingDirectory()Return the system current working directory.
GetDepthTexture Function
Retrieves depth texture attachment.
GetFileExtension Function
string GetFileExtension(string path)Return the extension part of a file path.
GetFileName Function
string GetFileName(string path)Return the name part of a file path (including its extension).
GetFilePath Function
string GetFilePath(string path)Return the path part of a file path (excluding file name and extension).
GetForwardPipelineInfo Function
Return the pipeline info object for the forward pipeline.
GetGamepadNames Function
Return a list of names for all supported gamepad devices on the system.
See ReadGamepad.
GetHandJointAngularVelocity Function
GetHandJointLinearVelocity Function
GetHandJointPose Function
GetHandJointRadius Function
GetHeight Function
number GetHeight(Rect rect)integer GetHeight(IntRect rect)Return the height of a rectangle.
GetJoystickDeviceNames Function
GetJoystickNames Function
GetJsonBool Function
Return the value of a boolean JSON key.
GetJsonFloat Function
Return the value of a float JSON key.
GetJsonInt Function
Return the value of an integer JSON key.
GetJsonString Function
Return the value of a string JSON key.
GetKeyboardNames Function
Return a list of names for all supported keyboard devices on the system.
See ReadKeyboard.
GetKeyName Function
string GetKeyName(Key key)Return the name for a keyboard key.
GetMaterialAlphaCut Function
boolean GetMaterialAlphaCut(Material mat)GetMaterialAmbientUsesUV1 Function
boolean GetMaterialAmbientUsesUV1(Material mat)GetMaterialBlendMode Function
Return a material blending mode.
GetMaterialDepthTest Function
Return a material depth test function.
GetMaterialDiffuseUsesUV1 Function
boolean GetMaterialDiffuseUsesUV1(Material mat)GetMaterialFaceCulling Function
Return a material culling mode.
GetMaterialNormalMapInWorldSpace Function
boolean GetMaterialNormalMapInWorldSpace(Material mat)GetMaterialSkinning Function
boolean GetMaterialSkinning(Material mat)GetMaterialSpecularUsesUV1 Function
boolean GetMaterialSpecularUsesUV1(Material mat)GetMaterialTexture Function
Return the texture reference assigned to a material named uniform.
GetMaterialTextures Function
Return the list of names of a material texture uniforms.
GetMaterialValues Function
Return the list of names of a material value uniforms.
GetMaterialWriteRGBA Function
Return the material color mask.
GetMaterialWriteZ Function
boolean GetMaterialWriteZ(Material mat)Return the material depth write mask.
GetMonitorModes Function
Return the list of supported monitor modes.
GetMonitorName Function
string GetMonitorName(Monitor monitor)Return the monitor name.
GetMonitorRect Function
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.
GetMonitors Function
Return a list of monitors connected to the system.
GetMonitorSizeMM Function
Returns the size, in millimetres, of the display area of the specified monitor.
GetMouseNames Function
Return a list of names for all supported mouse devices on the system.
See ReadKeyboard.
GetNodePairContacts Function
GetNodesInContact Function
GetR Function
See GetRotation.
GetRMatrix Function
See GetRotationMatrix.
GetRotation Function
Return the rotation component of a transformation matrix as a Euler triplet.
GetRotationMatrix Function
Return the rotation component of a transformation matrix as a Mat3 rotation matrix.
GetRow Function
Returns the nth row of a matrix.
GetS Function
See GetScale.
GetScale Function
Return the scale component of a matrix a scale vector.
GetSceneForwardPipelineFog Function
GetSceneForwardPipelineLights Function
Filter through the scene lights and return a list of pipeline lights to be used by the scene forward pipeline.
GetSceneForwardPipelinePassViewId Function
integer GetSceneForwardPipelinePassViewId(SceneForwardPipelinePassViewId views, SceneForwardPipelinePass pass)Return the view id for a scene forward pipeline pass id.
GetScenePhysicsBackendName Function
string GetScenePhysicsBackendName()GetSize Function
integer GetSize(File file)Return the size in bytes of a local file.
GetSourceDuration Function
integer GetSourceDuration(SourceRef source)Return the duration of an audio source.
GetSourceState Function
Return the state of an audio source.
GetSourceTimecode Function
integer GetSourceTimecode(SourceRef source)Return the current timecode of a playing audio source.
GetT Function
See GetTranslation.
GetTextures Function
Returns color and depth texture attachments.
GetTranslation Function
Return the translation part of a tranformation matrix as a translation vector.
GetUserFolder Function
string GetUserFolder()Return the system user folder for the current user.
GetVRControllerNames Function
Return a list of names for all supported VR controller devices on the system.
See ReadVRController.
GetVRGenericTrackerNames Function
Return a list of names for all supported VR tracker devices on the system.
GetWidth Function
number GetWidth(Rect rect)integer GetWidth(IntRect rect)Return the width of a rectangle.
GetWindowClientSize Function
Return a window client rectangle. The client area of a window does not include its decorations.
GetWindowContentScale Function
GetWindowHandle Function
Return the system native window handle.
GetWindowInFocus Function
Return the system window with input focus.
GetWindowPos Function
Return a window position on screen.
GetWindowTitle Function
Return a window title.
GetX Function
number GetX(Rect rect)integer GetX(IntRect rect)Return the scaled X axis of a transformation matrix.
GetY Function
number GetY(Rect rect)integer GetY(IntRect rect)Return the scaled Y axis of a transformation matrix.
GetZ Function
Return the scaled Z axis of a transformation matrix.
Grow Function
Grow a rectangle by the specified amount of units.
See Crop.
HasFileExtension Function
boolean HasFileExtension(string path)Test the extension of a file path.
HermiteInterpolate Function
number HermiteInterpolate(number y0, number y1, number y2, number y3, number t, number tension, number bias)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 Function
nil HideCursor()Hide the system mouse cursor.
See ShowCursor.
ImGuiAlignTextToFramePadding Function
nil ImGuiAlignTextToFramePadding()Vertically align upcoming text baseline to FramePadding y coordinate so that it will align properly to regularly framed items.
ImGuiBegin Function
boolean ImGuiBegin(string name)Start a new window.
ImGuiBeginChild Function
boolean ImGuiBeginChild(string id)Begin a scrolling region.
ImGuiBeginCombo Function
boolean ImGuiBeginCombo(string label, string preview_value)Begin a ImGui Combo Box.
ImGuiBeginFrame Function
nil ImGuiBeginFrame(integer width, integer height, integer dt_clock, MouseState mouse, KeyboardState keyboard)nil ImGuiBeginFrame(DearImguiContext ctx, integer width, integer height, integer dt_clock, MouseState mouse, KeyboardState keyboard)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 Function
nil ImGuiBeginGroup()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...).
ImGuiBeginPopup Function
boolean ImGuiBeginPopup(string id)Return true if popup is opened and starts outputting to it.
Note: Only call ImGuiEndPopup if this returns true.
ImGuiBeginPopupContextItem Function
boolean ImGuiBeginPopupContextItem(string id)boolean ImGuiBeginPopupContextItem(string id, integer mouse_button)ImGui helper to open and begin popup when clicked on last item.
ImGuiBeginPopupContextVoid Function
boolean ImGuiBeginPopupContextVoid()boolean ImGuiBeginPopupContextVoid(string id)boolean ImGuiBeginPopupContextVoid(string id, integer mouse_button)ImGui helper to open and begin popup when clicked in void (where there are no ImGui windows)
ImGuiBeginPopupContextWindow Function
boolean ImGuiBeginPopupContextWindow()boolean ImGuiBeginPopupContextWindow(string id)ImGui helper to open and begin popup when clicked on current window.
ImGuiBeginPopupModal Function
boolean ImGuiBeginPopupModal(string name)boolean ImGuiBeginPopupModal(string name, boolean open)Begin an ImGui modal dialog.
ImGuiBeginTooltip Function
nil ImGuiBeginTooltip()Used to create full-featured tooltip windows that aren't just text.
ImGuiBullet Function
nil ImGuiBullet()Draw a small circle and keep the cursor on the same line. Advances by the same distance as an empty ImGuiTreeNode call.
ImGuiBulletText Function
nil ImGuiBulletText(string label)Draw a bullet followed by a static text.
ImGuiButton Function
boolean ImGuiButton(string label)Button widget returning True if the button was pressed.
ImGuiCalcItemWidth Function
number ImGuiCalcItemWidth()Returns the width of item given pushed settings and current cursor position.
Note: This is not necessarily the width of last item.
ImGuiCalcTextSize Function
string text)Compute the bounding rectangle for the provided text.
ImGuiCaptureKeyboardFromApp Function
nil ImGuiCaptureKeyboardFromApp(boolean capture)Force capture keyboard when your widget is being hovered.
ImGuiCaptureMouseFromApp Function
nil ImGuiCaptureMouseFromApp(boolean capture)Force capture mouse when your widget is being hovered.
ImGuiCheckbox Function
boolean, boolean ImGuiCheckbox(string label, boolean value)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 Function
nil ImGuiClearInputBuffer()Force a reset of the ImGui input buffer.
ImGuiCloseCurrentPopup Function
nil ImGuiCloseCurrentPopup()Close the popup we have begin-ed into. Clicking on a menu item or selectable automatically closes the current popup.
ImGuiCollapsingHeader Function
boolean ImGuiCollapsingHeader(string label)boolean, boolean ImGuiCollapsingHeader(string label, boolean p_open)Draw a collapsing header, returns False if the header is collapsed so that you may skip drawing the header content.
ImGuiColorButton Function
Color button widget, display a small colored rectangle.
ImGuiColorEdit Function
Color editor, returns the widget current color.
ImGuiColumns Function
nil ImGuiColumns()nil ImGuiColumns(integer count)nil ImGuiColumns(integer count, string id)nil ImGuiColumns(integer count, string id, boolean with_border)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 Function
boolean, integer ImGuiCombo(string label, integer current_item, StringList items, integer height_in_items)Combo box widget, return the current selection index. Combo items are passed as an array of string.
ImGuiDragFloat Function
boolean, number ImGuiDragFloat(string label, number v)boolean, number ImGuiDragFloat(string label, number v, number v_speed)boolean, number ImGuiDragFloat(string label, number v, number v_speed, number v_min, number v_max)Declare a widget to edit a float value. The widget can be dragged over to modify the underlying value.
ImGuiDragIntVec2 Function
boolean, iVec2 ImGuiDragIntVec2(string label, iVec2 v, number v_speed, integer v_min, integer v_max)Declare a widget to edit an iVec2 value. The widget can be dragged over to modify the underlying value.
ImGuiDragVec2 Function
Declare a float edit widget that can be dragged over to modify its value.
ImGuiDragVec3 Function
Declare a widget to edit a Vec3 value. The widget can be dragged over to modify the underlying value.
ImGuiDragVec4 Function
Declare a widget to edit a Vec4 value. The widget can be dragged over to modify the underlying value.
ImGuiDummy Function
nil ImGuiDummy(Vec2 size)Add a dummy item of given size.
ImGuiEnd Function
nil ImGuiEnd()End the current window.
ImGuiEndChild Function
nil ImGuiEndChild()End a scrolling region.
ImGuiEndCombo Function
nil ImGuiEndCombo()End a combo widget.
ImGuiEndFrame Function
nil ImGuiEndFrame(DearImguiContext ctx)nil ImGuiEndFrame()nil ImGuiEndFrame(integer view_id)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 Function
nil ImGuiEndGroup()End the current group.
ImGuiEndPopup Function
nil ImGuiEndPopup()End the current popup.
ImGuiEndTooltip Function
nil ImGuiEndTooltip()End the current tooltip window.
See ImGuiBeginTooltip.
ImGuiGetColorU32 Function
integer ImGuiGetColorU32(ImGuiCol idx)integer ImGuiGetColorU32(Color color)Return a style color component as a 32 bit unsigned integer.
See ImGuiPushStyleColor.
ImGuiGetColumnIndex Function
integer ImGuiGetColumnIndex()Returns the index of the current column.
ImGuiGetColumnOffset Function
number ImGuiGetColumnOffset()number ImGuiGetColumnOffset(integer column_index)Returns the current column offset in pixels, from the left side of the content region.
ImGuiGetColumnsCount Function
integer ImGuiGetColumnsCount()Return the number of columns in the current layout section.
See ImGuiColumns.
ImGuiGetColumnWidth Function
number ImGuiGetColumnWidth()number ImGuiGetColumnWidth(integer column_index)Returns the current column width in pixels.
ImGuiGetContentRegionMax Function
Return the available content space including window decorations and scrollbar.
ImGuiGetCursorPos Function
Return the layout cursor position in window space. Next widget declaration will take place at the cursor position.
See ImGuiSetCursorPos and ImGuiSameLine.
ImGuiGetCursorPosX Function
number ImGuiGetCursorPosX()Helper for ImGuiGetCursorPos.
ImGuiGetCursorPosY Function
number ImGuiGetCursorPosY()Helper for ImGuiGetCursorPos.
ImGuiGetCursorScreenPos Function
Return the current layout cursor position in screen space.
ImGuiGetCursorStartPos Function
Return the current layout "line" starting position.
See ImGuiSameLine.
ImGuiGetFont Function
Return the current ImGui font.
ImGuiGetFontSize Function
number ImGuiGetFontSize()Return the font size (height in pixels) of the current ImGui font with the current scale applied.
ImGuiGetFontTexUvWhitePixel Function
Get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API.
ImGuiGetFrameCount Function
integer ImGuiGetFrameCount()Return the ImGui frame counter.
See ImGuiBeginFrame and ImGuiEndFrame.
ImGuiGetFrameHeightWithSpacing Function
number ImGuiGetFrameHeightWithSpacing()Return the following value: FontSize + style.FramePadding.y * 2 + style.ItemSpacing.y (distance in pixels between 2 consecutive lines of framed widgets)
ImGuiGetID Function
integer ImGuiGetID(string id)Return a unique ImGui ID.
ImGuiGetItemRectMax Function
Get bounding rect maximum of last item in screen space.
ImGuiGetItemRectMin Function
Get bounding rect minimum of last item in screen space.
ImGuiGetItemRectSize Function
Get bounding rect size of last item in screen space.
ImGuiGetMouseDragDelta Function
Return the distance covered by the mouse cursor since the last button press.
ImGuiGetMousePos Function
Return the mouse cursor coordinates in screen space.
ImGuiGetMousePosOnOpeningCurrentPopup Function
Retrieve a backup of the mouse position at the time of opening the current popup.
See ImGuiBeginPopup.
ImGuiGetScrollMaxX Function
number ImGuiGetScrollMaxX()Get maximum scrolling amount on the horizontal axis.
ImGuiGetScrollMaxY Function
number ImGuiGetScrollMaxY()Get maximum scrolling amount on the vertical axis.
ImGuiGetScrollX Function
number ImGuiGetScrollX()Get scrolling amount on the horizontal axis.
ImGuiGetScrollY Function
number ImGuiGetScrollY()Get scrolling amount on the vertical axis.
ImGuiGetTextLineHeight Function
number ImGuiGetTextLineHeight()Return the height of a text line using the current font.
See ImGuiPushFont.
ImGuiGetTextLineHeightWithSpacing Function
number ImGuiGetTextLineHeightWithSpacing()Return the height of a text line using the current font plus vertical spacing between two layout lines.
ImGuiGetTime Function
number ImGuiGetTime()Return the current ImGui time in seconds.
ImGuiGetTreeNodeToLabelSpacing Function
number ImGuiGetTreeNodeToLabelSpacing()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 Function
Return the content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with ImGuiSetNextWindowContentSize, in window space.
ImGuiGetWindowContentRegionMin Function
Content boundaries min (roughly (0,0)-Scroll), in window space.
ImGuiGetWindowContentRegionWidth Function
number ImGuiGetWindowContentRegionWidth()Return the width of the content region.
ImGuiGetWindowDrawList Function
Get the draw list associated to the current window, to append your own drawing primitives.
ImGuiGetWindowHeight Function
number ImGuiGetWindowHeight()Return the current window height.
ImGuiGetWindowPos Function
Return the current window position in screen space.
See ImGuiSetWindowPos.
ImGuiGetWindowSize Function
Return the current window size.
See ImGuiSetWindowSize.
ImGuiGetWindowWidth Function
number ImGuiGetWindowWidth()Return the current window width.
ImGuiImage Function
Display a texture as an image widget.
See ImGuiImageButton.
ImGuiImageButton Function
boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, integer frame_padding, Color bg_col)boolean ImGuiImageButton(Texture tex, Vec2 size, Vec2 uv0, Vec2 uv1, integer frame_padding, Color bg_col, Color tint_col)Declare an image button displaying the provided texture.
See ImGuiImage.
ImGuiIndent Function
nil ImGuiIndent()nil ImGuiIndent(number width)Move content position toward the right.
ImGuiInit Function
Initialize the global ImGui context. This function must be called once before any other ImGui function using the global context.
See ImGuiInitContext.
ImGuiInitContext Function
number font_size, ProgramHandle imgui_program, ProgramHandle imgui_image_program)Initialize an ImGui context. This function must be called once before any other ImGui function using the context.
See ImGuiInit.
ImGuiInputFloat Function
boolean, number ImGuiInputFloat(string label, number v)boolean, number ImGuiInputFloat(string label, number v, number step, number step_fast)boolean, number ImGuiInputFloat(string label, number v, number step, number step_fast, integer decimal_precision)boolean, number ImGuiInputFloat(string label, number v, number step, number step_fast, integer decimal_precision, ImGuiInputTextFlags flags)Float field widget.
ImGuiInputInt Function
boolean, integer ImGuiInputInt(string label, integer v)boolean, integer ImGuiInputInt(string label, integer v, integer step, integer step_fast)boolean, integer ImGuiInputInt(string label, integer v, integer step, integer step_fast, ImGuiInputTextFlags flags)Integer field widget.
ImGuiInputIntVec2 Function
ImGuiInputText Function
boolean, string ImGuiInputText(string label, string text, integer max_size)boolean, string ImGuiInputText(string label, string text, integer max_size, ImGuiInputTextFlags flags)Text input widget, returns the current widget buffer content.
ImGuiInputVec2 Function
boolean, Vec2 ImGuiInputVec2(string label, Vec2 v, integer decimal_precision, ImGuiInputTextFlags flags)Vec2 field widget.
ImGuiInputVec3 Function
boolean, Vec3 ImGuiInputVec3(string label, Vec3 v, integer decimal_precision, ImGuiInputTextFlags flags)Vec3 field widget.
ImGuiInputVec4 Function
boolean, Vec4 ImGuiInputVec4(string label, Vec4 v, integer decimal_precision, ImGuiInputTextFlags flags)Vec4 field widget.
ImGuiInvisibleButton Function
Invisible button widget, return True if the button was pressed.
ImGuiIsAnyItemActive Function
boolean ImGuiIsAnyItemActive()Return true if any item is active, false otherwise.
ImGuiIsAnyItemHovered Function
boolean ImGuiIsAnyItemHovered()Return true if any item is hovered by the mouse cursor, false otherwise.
ImGuiIsItemActive Function
boolean ImGuiIsItemActive()Was the last item active.
e.g. button being held, text field being edited - items that do not interact will always return false.
ImGuiIsItemClicked Function
boolean ImGuiIsItemClicked()boolean ImGuiIsItemClicked(integer mouse_button)Was the last item clicked.
ImGuiIsItemHovered Function
boolean ImGuiIsItemHovered()boolean ImGuiIsItemHovered(ImGuiHoveredFlags flags)Was the last item hovered by mouse.
ImGuiIsItemVisible Function
boolean ImGuiIsItemVisible()Was the last item visible and not out of sight due to clipping/scrolling.
ImGuiIsKeyDown Function
boolean ImGuiIsKeyDown(integer key_index)Was the specified key down during the last frame?
ImGuiIsKeyPressed Function
boolean ImGuiIsKeyPressed(integer key_index)boolean ImGuiIsKeyPressed(integer key_index, boolean repeat)Was the specified key pressed? A key press implies that the key was down and is currently released.
ImGuiIsKeyReleased Function
boolean ImGuiIsKeyReleased(integer key_index)Was the specified key released during the last frame?
ImGuiIsMouseClicked Function
boolean ImGuiIsMouseClicked(integer button)boolean ImGuiIsMouseClicked(integer button, boolean repeat)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 Function
boolean ImGuiIsMouseDoubleClicked(integer button)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 Function
boolean ImGuiIsMouseDown(integer button)Was the specified mouse button down during the last frame?
ImGuiIsMouseDragging Function
boolean ImGuiIsMouseDragging(ImGuiMouseButton button)Is mouse dragging?
ImGuiIsMouseHoveringRect Function
Test whether the mouse cursor is hovering the specified rectangle.
ImGuiIsMouseReleased Function
boolean ImGuiIsMouseReleased(integer button)Was the specified mouse button released during the last frame?
ImGuiIsRectVisible Function
boolean ImGuiIsRectVisible(Vec2 size)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 Function
boolean ImGuiIsWindowCollapsed()Is the current window collapsed.
ImGuiIsWindowFocused Function
boolean ImGuiIsWindowFocused()boolean ImGuiIsWindowFocused(ImGuiFocusedFlags flags)Is the current window focused.
ImGuiIsWindowHovered Function
boolean ImGuiIsWindowHovered()boolean ImGuiIsWindowHovered(ImGuiHoveredFlags flags)Is the current window hovered and hoverable (not blocked by a popup), differentiates child windows from each others.
ImGuiLabelText Function
nil ImGuiLabelText(string label, string text)Display text+label aligned the same way as value+label widgets.
ImGuiListBox Function
boolean, integer ImGuiListBox(string label, integer current_item, StringList items, integer height_in_items)List widget.
ImGuiMouseDrawCursor Function
nil ImGuiMouseDrawCursor(boolean draw_cursor)Enable/disable the ImGui software mouse cursor.
ImGuiNewFrame Function
nil ImGuiNewFrame()ImGuiNewLine Function
nil ImGuiNewLine()Undo a ImGuiSameLine call or force a new line when in an horizontal layout.
ImGuiNextColumn Function
nil ImGuiNextColumn()Start the next column in multi-column layout.
See ImGuiColumns.
ImGuiOpenPopup Function
nil ImGuiOpenPopup(string id)Mark a named popup as open.
Popup windows are closed when the user:
- Clicks outside of their client rect,
- Activates a pressable item,
- ImGuiCloseCurrentPopup is called within a ImGuiBeginPopup/ImGuiEndPopup block.
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 Function
nil ImGuiPopAllowKeyboardFocus()Undo the last call to ImGuiPushAllowKeyboardFocus.
ImGuiPopButtonRepeat Function
nil ImGuiPopButtonRepeat()Undo the last call to ImGuiPushButtonRepeat.
ImGuiPopClipRect Function
nil ImGuiPopClipRect()Undo the last call to ImGuiPushClipRect.
ImGuiPopFont Function
nil ImGuiPopFont()Undo the last call to ImGuiPushFont.
ImGuiPopID Function
nil ImGuiPopID()Undo the last call to ImGuiPushID.
ImGuiPopItemWidth Function
nil ImGuiPopItemWidth()Undo the last call to ImGuiPushItemWidth.
ImGuiPopStyleColor Function
nil ImGuiPopStyleColor()nil ImGuiPopStyleColor(integer count)Undo the last call to ImGuiPushStyleColor.
ImGuiPopStyleVar Function
nil ImGuiPopStyleVar()nil ImGuiPopStyleVar(integer count)Undo the last call to ImGuiPushStyleVar.
ImGuiPopTextWrapPos Function
nil ImGuiPopTextWrapPos()Undo the last call to ImGuiPushTextWrapPos.
ImGuiProgressBar Function
nil ImGuiProgressBar(number fraction)Draw a progress bar, fraction must be between 0.0 and 1.0.
ImGuiPushAllowKeyboardFocus Function
nil ImGuiPushAllowKeyboardFocus(boolean v)Allow focusing using TAB/Shift-TAB, enabled by default but you can disable it for certain widgets.
ImGuiPushButtonRepeat Function
nil ImGuiPushButtonRepeat(boolean repeat)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 Function
nil ImGuiPushClipRect(Vec2 clip_rect_min, Vec2 clip_rect_max, boolean intersect_with_current_clip_rect)Push a new clip rectangle onto the clipping stack.
ImGuiPushFont Function
nil ImGuiPushFont(ImFont font)Push a font on top of the font stack and make it current for subsequent text rendering operations.
ImGuiPushID Function
nil ImGuiPushID(string id)nil ImGuiPushID(integer id)Push a string into the ID stack.
ImGuiPushItemWidth Function
nil ImGuiPushItemWidth(number item_width)Set the width of items for common large item+label widgets.
>0: width in pixels<0: alignxpixels 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 Function
Push a value on the style stack for the specified style color.
See ImGuiPopStyleColor.
ImGuiPushStyleVar Function
Push a value on the style stack for the specified style variable.
See ImGuiPopStyleVar.
ImGuiPushTextWrapPos Function
nil ImGuiPushTextWrapPos()nil ImGuiPushTextWrapPos(number wrap_pos_x)Push word-wrapping position for text commands.
<0: No wrapping.=0: Wrap to the end of the window or column.>0: Wrap atwrap_pos_xposition in window local space.
See ImGuiPopTextWrapPos.
ImGuiRadioButton Function
boolean ImGuiRadioButton(string label, boolean active)boolean, integer ImGuiRadioButton(string label, integer v, integer v_button)Radio button widget, return the button state.
ImGuiRender Function
nil ImGuiRender()ImGuiResetMouseDragDelta Function
nil ImGuiResetMouseDragDelta()nil ImGuiResetMouseDragDelta(ImGuiMouseButton button)ImGuiSameLine Function
nil ImGuiSameLine()nil ImGuiSameLine(number pos_x)nil ImGuiSameLine(number pos_x, number spacing_w)Call between widgets or groups to layout them horizontally.
ImGuiSelectable Function
boolean ImGuiSelectable(string label)boolean ImGuiSelectable(string label, boolean selected)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 Function
nil ImGuiSeparator()Output an horizontal line to separate two distinct UI sections.
ImGuiSetColumnOffset Function
nil ImGuiSetColumnOffset(integer column_index, number offset_x)Set the position of a column line in pixels, from the left side of the contents region.
ImGuiSetColumnWidth Function
nil ImGuiSetColumnWidth(integer column_index, number width)Set the column width in pixels.
ImGuiSetCursorPos Function
nil ImGuiSetCursorPos(Vec2 local_pos)Set the current widget output cursor position in window space.
ImGuiSetCursorPosX Function
nil ImGuiSetCursorPosX(number x)See ImGuiSetCursorPos.
ImGuiSetCursorPosY Function
nil ImGuiSetCursorPosY(number y)See ImGuiSetCursorPos.
ImGuiSetCursorScreenPos Function
nil ImGuiSetCursorScreenPos(Vec2 pos)Set the widget cursor output position in screen space.
ImGuiSetItemAllowOverlap Function
nil ImGuiSetItemAllowOverlap()Allow the last item to be overlapped by a subsequent item. Sometimes useful with invisible buttons, selectables, etc... to catch unused areas.
ImGuiSetItemDefaultFocus Function
nil ImGuiSetItemDefaultFocus()Make the last item the default focused item of a window.
ImGuiSetKeyboardFocusHere Function
nil ImGuiSetKeyboardFocusHere()nil ImGuiSetKeyboardFocusHere(integer offset)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 Function
nil ImGuiSetNextItemOpen(boolean is_open)Set next item open state.
ImGuiSetNextWindowCollapsed Function
Set next window collapsed state, call before ImGuiBegin.
ImGuiSetNextWindowContentSize Function
nil ImGuiSetNextWindowContentSize(Vec2 size)Set the size of the content area of the next declared window. Call before ImGuiBegin.
ImGuiSetNextWindowContentWidth Function
nil ImGuiSetNextWindowContentWidth(number width)ImGuiSetNextWindowFocus Function
nil ImGuiSetNextWindowFocus()Set the next window to be focused/top-most. Call before ImGuiBegin.
ImGuiSetNextWindowPos Function
nil ImGuiSetNextWindowPos(Vec2 pos)Set next window position, call before ImGuiBegin.
ImGuiSetNextWindowPosCenter Function
nil ImGuiSetNextWindowPosCenter()nil ImGuiSetNextWindowPosCenter(ImGuiCond condition)Set next window position to be centered on screen, call before ImGuiBegin.
ImGuiSetNextWindowSize Function
nil ImGuiSetNextWindowSize(Vec2 size)Set next window size, call before ImGuiBegin. A value of 0 for an axis will auto-fit it.
ImGuiSetNextWindowSizeConstraints Function
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 Function
nil ImGuiSetScrollFromPosY(number pos_y)nil ImGuiSetScrollFromPosY(number pos_y, number center_y_ratio)Adjust scrolling amount to make a given position visible. Generally ImGuiGetCursorStartPos + offset to compute a valid position.
ImGuiSetScrollHereY Function
nil ImGuiSetScrollHereY()nil ImGuiSetScrollHereY(number center_y_ratio)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 Function
nil ImGuiSetScrollX(number scroll_x)Set scrolling amount between [0;ImGuiGetScrollMaxX].
ImGuiSetScrollY Function
nil ImGuiSetScrollY(number scroll_y)Set scrolling amount between [0;ImGuiGetScrollMaxY].
ImGuiSetTooltip Function
nil ImGuiSetTooltip(string text)Set tooltip under mouse-cursor, typically used with ImGuiIsItemHovered/ImGuiIsAnyItemHovered. Last call wins.
ImGuiSetWindowCollapsed Function
nil ImGuiSetWindowCollapsed(string name, boolean collapsed)Set named window collapsed state, prefer using ImGuiSetNextWindowCollapsed.
ImGuiSetWindowFocus Function
nil ImGuiSetWindowFocus(string name)Set named window to be focused/top-most.
ImGuiSetWindowFontScale Function
nil ImGuiSetWindowFontScale(number scale)Per-window font scale.
ImGuiSetWindowPos Function
Set named window position.
ImGuiSetWindowSize Function
Set named window size.
ImGuiShutdown Function
nil ImGuiShutdown()Shutdown the global ImGui context.
ImGuiSliderFloat Function
boolean, number ImGuiSliderFloat(string label, number v, number v_min, number v_max)boolean, number ImGuiSliderFloat(string label, number v, number v_min, number v_max, string format)Float slider widget.
ImGuiSliderInt Function
boolean, integer ImGuiSliderInt(string label, integer v, integer v_min, integer v_max)boolean, integer ImGuiSliderInt(string label, integer v, integer v_min, integer v_max, string format)Integer slider widget.
ImGuiSliderIntVec2 Function
ImGuiSliderVec2 Function
Vec2 slider widget.
ImGuiSliderVec3 Function
Vec3 slider widget.
ImGuiSliderVec4 Function
Vec4 slider widget.
ImGuiSmallButton Function
boolean ImGuiSmallButton(string label)Small button widget fitting the height of a text line, return True if the button was pressed.
ImGuiSpacing Function
nil ImGuiSpacing()Add spacing.
ImGuiText Function
nil ImGuiText(string text)Static text.
ImGuiTextColored Function
Colored static text.
ImGuiTextDisabled Function
nil ImGuiTextDisabled(string text)Disabled static text.
ImGuiTextUnformatted Function
nil ImGuiTextUnformatted(string text)Raw text without formatting. Roughly equivalent to ImGuiText but faster, recommended for long chunks of text.
ImGuiTextWrapped Function
nil ImGuiTextWrapped(string text)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 Function
boolean ImGuiTreeNode(string label)If returning true the node is open and the user is responsible for calling ImGuiTreePop.
ImGuiTreeNodeEx Function
See ImGuiTreeNode.
ImGuiTreePop Function
nil ImGuiTreePop()Pop the current tree node.
ImGuiTreePush Function
nil ImGuiTreePush(string id)Already called by ImGuiTreeNode, but you can call ImGuiTreePush/ImGuiTreePop yourself for layouting purpose.
ImGuiUnindent Function
nil ImGuiUnindent()nil ImGuiUnindent(number width)Move content position back to the left (cancel ImGuiIndent).
ImGuiWantCaptureMouse Function
boolean ImGuiWantCaptureMouse()ImGui wants mouse capture. Use this function to determine when to pause mouse processing from other parts of your program.
Inch Function
number Inch(number inch)Convert a value in inches to the Harfang internal unit system.
InputInit Function
nil InputInit()Initialize the Input system. Must be invoked before any call to WindowSystemInit to work properly.
hg.InputInit()
hg.WindowSystemInit()
InputShutdown Function
nil InputShutdown()Shutdown the Input system.
Inside Function
Test if a value is inside a containing volume.
int_to_VoidPointer Function
integer ptr)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.
Intersection Function
Return the intersection of two rectangles.
IntersectRay Function
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.
Intersects Function
Return true if rect a intersects rect b.
Inverse Function
Return the inverse of a matrix, vector or quaternion.
InverseFast Function
IsAssetFile Function
boolean IsAssetFile(string name)Test if an asset file exists in the assets system.
See Resources & Assets.
IsDir Function
boolean IsDir(string path)Returns true if path is a directory on the local filesystem, false otherwise.
IsEOF Function
boolean IsEOF(File file)Returns true if the cursor is at the end of the file, false otherwise.
IsFile Function
boolean IsFile(string path)Test if a file exists on the local filesystem.
IsFinite Function
boolean IsFinite(number v)Test if a floating point value is finite.
IsHandJointActive Function
boolean IsHandJointActive(HandsSide hand)IsMonitorConnected Function
boolean IsMonitorConnected(Monitor monitor)Test if the specified monitor is connected to the host device.
IsoSurfaceSphere Function
nil IsoSurfaceSphere(IsoSurface surface, integer width, integer height, integer depth, number x, number y, number z, number radius)nil IsoSurfaceSphere(IsoSurface surface, integer width, integer height, integer depth, number x, number y, number z, number radius, number value)nil IsoSurfaceSphere(IsoSurface surface, integer width, integer height, integer depth, number x, number y, number z, number radius, number value, number exponent)Output a sphere to an iso-surface.
IsoSurfaceToModel Function
boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth)boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth, integer material)boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth, integer material, number isolevel)boolean IsoSurfaceToModel(ModelBuilder builder, IsoSurface surface, integer width, integer height, integer depth, integer material, number isolevel, number scale_x, number scale_y, number scale_z)Convert an iso-surface to a render model, this function is geared toward efficiency and meant for realtime.
IsPathAbsolute Function
boolean IsPathAbsolute(string path)Test if the provided path is an absolute or relative path.
IsPrimaryMonitor Function
boolean IsPrimaryMonitor(Monitor monitor)Return true if the monitor is the primary host device monitor, false otherwise.
IsValid Function
boolean IsValid(File file)boolean IsValid(Texture t)boolean IsValid(FrameBuffer fb)boolean IsValid(ForwardPipelineAAA pipeline)boolean IsValid(IAudioStreamer streamer)boolean IsValid(IVideoStreamer streamer)Test if a resource if valid.
IsWindowOpen Function
boolean IsWindowOpen(Window window)Return true if the window is open, false otherwise.
Km Function
number Km(number km)Convert a value in kilometers to the Harfang internal unit system.
Len Function
number Len(Vec2 v)integer Len(iVec2 v)number Len(Quaternion q)number Len(Vec3 v)Return the length of the vector.
Len2 Function
number Len2(Vec2 v)integer Len2(iVec2 v)number Len2(Quaternion q)number Len2(Vec3 v)Return the length of the vector squared.
Lerp Function
integer Lerp(integer a, integer b, number t)number Lerp(number a, number b, number t)See LinearInterpolate.
LerpAsOrthonormalBase Function
Linear interpolate between two transformation matrices on the [0;1] interval.
LinearInterpolate Function
number LinearInterpolate(number y0, number y1, number t)Linear interpolate between two values on the [0;1] interval.
See CosineInterpolate, CubicInterpolate and HermiteInterpolate.
ListDir Function
Get the content of a directory on the local filesystem, this function does not recurse into subfolders.
See ListDirRecursive.
ListDirRecursive Function
Get the content of a directory on the local filesystem, this function recurses into subfolders.
See ListDir.
LoadBMP Function
LoadDataFromFile Function
LoadFontFromAssets Function
string name)string name, number size, integer resolution, integer padding, string glyphs)Load a TrueType (TTF) font from the assets system.
See Resources & Assets.
LoadFontFromFile Function
string path)Load a TrueType (TTF) font from the local filesystem.
See Resources & Assets.
LoadForwardPipelineAAAConfigFromAssets Function
LoadForwardPipelineAAAConfigFromFile Function
LoadGIF Function
LoadJPG Function
LoadJsonFromAssets Function
string name)Load a JSON from the assets system.
See Resources & Assets.
LoadJsonFromFile Function
string path)Load a JSON from the local filesystem.
LoadLPCMSound Function
Load a sound from a decoded raw LPCM memory block and return a reference to it.
The input pointer is borrowed only for the duration of the call. The audio data is copied to the audio backend before the function returns.
LoadModelFromAssets Function
string name)Load a render model from the assets system.
See DrawModel and Resources & Assets.
LoadModelFromFile Function
string path)Load a render model from the local filesystem.
LoadOGGSoundAsset Function
string name)LoadOGGSoundFile Function
string path)LoadPicture Function
Load a Picture content from the filesystem.
LoadPipelineProgramFromAssets Function
string name, PipelineResources resources, PipelineInfo pipeline)Load a pipeline shader program from the assets system.
See Resources & Assets.
LoadPipelineProgramFromFile Function
string path, PipelineResources resources, PipelineInfo pipeline)Load a pipeline shader program from the local filesystem.
LoadPipelineProgramRefFromAssets Function
string name, PipelineResources resources, PipelineInfo pipeline)LoadPipelineProgramRefFromFile Function
string path, PipelineResources resources, PipelineInfo pipeline)LoadPNG Function
LoadProgramFromAssets Function
string name)Load a shader program from the assets system.
See Resources & Assets.
LoadProgramFromFile Function
string path)Load a shader program from the local filesystem.
LoadPSD Function
LoadSceneBinaryFromAssets Function
boolean LoadSceneBinaryFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneBinaryFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)Load a scene in binary format from the assets system. Loaded content is added to the existing scene content.
See Resources & Assets.
LoadSceneBinaryFromDataAndAssets Function
boolean LoadSceneBinaryFromDataAndAssets(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneBinaryFromDataAndAssets(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)LoadSceneBinaryFromDataAndFile Function
boolean LoadSceneBinaryFromDataAndFile(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneBinaryFromDataAndFile(Data data, string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)LoadSceneBinaryFromFile Function
boolean LoadSceneBinaryFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneBinaryFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)Load a scene in binary format from the local filesystem. Loaded content is added to the existing scene content.
LoadSceneFromAssets Function
boolean LoadSceneFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)LoadSceneFromFile Function
boolean LoadSceneFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)LoadSceneJsonFromAssets Function
boolean LoadSceneJsonFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneJsonFromAssets(string name, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)Load a scene in JSON format from the assets system. Loaded content is added to the existing scene content.
See Resources & Assets.
LoadSceneJsonFromFile Function
boolean LoadSceneJsonFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline)boolean LoadSceneJsonFromFile(string path, Scene scene, PipelineResources resources, PipelineInfo pipeline, LoadSaveSceneFlags flags)Load a scene in JSON format from the local filesystem. Loaded content is added to the existing scene content.
LoadTextureFlagsFromAssets Function
string name)Load texture flags in the texture metafile from the assets system.
See Resources & Assets.
LoadTextureFlagsFromFile Function
string path)Load texture flags in the texture metafile from the local filesystem.
LoadTextureFromAssets Function
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 Function
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.
LoadTGA Function
LoadWAVSoundAsset Function
string name)Load a sound in WAV format from the assets system and return a reference to it.
See Resources & Assets.
LoadWAVSoundFile Function
string path)Load a sound in WAV format from the local filesystem and return a reference to it.
Log Function
nil Log(string msg)nil Log(string msg, string details)MakeAudioStreamer Function
string module_path)MakeForwardPipelineLinearLight Function
number priority)number priority, ForwardPipelineShadowType shadow_type)number priority, ForwardPipelineShadowType shadow_type, number shadow_bias)Create a forward pipeline linear light.
See ForwardPipelineLights, PrepareForwardPipelineLights, SubmitSceneToForwardPipeline and Drawing a Scene.
MakeForwardPipelinePointLight Function
number radius)number radius, number priority)number radius, number priority, ForwardPipelineShadowType shadow_type)number radius, number priority, ForwardPipelineShadowType shadow_type, number shadow_bias)Create a forward pipeline point light.
See ForwardPipelineLights, PrepareForwardPipelineLights, SubmitSceneToForwardPipeline and Drawing a Scene.
MakeForwardPipelineSpotLight Function
number radius)number radius, number inner_angle)number radius, number inner_angle, number outer_angle)number radius, number inner_angle, number outer_angle, number priority)number radius, number inner_angle, number outer_angle, number priority, ForwardPipelineShadowType shadow_type)number radius, number inner_angle, number outer_angle, number priority, ForwardPipelineShadowType shadow_type, number shadow_bias)Create a forward pipeline spot light.
See ForwardPipelineLights, PrepareForwardPipelineLights, SubmitSceneToForwardPipeline and Drawing a Scene.
MakeFrustum Function
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 Function
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 topandn.
MakeRectFromWidthHeight Function
Make a rectangle from width and height.
MakeUniformSetTexture Function
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 Function
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 Function
MakeVertex Function
MakeVideoStreamer Function
string module_path)Mat3LookAt Function
Return a rotation matrix looking down the provided vector. The input vector does not need to be normalized.
Mat4LookAt Function
Return a look at matrix whose orientation points at the specified position.
Mat4LookAtUp Function
Return a look at matrix whose orientation points at the specified position and up direction.
Mat4LookToward Function
Return a look at matrix whose orientation points toward the specified direction.
Mat4LookTowardUp Function
Return a look at matrix whose orientation points toward the specified directions.
Max Function
number Max(number a, number b)integer Max(integer a, integer b)Return a vector whose elements are the maximum of each of the two specified vectors.
Min Function
number Min(number a, number b)integer Min(integer a, integer b)Return a vector whose elements are the minimum of each of the two specified vectors.
MinMaxFromPositionSize Function
Set min = p - size/2 and max = p + size/2.
MkDir Function
boolean MkDir(string path)boolean MkDir(string path, integer permissions)Create a new directory.
See MkTree.
MkTree Function
boolean MkTree(string path)boolean MkTree(string path, integer permissions)Create a directory tree on the local filesystem. This function is recursive and creates each missing directory in the path.
See MkDir.
Mm Function
number Mm(number mm)Convert a value in millimeters to the Harfang internal unit system.
Ms Function
number Ms(number milliseconds)Convert a value in milliseconds to the Harfang internal unit system.
Mtr Function
number Mtr(number m)Convert a value in meters to the Harfang internal unit system.
NewFullscreenWindow Function
string title, Monitor monitor, integer mode_index, MonitorRotation rotation)Create a new fullscreen window.
NewIsoSurface Function
Return a new iso-surface object.
See IsoSurfaceSphere to draw to an iso-surface and IsoSurfaceToModel to draw it.
NewWindow Function
string title, integer width, integer height, integer bpp, WindowVisibility visibility)Create a new window.
NewWindowFrom Function
Wrap a native window handle in a Window object.
Normalize Function
Return the input vector scaled so that its length is one.
NormalizePath Function
string NormalizePath(string path)Normalize a path according to the following conventions:
- Replace all whitespaces by underscores.
Offset Function
Offset a rectangle by the specified amount of units.
Open Function
string path)Open a file in binary mode.
See OpenText, OpenWrite, OpenWriteText
OpenFileDialog Function
boolean, string OpenFileDialog(string title, FileFilterList filters, string file, string initial_dir)Open a native OpenFile dialog.
OpenFolderDialog Function
boolean, string OpenFolderDialog(string title, string folder_name)boolean, string OpenFolderDialog(string title, string folder_name, string initial_dir)Open a native OpenFolder dialog.
OpenTemp Function
string template_path)Return a handle to a temporary file on the local filesystem.
OpenText Function
string path)Open a file as text. Return a handle to the opened file.
See Open, OpenWrite, OpenWriteText
OpenVRCreateEyeFrameBuffer Function
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 Function
nil OpenVRDestroyEyeFrameBuffer(OpenVREyeFrameBuffer eye_fb)Destroy an eye framebuffer.
OpenVRGetColorTexture Function
Return the color texture attached to an eye framebuffer.
OpenVRGetDepthTexture Function
Return the depth texture attached to an eye framebuffer.
OpenVRGetFrameBufferSize Function
OpenVRGetState Function
Returns the current OpenVR state including the body, head and eye transformations.
OpenVRInit Function
boolean OpenVRInit()Initialize OpenVR. Start the device display, its controllers and trackers.
OpenVRIsHMDMounted Function
boolean OpenVRIsHMDMounted()OpenVRPostPresentHandoff Function
nil OpenVRPostPresentHandoff()Signal to the OpenVR compositor that it can immediatly start processing the current frame.
OpenVRShutdown Function
nil OpenVRShutdown()Shutdown OpenVR.
OpenVRStateToViewState Function
Compute the left and right eye view states from an OpenVR state.
See OpenVRGetState.
OpenVRSubmitFrame Function
Submit the left and right eye textures to the OpenVR compositor.
OpenWrite Function
string path)Open a file as binary in write mode.
See Open, OpenText, OpenWriteText
OpenWriteText Function
string path)OpenXRCreateEyeFrameBuffer Function
OpenXRDestroyEyeFrameBuffer Function
nil OpenXRDestroyEyeFrameBuffer(OpenXREyeFrameBuffer eye_fb)OpenXRFinishSubmitFrameBuffer Function
nil OpenXRFinishSubmitFrameBuffer(OpenXRFrameInfo frameInfo)OpenXRGetColorTexture Function
OpenXRGetColorTextureFromId Function
integer index)OpenXRGetDepthTexture Function
OpenXRGetDepthTextureFromId Function
integer index)OpenXRGetEyeGaze Function
boolean, Mat4 OpenXRGetEyeGaze()OpenXRGetHeadPose Function
boolean, Mat4 OpenXRGetHeadPose()OpenXRGetInstanceInfo Function
string OpenXRGetInstanceInfo()OpenXRInit Function
boolean OpenXRInit()boolean OpenXRInit(integer ExtensionsFlagsEnable)OpenXRShutdown Function
nil OpenXRShutdown()OpenXRSubmitSceneToForwardPipeline Function
integer OpenXRSubmitSceneToForwardPipeline(Mat4 cam_offset, update_controllersCallback update_controllers, draw_sceneCallback draw_scene, integer view_id, number z_near, number z_far)Orthonormalize Function
Return a matrix where the row vectors form an orthonormal basis. All vectors are normalized and perpendicular to each other.
Overlap Function
Return true if the provided volume overlaps with this volume, false otherwise. The test can optionally be restricted to a specific axis.
PathJoin Function
string PathJoin(StringList elements)Return a file path from a set of string elements.
PathStartsWith Function
boolean PathStartsWith(string path, string with)Test if the provided path starts with the provided prefix.
PathStripPrefix Function
string PathStripPrefix(string path, string prefix)Return a copy of the input path stripped of the provided prefix.
PathStripSuffix Function
string PathStripSuffix(string path, string suffix)Return a copy of the input path stripped of the provided suffix.
PathToDisplay Function
string PathToDisplay(string path)Format a path for display.
PauseSource Function
nil PauseSource(SourceRef source)Pause a playing audio source.
See PlayStereo and PlaySpatialized.
PlaySpatialized Function
Start playing a spatialized sound. Return a handle to the started source.
PlayStereo Function
Start playing a stereo sound. Return a handle to the started source.
PrepareForwardPipelineLights Function
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.
For the public scripting API, see SubmitSceneToForwardPipeline and Drawing a Scene.
PrepareSceneForwardPipelineCommonRenderData Function
integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineCommonRenderData(integer view_id, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views)integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineCommonRenderData(integer view_id, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views, string debug_name)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.
PrepareSceneForwardPipelineViewDependentRenderData Function
integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineViewDependentRenderData(integer view_id, ViewState view_state, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views)integer, SceneForwardPipelinePassViewId PrepareSceneForwardPipelineViewDependentRenderData(integer view_id, ViewState view_state, Scene scene, SceneForwardPipelineRenderData render_data, ForwardPipeline pipeline, PipelineResources resources, SceneForwardPipelinePassViewId views, string debug_name)Prepare the view dependent render data to submit a scene to the forward pipeline.
PrintProfilerFrame Function
nil PrintProfilerFrame(ProfilerFrame profiler_frame)Print a profiler frame to the console. Print all sections in the frame, their duration and event count.
ProcessLoadQueues Function
integer ProcessLoadQueues(PipelineResources res)ProcessModelLoadQueue Function
integer ProcessModelLoadQueue(PipelineResources res)ProcessTextureLoadQueue Function
integer ProcessTextureLoadQueue(PipelineResources res)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 Function
ProjectOrthoToScreenSpace Function
ProjectToClipSpace Function
Project a world position to the clipping space.
ProjectToScreenSpace Function
Project a world position to screen coordinates.
ProjectZToClipSpace Function
Project a depth value to clip space.
Quantize Function
number Quantize(number v, number q)Return the provided value quantized to the specified step.
QuaternionFromAxisAngle Function
Return a quaternion rotation from a 3d axis and a rotation around that axis.
QuaternionFromEuler Function
Return a quaternion 3d rotation from its Euler vector representation.
QuaternionFromMatrix3 Function
Return a quaternion rotation from its Mat3 representation.
QuaternionLookAt Function
Return a quaternion 3d rotation oriented toward the specified position when sitting on the world's origin {0, 0, 0}.
Rad Function
number Rad(number radians)Convert an angle in radians to the engine unit system.
Rad3 Function
Convert a triplet of angles in radians to the engine unit system.
RadianToDegree Function
number RadianToDegree(number radians)Convert an angle in radians to degrees.
Rand Function
integer Rand()integer Rand(integer range)Return a random integer value in the provided range, default range is [0;65535].
See FRand to generate a random floating point value.
RandomVec3 Function
Return a vector with each component randomized in the inclusive provided range.
RandomVec4 Function
Return a vector with each component randomized in the inclusive provided range.
ReadFloat Function
number ReadFloat(File file)Read a binary 32 bit floating point value from a local file.
ReadGamepad Function
string name)Read the current state of a named gamepad. If no name is passed, default is implied.
See GetGamepadNames.
ReadJoystick Function
string name)ReadKeyboard Function
string name)Read the current state of a named keyboard. If no name is passed, default is implied.
See GetKeyboardNames.
ReadMouse Function
string name)Read the current state of a named mouse. If no name is passed, default is implied.
See GetMouseNames.
ReadString Function
string ReadString(File file)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 Function
integer ReadUInt16(File file)Read a binary 16 bit unsigned integer value from a local file.
ReadUInt32 Function
integer ReadUInt32(File file)Read a binary 32 bit unsigned integer value from a local file.
ReadUInt8 Function
integer ReadUInt8(File file)Read a binary 8 bit unsigned integer value from a local file.
ReadVRController Function
string name)Read the current state of a named VR controller. If no name is passed, default is implied.
See GetVRControllerNames.
ReadVRGenericTracker Function
string name)Read the current state of a named VR generic tracked. If no name is passed, default is implied.
Reflect Function
Return the input vector reflected around the specified normal.
Refract Function
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 Function
nil RemoveAssetsFolder(string path)Remove a folder from the assets system.
See Resources & Assets.
RemoveAssetsPackage Function
nil RemoveAssetsPackage(string path)Remove a package from the assets system.
See Resources & Assets.
RenderInit Function
boolean RenderInit(Window window)integer width, integer height, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format)integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)string window_title, integer width, integer height, ResetFlags reset_flags, TextureFormat format)string window_title, integer width, integer height, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)string window_title, integer width, integer height, RendererType type, ResetFlags reset_flags)string window_title, integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format)string window_title, integer width, integer height, RendererType type, ResetFlags reset_flags, TextureFormat format, DebugFlags debug_flags)Initialize the render system.
To change the states of the render system afterward use RenderReset.
RenderReset Function
nil RenderReset(integer width, integer height)Change the states of the render system at runtime.
RenderResetToWindow Function
boolean, integer, integer RenderResetToWindow(Window win, integer width, integer height, integer reset_flags)Resize the renderer backbuffer to the provided window client area dimensions. Return true if a reset was needed and carried out.
RenderShutdown Function
nil RenderShutdown()Shutdown the render system.
ResetClock Function
nil ResetClock()Reset the elapsed time counter.
Reverse Function
Return the provided vector pointing in the opposite direction.
ReverseRotationOrder Function
Return the rotation order processing each axis in the reverse order of the input rotation order.
Rewind Function
nil Rewind(File file)Rewind the read/write cursor of an open file.
RGBA32 Function
integer RGBA32(integer r, integer g, integer b)integer RGBA32(integer r, integer g, integer b, integer a)Create a 32 bit integer RGBA color.
RmDir Function
boolean RmDir(string path)Remove an empty folder on the local filesystem.
See RmTree.
RmTree Function
boolean RmTree(string path)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 Function
Return a 2D rotation matrix by a radians around the specified pivot point.
RotationMat3 Function
Return a 3x3 rotation matrix.
RotationMat4 Function
Return a 4x3 rotation matrix from euler angles. The default rotation order is YXZ.
RotationMatX Function
number angle)Return a 3x3 rotation matrix around the world X axis {1, 0, 0}.
RotationMatXY Function
Return a 3x3 rotation matrix around the X axis followed by a rotation around the Y axis.
RotationMatXYZ Function
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 Function
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 Function
number angle)Return a 3x3 rotation matrix around the world Y axis {0, 1, 0}.
RotationMatYXZ Function
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 Function
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 Function
number angle)Return a 3x3 rotation matrix around the world Z axis {0, 0, 1}.
RotationMatZXY Function
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 Function
Return a 3x3 rotation matrix around the Z axis followed by a rotation around the Y axis then a rotation around the X axis.
SaveBMP Function
SaveDataToFile Function
SaveFileDialog Function
boolean, string SaveFileDialog(string title, FileFilterList filters, string file, string initial_dir)Open a native SaveFile dialog.
SaveForwardPipelineAAAConfigToFile Function
SaveGeometryToFile Function
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 Function
Save a JSON object to the local filesystem.
SavePNG Function
SaveSceneBinaryToData Function
boolean SaveSceneBinaryToData(Data data, Scene scene, PipelineResources resources, LoadSaveSceneFlags flags)SaveSceneBinaryToFile Function
boolean SaveSceneBinaryToFile(string path, Scene scene, PipelineResources resources, LoadSaveSceneFlags flags)SaveSceneJsonToFile Function
boolean SaveSceneJsonToFile(string path, Scene scene, PipelineResources resources, LoadSaveSceneFlags flags)SaveTGA Function
ScaleMat3 Function
Return a 3x3 scale matrix from a 2D vector.
ScaleMat4 Function
number scale)Return a 4x3 scale matrix from the parameter scaling vector.
SceneClearSystems Function
nil SceneClearSystems(Scene scene)Clear scene and all optional systems.
SceneGarbageCollectSystems Function
integer SceneGarbageCollectSystems(Scene scene)Garbage collect a scene and all its optional systems.
SceneSyncToSystemsFromAssets Function
Synchronize optional systems (eg. physics or script) states with the scene states. Load resources from the assets system if required.
See Resources & Assets.
SceneSyncToSystemsFromFile Function
Synchronize optional systems (eg. physics or script) states with the scene states. Load resources from the local filesystem if required.
See Resources & Assets.
SceneUpdateSystems Function
nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, integer step, integer max_physics_step)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, integer step, integer max_physics_step, SceneLuaVM vm)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, NodePairContacts contacts, integer step, integer max_physics_step)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, ScenePhysics physics, NodePairContacts contacts, integer step, integer max_physics_step, SceneLuaVM vm)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, integer step, integer max_physics_step)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, integer step, integer max_physics_step, SceneLuaVM vm)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, NodePairContacts contacts, integer step, integer max_physics_step)nil SceneUpdateSystems(Scene scene, SceneClocks clocks, integer dt, SceneBullet3Physics physics, NodePairContacts contacts, integer step, integer max_physics_step, SceneLuaVM vm)Update a scene and all its optional systems.
ScreenSpaceToClipSpace Function
Transform a screen position to clip space.
Sec Function
number Sec(number seconds)Convert a value in seconds to the Harfang internal unit system.
Seed Function
nil Seed(integer seed)Set the starting seed of the pseudo-random number generator.
Seek Function
Move the handle cursor to a specific position in the file.
SendVRControllerHapticPulse Function
nil SendVRControllerHapticPulse(integer duration)nil SendVRControllerHapticPulse(integer duration, string name)Send an haptic pulse to a named VR controller.
See GetVRControllerNames.
SetAxises Function
Inject X, Y and Z axises into a 3x3 matrix.
SetColumn Function
Returns the nth column.
SetHeight Function
Set a rectangle height.
SetJsonValue Function
Set a JSON key value.
SetListener Function
Set the listener transformation and velocity for spatialization by the audio system.
SetLogDetailed Function
nil SetLogDetailed(boolean is_detailed)Display the details field of log outputs.
SetLogLevel Function
nil SetLogLevel(LogLevel log_level)SetMaterialAlphaCut Function
SetMaterialAmbientUsesUV1 Function
SetMaterialBlendMode Function
Set material blend mode.
SetMaterialDepthTest Function
Set material depth test.
SetMaterialDiffuseUsesUV1 Function
SetMaterialFaceCulling Function
Set material face culling.
SetMaterialNormalMapInWorldSpace Function
SetMaterialProgram Function
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 Function
SetMaterialSpecularUsesUV1 Function
SetMaterialTexture Function
Set a material uniform texture and texture stage.
Note: The texture stage specified should match the uniform declaration in the shader program.
SetMaterialTextureRef Function
Set a material uniform texture reference.
See PipelineResources.
SetMaterialValue Function
Set a material uniform value.
SetMaterialWriteRGBA Function
nil SetMaterialWriteRGBA(Material mat, boolean write_r, boolean write_g, boolean write_b, boolean write_a)Set a material color write mask.
SetMaterialWriteZ Function
Set a material depth write mask.
SetRenderDebug Function
nil SetRenderDebug(DebugFlags flags)Set render system debug flags.
SetRow Function
Sets the nth row of a matrix.
SetS Function
Shortcut for SetScale.
SetSaturation Function
SetScale Function
Set the scaling part of the transformation matrix.
SetSourcePanning Function
Set a playing audio source panning.
SetSourceRepeat Function
Set audio source repeat mode.
SetSourceTimecode Function
Set timecode of the audio source.
SetSourceTransform Function
Set a playing spatialized audio source transformation.
SetSourceVolume Function
Set audio source volume.
SetT Function
Shortcut for SetTranslation.
SetTransform Function
nil SetTransform(Mat4 mtx)Set the model matrix for the next drawn primitive.
If not called, model will be rendered with the identity model matrix.
SetTranslation Function
Sets the 2D translation part, i.e. the first 2 elements of the last matrix row.
SetView2D Function
nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y)nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y, number znear, number zfar)nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y, number znear, number zfar, ClearFlags flags, Color color, number depth, integer stencil)nil SetView2D(integer id, integer x, integer y, integer res_x, integer res_y, number znear, number zfar, ClearFlags flags, Color color, number depth, integer stencil, boolean y_up)High-level wrapper function to setup a view for 2D rendering.
This function calls SetViewClear, SetViewRect then SetViewTransform.
SetViewClear Function
Set a view clear parameters.
See Drawing to Views.
SetViewFrameBuffer Function
Set view output framebuffer.
See Drawing to Views.
SetViewMode Function
Set view draw ordering mode.
SetViewOrthographic Function
nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar)nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number size)nil SetViewOrthographic(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number size, ClearFlags flags, Color color, number depth, integer stencil)High-level wrapper function to setup a view for 3D orthographic rendering.
This function calls SetViewClear, SetViewRect then SetViewTransform.
SetViewPerspective Function
nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar)nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number zoom_factor)nil SetViewPerspective(integer id, integer x, integer y, integer res_x, integer res_y, Mat4 world, number znear, number zfar, number zoom_factor, ClearFlags flags, Color color, number depth, integer stencil)High-level wrapper function to setup a view for 3D perspective rendering.
This function calls SetViewClear, SetViewRect then SetViewTransform.
SetViewRect Function
nil SetViewRect(integer view_id, integer x, integer y, integer w, integer h)SetViewTransform Function
Set view transforms, namely the view and projection matrices.
SetWidth Function
Set a rectangle width.
SetWindowClientSize Function
Set the window client size. The client area of a window excludes its decoration.
SetWindowPos Function
Set window position.
SetWindowTitle Function
Set window title.
SetX Function
Sets the first row.
SetY Function
Sets the second row.
SetZ Function
Sets the third row.
ShowCursor Function
nil ShowCursor()Show the system mouse cursor.
See HideCursor.
Sign Function
Returns a vector whose elements are -1 if the corresponding vector element is < 0 and 1 if it's >= 0.
SkipClock Function
nil SkipClock()Skip elapsed time since the last call to TickClock.
Sleep Function
nil Sleep(integer duration)Sleep the caller thread, this function will resume execution after waiting for at least the specified amount of time.
Slerp Function
Interpolate between the rotation represented by two quaternions. The Spherical Linear Interpolation will always take the shortest path between the two rotations.
SRanipalGetState Function
Return the current SRanipal device state.
SRanipalInit Function
boolean SRanipalInit()Initial the SRanipal eye detection SDK.
SRanipalIsViveProEye Function
boolean SRanipalIsViveProEye()Return true if the eye detection device in use is Vive Pro Eye.
SRanipalLaunchEyeCalibration Function
nil SRanipalLaunchEyeCalibration()Launch the eye detection calibration sequence.
SRanipalShutdown Function
nil SRanipalShutdown()Shutdown the SRanipal eye detection SDK.
StopAllSources Function
nil StopAllSources()Stop all playing audio sources.
StopSource Function
nil StopSource(SourceRef source)Stop a playing audio source.
StreamAudioFileSpatialized Function
string path, SpatializedSourceState state)StreamAudioFileStereo Function
StreamModuleFileSpatialized Function
StreamModuleFileStereo Function
StreamOGGAssetSpatialized Function
StreamOGGAssetStereo Function
StreamOGGFileSpatialized Function
StreamOGGFileStereo Function
StreamWAVAssetSpatialized Function
Start an audio stream from a WAV file from the assets system.
See SetSourceTransform and Resources & Assets.
StreamWAVAssetStereo Function
Start an audio stream from a WAV file from the assets system.
See Resources & Assets.
StreamWAVFileSpatialized Function
Start an audio stream from a WAV file on the local filesystem.
See SetSourceTransform.
StreamWAVFileStereo Function
Start an audio stream from a WAV file on the local filesystem.
See Resources & Assets.
StringToFile Function
boolean StringToFile(string path, string value)Return the content of a file on the local filesystem as a string.
SubmitSceneToForwardPipeline Function
integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources)integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, FrameBufferHandle frame_buffer)integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, FrameBufferHandle frame_buffer, string debug_name)integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, SceneForwardPipelinePassViewId views, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame)integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, SceneForwardPipelinePassViewId views, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer)integer SubmitSceneToForwardPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, SceneForwardPipelineRenderData render_data, PipelineResources resources, SceneForwardPipelinePassViewId views, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer, string debug_name)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 Function
integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb, string debug_name)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, FrameBufferHandle fb, string debug_name)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, ViewState view_state, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer, string debug_name)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer)integer SubmitSceneToPipeline(integer view_id, Scene scene, IntRect rect, boolean fov_axis_is_horizontal, ForwardPipeline pipeline, PipelineResources resources, ForwardPipelineAAA aaa, ForwardPipelineAAAConfig aaa_config, integer frame, FrameBufferHandle frame_buffer, string debug_name)SwapFileExtension Function
string SwapFileExtension(string path, string ext)Return the input file path with its extension replaced.
Tell Function
integer Tell(File file)Return the current handle cursor position in bytes.
TestVisibility Function
Test if a list of 3d points are inside or outside a Frustum.
TickClock Function
integer TickClock()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.
time_from_day Function
integer time_from_day(integer day)Convert days to time.
time_from_hour Function
integer time_from_hour(integer hour)Convert hours to time.
time_from_min Function
integer time_from_min(integer min)Convert minutes to time.
time_from_ms Function
integer time_from_ms(integer ms)Convert milliseconds to time.
time_from_ms_f Function
integer time_from_ms_f(number ms)Convert milliseconds to time.
time_from_ns Function
integer time_from_ns(integer ns)Convert nanoseconds to time.
time_from_sec Function
integer time_from_sec(integer sec)Convert seconds to time.
time_from_sec_f Function
integer time_from_sec_f(number sec)Convert fractional seconds to time.
time_from_us Function
integer time_from_us(integer us)Convert microseconds to time.
time_from_us_f Function
integer time_from_us_f(number us)Convert fractional microseconds to time.
time_now Function
integer time_now()Return the current system time.
time_to_day Function
integer time_to_day(integer t)Convert time to days.
time_to_hour Function
integer time_to_hour(integer t)Convert time to hours.
time_to_min Function
integer time_to_min(integer t)Convert time to minutes.
time_to_ms Function
integer time_to_ms(integer t)Convert time to milliseconds.
time_to_ms_f Function
number time_to_ms_f(integer t)Convert time to miliseconds.
time_to_ns Function
integer time_to_ns(integer t)Convert time to nanoseconds.
time_to_sec Function
integer time_to_sec(integer t)Convert time to seconds.
time_to_sec_f Function
number time_to_sec_f(integer t)Convert time to fractional seconds.
time_to_string Function
string time_to_string(integer t)Return time as a human-readable string.
time_to_us Function
integer time_to_us(integer t)Convert time to microseconds.
time_to_us_f Function
number time_to_us_f(integer t)Convert time to fractional microseconds.
ToEuler Function
Convert a quaternion rotation to its Euler vector representation.
ToFloatRect Function
Return an integer rectangle as a floating point rectangle.
ToHLS Function
Convert input RGBA color to hue/luminance/saturation, alpha channel is left unmodified.
ToIntRect Function
Return a floating point rectangle as an integer rectangle.
ToMatrix3 Function
Convert a quaternion rotation to its Mat3 representation.
Touch Function
nil Touch(integer view_id)Submit an empty primitive to the view.
See Frame.
TransformationMat4 Function
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
TransformFrustum Function
Return the input frustum transformed by the provided world matrix.
TranslationMat3 Function
Return a 2D translation 3x3 matrix from the first 2 components (x,y) of the parameter vector.
TranslationMat4 Function
Return a 4x3 translation matrix from the parameter displacement vector.
Transpose Function
Return the transpose of the input matrix.
For a pure rotation matrix this returns the opposite transformation so that M*MT=I.
Union Function
Compute the union of this bounding volume with another volume or a 3d position.
Unlink Function
boolean Unlink(string path)Remove a file from the local filesystem.
UnloadSound Function
nil UnloadSound(SoundRef snd)Unload a sound from the audio system.
UnprojectFromClipSpace Function
Unproject a clip space position to view space.
UnprojectFromScreenSpace Function
Unproject a screen space position to view space.
UnprojectOrthoFromClipSpace Function
UnprojectOrthoFromScreenSpace Function
UpdateMaterialPipelineProgramVariant Function
Select the proper pipeline program variant for the current material state.
UpdateTexture Function
boolean, Texture, iVec2, TextureFormat UpdateTexture(IVideoStreamer streamer, integer handle, Texture texture, iVec2 size, TextureFormat format)boolean, Texture, iVec2, TextureFormat UpdateTexture(IVideoStreamer streamer, integer handle, Texture texture, iVec2 size, TextureFormat format, boolean destroy)UpdateTextureFromPicture Function
Update texture content from the provided picture.
Note: The picture is expected to be in a format compatible with the texture format.
UpdateWindow Function
boolean UpdateWindow(Window window)Update a window on the host system.
Vec3I Function
Create a vector from integer values in the [0;255] range.
Vec4I Function
Create a vector from integer values in the [0;255] range.
VectorMat3 Function
Return a vector as a matrix.
VertexLayoutPosFloatColorFloat Function
VertexLayoutPosFloatColorUInt8 Function
VertexLayoutPosFloatNormFloat Function
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 Function
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 Function
VertexLayoutPosFloatTexCoord0UInt8 Function
Warn Function
nil Warn(string msg)nil Warn(string msg, string details)WindowHasFocus Function
boolean WindowHasFocus(Window window)Return true if the provided window has focus, false otherwise.
WindowSystemInit Function
nil WindowSystemInit()Initialize the Window system.
WindowSystemShutdown Function
nil WindowSystemShutdown()Shutdown the window system.
See WindowSystemInit.
Wrap Function
number Wrap(number v, number start, number end)integer Wrap(integer v, integer start, integer end)Wrap the input value so that it fits in the specified inclusive range.
WriteFloat Function
Write a binary 32 bit floating point value to a file.
WriteString Function
Write a string to a file as 32 bit integer size followed by the string content in UTF8.
WriteUInt16 Function
Write a binary 16 bit unsigned integer to a file.
WriteUInt32 Function
Write a binary 32 bit unsigned integer to a file.
WriteUInt8 Function
Write a binary 8 bit unsigned integer to a file.
ZoomFactorToFov Function
number ZoomFactorToFov(number zoom_factor)Convert from a zoom factor value in meters to a fov value in radian.