# CONTENTS

# History

Clady3D is a free, easy to use 3D game engine, an Irrlicht wrapper for FreeBasic language .

Will result a compiled executable file for win32. It is not an interpreted code, so it will be very fast.

It continues the way started with Ninfa3D 1.0x serie, an open source project created by David, but stopped at 1.0g version (in 2010). Clady3D comes with many changes, bug fixes and a new syntax in an other logical way structured.

Its target is to the beginners in the 3D game programming using an easy language as the BASIC language is.

# Installation

1.First of all, download and install the FreeBasic compiler 0.21.1 (or the newest version) for win32;

2.Then, download and install an editor for FreeBasic, as FBide or FBedit; I am working with FBide 0.4.6;

3.Download the FB manual 0.21.1 too;

4.Set in the FBide editor the paths to fbc.exe (the freebasic compiler) and to the FB-manual-0.21.1.chm;

5.Copy the Clady3D_examples folder in the root directory of the FreeBasic installation;

6.Copy the Clady3D.bi (library) and force.bi to te inc folder of the FreeBasic installation;

7.Copy all the dlls to the working directory (in the Clady3D_examples folder);

8.Run OpenAL-Install-.exe to install OpenAL library if You haven’t;

9.Download and install the runtime for vc++2008 (vcredist_x86.exe);

10.Ready to start Your work!

# The engine

As a programmer, have in mind, you are working with 2 kind of objects:

- the resources;

- the entities (nodes);

RESOURCES

The resources are:

- the resources stored in your working folders, as bmp, jpg....files, wav, ogg files......

- the resources loaded in memory : images in RAMmemory, textures in videomemory, font_files, zip_files...

ENTITIES

The entities are the visible and/or controlable nodes in the scene: meshes (in Irrlicht, IAnimatedSceneNode), 3D levels as BSP or other 3D format, sky, billboard, terrain, clouds, lensflare, grass, beam, bolt....

The entities(or nodes) have properties and metodes.

Some metodes are global for alls the entities, some metodes are only for individual entities.

The first thing is to load some resources, then create the entity and then set some properties of the entity. In the main loop of the program, the render will be done automaticaly, don’t care about that.

The physic bodies are some special entities (nodes), invisible, but associated with visible meshes wich follow the physics laws.

The physic joints are some special links between 2 bodies;

The physic vehicle can be built from a mesh for chassis and 4 meshes as tires. It can be steered even with a joystick and can have force feedback.

# Features

-support for OpenGL and DirectX9.0c drivers, too;

-support for bmp, jpg, tga, png files;

-support for 3ds, ms3d, x, md2, bsp, csm map and others 3D mesh formats ;

-support for terrain from a heightmap;

-support for GLSL and HLSL shaders;

-support for terrain texture splatting;

-support for collisions between entities based on triangle selectors and response animators;

-support for collisions between a normal mesh and a physic body;

-support for ray collisions;

-support for physics as bodies, joints and vehicles;

-support for joystick and force feedback;

-support for 2D and 3D sound and music (wav and ogg);

-can be added multiplayer support, using the FreeBasic libraries;

- a decent GUI;

# Thanks

Many thanks to David, the creator of the wonderfull Ninfa3D game engine, the starting point of this work.

Many thanks, too, to the Irrlicht3D engine team, to the NewtonGamesDynamics team, to the OpenAL library team, to the OggVorbis library team, to the FreeBasic compiler team, to the FBide editor for FreeBasic team and , not at the last, to the Frank Dodd, the creator of the IrrlichtWrapper for FreeBasic wich inspired me some things.

# Licensing agreement

This software is provided "as-is", without any express or implied warranty. It is free.

In no event shall the author be held liable for any damages arising from the use of this software.

This is a contract. By accepting the Clady3D game engine (the SOFTWARE), you (either an individual or a single entity, the LICENSEE) accept the terms and conditions of this licensing agreement.

If the LICENSEE does not accept the terms and conditions, then LICENSEE must not accept the SOFTWARE.

If at a later time the LICENSEE decides to not continue licensing the SOFTWARE under these terms and conditions, then the LICENSEE must delete permanently all files constituting the SOFTWARE.

# Commands

##

# 1.Beam

## nAddBeam

syntax:

nAddBeam()

description:

add a beam node to the scene, returns a pointer as nBeam

## nSetBeamPosition

syntax:

nSetBeamPosition(beam, startx, starty, startz, endx, endy, endz)

where:

beam as nBeam,

startx, starty, startz as Single, start point

endx, endy, endz as Single, end point

description:

set the beam position

## nSetBeamSize

syntax:

nSetBeamSize(beam, size)

where:

beam as nBeam,

size as Single

description:

set the beam size

# 2.Billboard

## nLoadBillboard

syntax:

nLoadBillboard(file)

where:

file as ZString Ptr

description:

create a billboard node from a file, returns a pointer as nBillboard

## nSetBillboardScale

syntax:

nSetBillboardScale(billbd, sx, sy)

where:

billbd as nBillboard, sx,sy as Single

description:

scale the billboard

## nSetBillboardColor

syntax:

nSetBillboardColor(billbd, R, G, B)

where:

billbd as nBillboard, R,G,B as UInteger

description:

set the color of the billboard

#

# 3.Bolt

## nAddBoltSceneNode

syntax:

nAddBoltSceneNode()

description:

add a bolt to scene as nBolt

## nSetBoltProperties

syntax:

nSetBoltProperties(bolt, sx,sy, sz, ex, ey, ez)

where:

bolt as nBolt,

sx,sy,sz as Single, start point,

ex,ey,ez as Single, end point,

updateTime as uinteger (ex. 50)

height as uinteger (ex. 10)

thickness as single (ex. 5.0)

parts as uinteger (ex. 10)

nr_bolts as uinteger (ex. 6)

steadyend as uinteger (ex. 1)

a as uinteger (0 to 255)

r as uinteger (0 to 255)

g as uinteger (0 to 255)

b as uinteger (0 to 255)

description:

set the properties of the bolt node,( steadyend=0/off, steadyend=1/on)

#

# 4.BSP

## nLoadMeshBSPinRAM

syntax:

nLoadMeshBSPinRAM(file)

where:

file as ZString Ptr

description:

load a BSP mesh in RAM memory (it is not visible), return a pointer as UInteger Ptr

## nCreateNodeBSPfromMeshBSP

syntax:

nCreateNodeBSPfromMeshBSP(meshBSP)

where:

meshBSP as UInteger Ptr

description:

create a scene node BSP, return a pointer as UInteger Ptr (it is visible)

## nCreateNodeBSPfromFile

syntax:

nCreateNodeBSPfromFile(file)

where:

file as ZString Ptr

description:

create a scene node BSP, return a pointer as UInteger Ptr (it is visible)

##

# 5.Camera

## nCreateCamera

syntax:

nCreateCamera()

description:

create a camera, returns a pointer as nCamera

## nCreateCameraFPS

syntax:

nCreateCameraFPS(rots, movs)

where:

rots, movs as Single (rotation speed, move speed)

description:

create a cameraFPS style, returns a pointer as nCamera (WASD and mouse rotation)

## nCreateCameraMaya

syntax:

nCreateCameraMaya(rots, zooms, movs)

where:

rots, zooms, movs as Single

description:

create a camera Maya style, returns a pointer as nCamera

## nCreateCameraIsometric

syntax:

nCreateCameraIsometric(width, height, near, far)

where:

width, height, near, far as Single

description:

create a cameraIsometrtic style, returns a pointer as nCamera

## nEnableControlCamera

syntax:

nEnableControlCamera(camera)

where:

camera as nCamera

description:

enable control camera

## nDisableControlCamera

syntax:

nDisableControlCamera(camera)

where:

camera as nCamera

description:

disable control camera

## nSetCameraFOV

syntax:

nSetCameraFOV(camera, ratio)

where:

camera as nCamera, ratio as Single

sescription:

set the filed of view of the camera

## nSetCameraRange

syntax:

nSetCameraRange(camera, near, far)

where:

camera as nCamera, near, far as Single

description:

set the camera range

## nSetCameraTarget

syntax:

nSetCameraTarget(camera, tx, ty, tz)

where:

camera as nCamera, tx,ty,tz as Single (target position)

description:

set the camera target

## nSetActiveCamera

syntax:

nSetActiveCamera(camera)

where:

camera as nCamera

description:

set a camera to be active

## nSetCameraViewPort

syntax:

nSetCameraViewPort(x1,y1,x2,y2)

where:

x1,y1,x2,y2 as Integer

description:

set the viewport for the active camera

## nSetCameraAspectRatio

syntax:

nSetCameraAspectRatio(camera, aspect_ratio)

where:

camera as nCamera, aspect_ratio as Single

description:

set the aspect ratio of the camera

## nGetCameraTargetX

syntax:

nGetCameraTargetX(camera)

where:

camera as nCamera

description:

return the Xtarget of the camera

## nGetCameraTargetY

syntax:

nGetCameraTargetY(camera)

where:

camera as nCamera

description:

return the Ytarget of the camera

## nGetCameraTargetZ

syntax:

nGetCameraTargetZ(camera)

where:

camera as nCamera

description:

return the Ztarget of the camera

## nGetCameraTargetPos

syntax:

nGetCameraTargetPos(camera, tx,ty,tz)

where:

camera as nCamera, tx,ty,tz as Single

description:

returns in tX, tY, tZ the 3D coordinates of the camera target

## nGetCameraDir

syntax:

nGetCameraDir(camera, dx,dy,dz)

where:

camera as nCamera, dx,dy,dz as Single

description:

returns in dx,dy,dz the direction of the camera

## nGetViewPortWidth

syntax:

nGetViewPortWidth()

description:

returns the viewport width as Integer

## nGetViewPortHeight

syntax:

nGetViewPortHeight()

description:

returns the viewport height as Integer

# 6.Clouds

## nCreateClouds

syntax:

nCreateClouds(texture, LOD, depth, density)

where:

texture as nTexture,

LOD as UInteger, level of detail,

depth as UInteger,

density as UInteger

description:

create clouds, returns a pointer as nClouds

# 7.Collisions

## nDrawLine3D

syntax:

nDrawLine3D(x1,y1,z1,x2,y2,z2,thickness,alpha, R,G,B)

where:

x1,y1,z1,x2,y2,z2,thickness as Single

alpha as UInteger, R,G,B as UInteger

description:

draws a 3D line in the 3D world

## nSetCollisions

syntax:

nSetCollisions(mesh, entity, mode, sx,sy,sz, gravityx,gravityy,gravityz, offsetx, offsety, offsetz)

where:

mesh as nMesh, entity as nEntity,

mode as Integer, (0=box, 1=mesh, 2=octtreemesh, 3=terrain)

sx,sy,sz as Single (elipsoid radius)

gravityx,gravityy,gravityz as Single

offsetx, offsety, offsetz as Single (offset translation of the elipsoid)

description:

create and set a collision response animator, against an entity and a mesh (mesh, a level, terrain)

## nSetCollisionsBSP

syntax:

nSetCollisionsBSP(meshBSP, nodeBSP, entity, sx,sy,sz, gravityx,gravityy,gravityz, offsetx, offsety, offsetz)

where:

meshBSP, nodeBSP as UInteger Ptr,

entity as nEntity

sx,sy,sz as Single (elipsoid radius)

gravityx,gravityy,gravityz as Single

offsetx, offsety, offsetz as Single (offset translation of the elipsoid)

description:

create and set a collision response animator against an entity and a BSP level

## nGetCollisionNodeFromCamera

syntax:

nGetCollisionNodeFromCamera(camera)

where:

camera as nCamera

description:

return a pointer as nENTITY to the collided node from the camera (else 0)

## nGetCollisionNodeFromScreenCoordinates

syntax:

nGetCollisionNodeFromScreenCoordinates(x,y)

where:

x,y as Integer (the screen coordinates)

description:

return a pointer as nEntity to the collided node by a ray from camera to x,y coordinates (else 0)

## nGetCollisionNodeFromRay

syntax:

nGetCollisionNodeFromRay(x1,y1,z1,x2,y2,z2)

where:

x1,y1,z1,x2,y2,z2 as Single (the ray)

description:

return a pointer to the collided node by a ray (else 0)

## nGetScreenCoordinatesFrom3Dposition

syntax:

nGetScreenCoordinatesFrom3Dposition(xscreen, yscreen, xpos,ypos,zpos)

where:

xscreen, yscreen as Integer

xpos,ypos,zpos as Single (3D point)

description:

return in xscreen and yscreen the screen coordinates from a 3D position

## nCreateGeneralTriangleSelector

syntax:

nCreateGeneralTriangleSelector(meshnode,mode)

where:

meshnode as UInteger Ptr (or nMesh)

mode as Integer (box =0, mesh = 1, octtree=2, terrain =3)

description:

create a general triangle selector and set selector to mesh, return a pointer as UInteger Ptr

## nCreateTriangleSelectorBSP

syntax:

nCreateTriangleSelectorBSP(meshBSP,nodeBSP)

where:

meshBSP, nodeBSP as UInteger Ptr

description:

create and set a triangle selector BSP, return a pointer as UInteger Ptr

## nCreateOctTreeTriangleSelector

syntax:

nCreateOctTreeTriangleSelector(meshnode)

where:

meshnode as UInteger Ptr

description:

create and set an octtree triangle selector, return a pointer as UInteger Ptr

## nCreateTriangleSelectorFromBoundingBox

syntax:

nCreateTriangleSelectorFromBoundingBox(meshnode)

where:

meshnode as UInteger Ptr

description:

create and set a triangle selector from a boundin box, return a pointer as UInteger Ptr

## nCreateTerrainSelector

syntax:

nCreateTerrainSelector(terrain)

where:

terrain as nTerrain

description:

create and set a triangle selector for terrain, return a pointer as UInteger Ptr

## nCreateMetaTriangleSelector

syntax:

nCreateMetaTriangleSelector()

description:

create a meta triangle selector to add later others triangle selectors, return a pointer as UInteger Ptr

## nAddTriangleSelector

syntax:

nAddTriangleSelector(metats,ts)

where:

metats, ts as UInteger Ptr

description:

add a triangle selector to a meta triangle selector

## nRemoveAllTriangleSelectors

syntax:

nRemoveAllTriangleSelectors(metats)

where:

metats as UInteger Ptr

description:

remove alls triangle selectors from meta triangle selector

## nRemoveTriangleSelector

syntax:

nRemoveTriangleSelector(metats,ts)

where:

metats, ts as UInteger Ptr

description:

remove an individual triangle selector from a meta triangle selector

## nGetNodeAndCollisionPointFromCamera

syntax:

nGetNodeAndCollisionPointFromCamera(camera, node,trisel,xcoll,ycoll,zcoll)

where:

camera as nCamera

node as nEntity (or UInteger Ptr)

trisel as UInteger Ptr (the triangle selector of the node)

xcoll, ycoll, zcoll as Single

description:

will result in xcoll, ycoll, zcoll the collision point from camera to the node , as single

as a function, will return a value as a node, as UInteger Ptr

ex.

Dim as Single xcoll,ycoll,zcoll

Dim as UInteger Ptr node, collnode

..................................................

collnode = nGetNodeAndCollisionPointFromCamera(camera, node, trisel,xcoll,ycoll,zcoll)

## nGetNodeAndCollisionPointFromRay

syntax:

nGetNodeAndCollisionPointFromRay(x1,y1,z1,x2,y2,z2,node, trisel, xcoll,ycoll,zcoll)

where:

x1,y1,z1,x2,y2,z2 as Single (the ray)

node as UInteger Ptr

trisel as UInteger Ptr

xcoll,ycoll,zcoll as Single

description:

will result in xcoll, ycoll, zcoll the collision point from a ray passing the node , as single

as a function, will return a value as a node, as UInteger Ptr

#

# 8.Entity

##

# 8.1.Entity control

## nDeleteEntity

syntax:

nDeleteEntity(entity)

where:

entity as nEntity

description:

delete the entity

## nShowEntity

syntax:

nShowEntity(entity)

where:

entity as nEntity

description:

show the entity

## nHideEntity

syntax:

nHideEntity(entity)

where:

entity as nEntity

description:

hide the entity

## nSetNameEntity

syntax:

nSetNameEntity(entity, name)

where:

entity as nEntity, name as ZString Ptr

description:

set a new name of the entity

## nSetEntityParent

syntax:

nSetEntityParent(entity, parent)

where:

entity, parent as nEntity

description:

set the parent of the entity

## nSetEntityTexture

syntax:

nSetEntityTexture(entity, texture, layer)

where:

entity as nEntity, texture as nTexture, layer as UInteger

description:

set a texture layer to the entity (an entity can have up to 4 texture layers)

## nSetEntityColor

syntax:

nSetEntityColor(entity, R, G, B)

where:

entity as nEntity, R,G,B as UInteger (0 – 255)

description:

set the color of the entity

## nSetEntitySpecularColor

syntax:

nSetEntitySpecularColor(entity, R, G, B)

where:

entity as nEntity, R,G,B as UInteger (0 – 255)

description:

set the specular color of the entity

## nSetEntityShininess

syntax:

nSetEntityShininess(entity, shininess)

where:

entity as nEntity, shininess as Single

description:

set the shininess of the entity

## nSetEntityAlpha

syntax:

nSetEntityAlpha(entity, alphalevel)

where:

entity as nEntity, alphalevel as UIteger

description:

set the alpha level of the entity

## nSetEntityType

syntax:

nSetEntityType(entity, mat_type)

where:

entity as nEntity, mat_type as MATERIAL_TYPE

MATERIAL_TYPE:

EMT_SOLID = 0

EMT_LIGHTMAP = 1

EMT_LIGHTMAP_ADD = 2

EMT_LIGHTMAP_LIGHTING = 3

EMT_DETAIL_MAP = 4

EMT_SPHERE_MAP = 5

EMT_REFLECTION_2_LAYER = 6

EMT_TRANSPARENT_ADD_COLOR = 7

EMT_TRANSPARENT_ALPHA_CHANNEL = 8

EMT_TRANSPARENT_ALPHA_CHANNEL_REF = 9

EMT_TRANSPARENT_VERTEX_ALPHA = 10

EMT_TRANSPARENT_REFLECTION_2_LAYER = 11

EMT_NORMAL_MAP_SOLID = 12

EMT_PARALLAX_MAP_SOLID = 13

EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR = 14

EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA = 15

EMT_ONETEXTURE_BLEND = 16

description:

set the type of the all materials of the entity

## nSetEntityFlag

syntax:

nSetEntityFlag(entity, mat_flag)

where:

entity as nEntity, mat_flag as MATERIAL_FLAG

MATERIAL_FLAG:

MF_WIREFRAME = 0

MF_POINTCLOUD = 1

MF_FLAT = 2

MF_FULLBRITGH = 3

MF_ZBUFFER = 4

MF_ZWRITER = 5

MF_BACKFACE = 6

MF_FRONTFACE = 7

MF_FOG = 8

MF_NORMALIZE = 9

MF_WRAP = 10

MF_COLOR_MASK = 11

MF_COLOR_MATERIAL = 12

description:

set the flag of the all materials of the entity

## nCloneEntity

syntax:

nCloneEntity(entity)

where:

entity as nEntity

description:

make a clone of the entity, returns a pointer as nEntity

# 8.2.Entity movement

## nSetEntityPosition

syntax:

nSetEntityPosition(entity, x, y, z)

where:

entity as nEntity, x,y,z as Single

description:

set the new position of the entity

## nSetEntityAbsoluteRotation

syntax:

nSetEntityAbsoluteRotation(entity, xangle, yangle, zangle)

where:

entity as nEntity, xangle, yangle, zangle as Single

description:

set the global rotation of the entity

## nSetEntityLocalRotation

syntax:

nSetEntityLocalRotation(entity, xstepangle, ystepangle, zstepangle)

where:

entityas nEntity, xstepangle, ystaepangle,zstepangle as Single

description:

set the turning step angle of the entity around its local axes

## nSetEntityLocalRotation2

syntax:

nSetEntityLocalRotation2(entity, xstepangle, ystepangle, zstepangle)

where:

entityas nEntity, xstepangle, ystaepangle,zstepangle as Single

description:

set the turning step angle of the entity around its local axes

## nSetEntityRelMove

syntax:

nSetEntityRelMove(entity, xstep, ystep, zstep)

where:

entity as nEntity, xstep, ystep, zstep as Single

description:

set the linear step to move entity against the old position

## nSetEntityToPoint

syntax:

nSetEntityToPoint(entity1, entity2)

where:

entity1, entity2 as nEntity

description:

rotate the entity1 toward entity2

## nSetEntityPointToTarget

syntax:

nSetEntityPointToTarget(entity, xtarget, ytarget, ztarget)

where:

entity as nEntity, xtarget, ytarget, ztarget as Single

description:

rotate the entity toward a target point

# 8.3.Entity state

## nGetEntityX

syntax:

nGetEntityX(entity)

where:

entity as nEntity

description:

returns the x position of the entity as Single

## nGetEntityY

syntax:

nGetEntityY(entity)

where:

entity as nEntity

description:

returns the y position of the entity as Single

## nGetEntityZ

syntax:

nGetEntityZ(entity)

where:

entity as nEntity

description:

returns the z position of the entity as Single

## nGetEntityPitch

syntax:

nGetEntityPitch(entity)

where:

entity as nEntity

description:

returns teh absolute rotation around x axe as Single

## nGetEntityYaw

syntax:

nGetEntityYaw(entity)

where:

entity as nEntity

description:

returns teh absolute rotation around y axe as Single

## nGetEntityRoll

syntax:

nGetEntityRoll(entity)

where:

entity as nEntity

description:

returns teh absolute rotation around z axe as Single

## nGetEntityName

syntax:

nGetEntityName(entity)

where:

entity as nEntity

description:

returns the name of the entity as ZString Ptr

## nGetLinePick

syntax:

nGetLinePick(x1, y1, z1, x2, y2, z2)

where:

x1,y1,z1,x2,y2,z2 as Single

description:

returns the pointer of the picked entity by a 3D line, as nEntity

## nGetEntitiesDistance

syntax:

nGetEntitiesDistance(entity1, entity2)

where:

entity1, entity2 as nEntity

description:

returns the distances between 2 entities, as Single

## nGetDistance

syntax:

nGetDistance(x1, y1, z1, x2, y2, z2)

where:

x1,y1,z1,x2,y2,z2 as Single

description:

returns the distance between two 3D points, as Single

## nGetEntitiesCollide

syntax:

nGetEntitiesCollide(entity1, entity2)

where:

entity1, entity2 as nEntity

description:

returns 1 if the two entities collide

## nGetDirection

syntax:

nGetDirection(x1,y1,z1,x2,y2,z2,dx,dy,dz)

where:

x1,y1,z1,x2,y2,z2,dx,dy,dz as Single

description:

returns in dx,dy,dz the direction of the 3D line

## nGetHorAngle

syntax:

nGetHorAngle(entity, xtarget, ytarget, ztarget)

where:

entity as nEntity, xtarget, ytarget, ztarget as Single

description:

returns the horizontale angle between the entity and a target, as Single

#

# 9.Fader

## nSetFadeIn

syntax:

nSetFadeIn(t)

where:

t as UInteger, time

description:

set the time transition of the FadeIn

## nSetFadeOut

syntax:

nSetFadeOut(t)

where:

t as UInteger, time

description:

set the time transition of the FadeOut

## nSetFaderColor

syntax:

nSetFaderColor(R, G, B)

where:

R,G,B as UInteger (0 – 255)

description:

set the fader color

## nGetFadeIsReady

syntax:

nGetFadeIsReady()

description:

returns 1 if fader is ready

##

###

# 10.File

## nChangeDirectory

syntax:

nChangeDirectory(directory)

where:

directory As Zstring Ptr

description:

change the current directory to directory

## nGetExistFile

syntax:

nGetExistFile(file)

where:

file as Zstring ptr

description:

returns 1 if file exist

## nLoadZip

syntax:

nLoadZip(zip_file)

where:

zip_file as Zstring ptr, the zip file

description:

load a zip file

## File I/O funtions

You can use the native File I/O functions of the FreeBasic language, see the doc file of the FreeBasic.

## nLoadScene

syntax:

nLoadScene(file)

where:

file as Zstring ptr, the irr file

description:

load a irr scene before saved

## nSaveScene

syntax:

nSaveScene(file)

where:

file as Zstring ptr, the irr file

description:

save an irr scene

# 11.Font

## nLoadFont

syntax:

nLoadFont(file)

where:

file as Zstring ptr

description:

load a font file and returns a pointer as nFONT

## nSetFont

syntax:

nSetFont(font)

where:

font as nFont

Description:

set the active font to use

## nDrawFontText

syntax:

nDrawFontText(x, y, text_string, cenx, ceny)

where:

x,y as Integer, 2D position on the screen

text as ZString ptr, the string text to write

cenx, ceny as Integer (offset)

description:

writes a string text on the screen

# 12.Globals

## nSetBackGroundColor

syntax:

nSetBackGroundColor(R,G,B)

where:

R,G,B as UInteger (0-255)

description:

set the background color

## nSetAmbientLight

syntax:

nSetAmbientLight(R,G,B)

where:

R,G,B as UInteger (0-255)

description:

set the ambient light color

## nSetShadowColor

syntax:

nSetShadowColor(r,g,b,a)

where:

R,G,B,A as UInteger (0-255)

description:

set the shadow color

##

## nSetFog

syntax:

nSetFog(R,G,B,density)

where:

R,G,B as UInteger, density as Single

description:

set the color and the density of the fog

## nScreenShot

syntax:

nScreenShot()

description:

take a screenshoot

## InitEngine

syntax:

InitEngine(drivertype,w,h,bpp,mode)

where:

drivertype as Integer ( 0=OpenGL, 1=DirectX9.0c)

w,h as Integer (width, height resolution)

bpp as Integer (bit per pixel)

mode as Integer (0=windowed, 1= fullscreen)

description:

init the Clady3D engine

## EngineRun

syntax:

EngineRun()

description:

return 1 if engine is running, as Integer

## UpdateEngine

syntax:

UpdateEngine(timestep, updatemode)

where:

timesptep as Single

updatemode :

UP_ALL = 0

UP_GRAPHICS = 1

UP_PHYSICS = 2

UP_SOUNDS = 3

description:

update the engine in the main loop

## CloseEngine

syntax:

CloseEngine()

description:

close the engine

## EndEngine

syntax:

EndEngine()

Description:

end the engine

## nEnableAntialias

syntax:

nEnableAntialias()

description:

enable antialias

## nEnableVsync

syntax:

nEnableVsync()

description:

enable vsync

## nSetFrameRateLimit

syntax:

nSetFrameRateLimit(limit)

where:

limit as UInteger

description:

set the frame rate limit

## BeginScene

syntax:

BeginScene()

description:

begin the scene (render)

## EndScene

syntax:

EndScene()

description:

end the scene

## Fps

syntax:

Fps()

description:

return the frames per second, as Single

## nGetTrisRendered

syntax:

nGetTrisRendered()

description:

return the triangles rendered as UInteger

## nGetLightCount

syntax:

nGetLightCount()

description:

return the light count, as UInteger

## nGetPrimitiveCount

syntax:

nGetPrimitiveCount()

description:

return the primitives count, as Integer

## nGetBodyCount

syntax:

nGetBodyCount()

description:

return the bodies count, as Integer

# 13.Graphics 2D

## nSetTransparency2D

syntax:

nSetTransparency2D(transparency_level)

where:

transparency_level as Uinteger, level of transparency (0 to 255);

description:

set the transparency of 2d graphic objects on the screen;

## nSetColors2D

syntax:

nSetColors2D(R, G, B)

where:

R as Uinteger, G as Uinteger, B as Uinteger (0 to 255);

description:

set the colors for the graphic operations on the screen;

## nDrawLine2D

syntax:

nDrawLine2D(x1, y1, x2, y2)

where:

x1,y1,x2,y2 as Integer ( x1y1 start point, x2y2 end point);

description:

draws a 2D line on the screen

## nDrawRect2D

syntax:

nDrawRect2D(x, y, width, height)

where:

x,y,width,height as Integer (x,y top-left corner);

description:

draws a rectangle 2D on the screen;

## nDrawPixel2D

syntax:

nDrawPixel2D(x, y)

where:

x,y as Integer;

description:

draws a pixel at x,y coordinates on the screen;

## nDrawImage2D

syntax:

nDrawImage2D(texture, x, y)

where:

texture as nTexture, x,y as Integer;

description:

draws an image from a texture on the screen (top-left corner at x,y)

## nDrawImage2DwithAlpha

syntax:

nDrawImage2DwithAlpha(texture, x, y, usealpha)

where:

texture as nTexture, x,y as Integer, usealpha as Integer (0 – no alpha, 1 – with alpha)

description:

draws an image on the screen using the alpha channel(the texture must be a .tga or a .png file);

## nDrawOval2D

syntax:

nDrawOval2D(x, y, radius)

where:

x,y as Integer (center), radius as Single;

description:

draws an circle on the screen

## nDrawImageSprites2D

syntax:

nDrawImageSprites2D(texture, x, y, start_x, start_y, end_x, end_y)

where:

x, y, start_x, start_y,end_x, end_y as Integer;

description:

Draws a part of a texture at x,y on the screen , starting at start_x, start_y, ending at end_x, end_y;

## nCreateImage

syntax:

nCreateImage(w, h, color_format)

where:

w,h as Integer, color_format as IRR_COLOR_FORMAT enumeration;

A color format specifies how color information is stored:

ECF_A1R5G5B5 = 0 16 bit color format used by the software driver, and thus preferred by all other irrlicht engine video drivers. There are 5 bits for every color component, and a single bit is left for alpha information.

ECF_R5G6B5 = 1 Standard 16 bit color format.

ECF_R8G8B8 = 2 24 bit color, no alpha channel, but 8 bit for red, green and blue.

ECF_A8R8G8B8 = 3 Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.

description:

create a blank image in RAM memory (returns a pointer as nImage);

nLoadImageFromFile

syntax:

nLoadImageFromFile(filename)

where:

filename as zstringptr ;

description:

load an image from file in RAM memory (returns a pointer as nImage)

## nRemoveImage

syntax:

nRemoveImage(image)

where:

image as nImage;

description:

remove an image freeing its resources

## nLockImage

syntax:

nLockImage(image)

where:

image as nImage;

description:

locks the image and returns a pointer to the pixels

## nUnlockImage

syntax:

nUnlockImage(image)

where:

image as nImage;

description:

unlock the image, presumably after it has been modified

## nCopyImageToScaling

syntax:

nCopyImageToScaling(imgsrc, imgtarget)

where:

imgsrc,imgtarget as nImage;

description:

copy and scaling an image

## nGetImageWidth

syntax:

nGetImageWidth(image)

where:

image as nImage;

description:

Returns the width of the image in pixels;

## nGetImageHeight

syntax:

nGetImageHeight(image)

where:

image as nImage;

description:

Returns the height of the image in pixels;

## nBlendImages

syntax:

nBlendImages(destination_image, source_image, x_offset, y_offset, operation)

where:

destination_image, source_image as nImage; x_offset, y_offset, operation as Integer;

blend operations:

BLEND_SCREEN = 0

BLEND_ADD = 1

BLEND_SUBTRACT = 2

BLEND_MULTIPLY = 3

BLEND_DIVIDE = 4

description:

blend the source image into the destination image to create a single image;

Returns 1 if success;

## nAlphaBlendImages

syntax:

nAlphaBlendImages(destination_image, source_image, alpha_image, alphacolorchannel)

where:

destination_image, source_image, alpha_image as nImage;

alphacolorchannel as ALPHA_CHANNEL_COLOR;

ALPHA_CHANNEL_COLOR :

ALPHA_RED = 1

ALPHA_GREEN = 2

ALPHA_BLUE = 3

ALPHA_ALPHA = 4

description:

blend the source image into the destination image using a third alphamap with rgb channels to create a single image

Returns 1 if success;

## nPaintTileImageWithAlpha

syntax:

nPaintTileImageWithAlpha(destination_image, source_image, xpos, ypos, radius, alpha)

where:

destination_image, source_image as nImage;

xpos, ypos, radius, alpha as Integer; (alpha = 0 to 255)

description:

paint the destination(base) image with a source image using an alpha value at x,y position of radius

Returns 1 if success;

# 14.Grass

## nAddGrass

syntax:

nAddGrass(terrain, x, z, patchSize, grassScale, maxDensity, dataPositionX, dataPositionY, heightMap, textureMap, grassMap, grassTexture)

where:

terrain as nTerrain,

x,z, as Integer,

patchSize as Integer (of the terrain),

grassScale as Single,

maxDensity as UInteger,

dataPozitionX, dataPositionY as Integer,

heightMap as nImage,

textureMap as nImage,

grassMap as nImage,

grassTexture as nTexture

description:

add grass to scene , returns a pointer as nGrass

## nSetGrassDensity

syntax:

nSetGrassDensity(grass, density, distance)

where:

grass as nGrass,

density as Integer,

distance as Single

description:

set grass density

## nSetGrassWind

syntax:

nSetGrassWind(grass, strenghtwind, regularity)

where:

grass as nGrass,

strenghtwind as Single,

regularity as Single

description:

set grass wind

## nGetGrassDrawCount

syntax:

nGetGrassDrawCount(grass)

where:

grass as nGrass

description:

returns grass count as UInteger

# 15.Input

## KeyDown

syntax:

KeyDown(keystate)

where:

keystate - see inputstate list

description:

return 1 if true

## KeyHit

syntax:

KeyHit(keystate)

where:

keystate - see inputstate list

description:

return 1 if true

## MouseHit

syntax:

MouseHit(state)

where:

state - see inputstate list

description:

return 1 if true

## MouseDown

syntax:

MouseDown(state)

where:

state - see inputstate list

description:

return 1 if true

## MoveMouse

syntax:

MoveMouse(x, y)

where:

x, y as integer, mouse position

description:

move mouse at x,y points

## nGetMouseWheel

syntax:

nGetMouseWheel()

description:

returns + or – if mouse wheel is active

## nGetMouseX

syntax:

nGetMouseX()

description:

returns x mouse position as integer

## nGetMouseY

syntax:

nGetMouseY()

description:

returns y mouse position as integer

## ShowMouse

syntax:

ShowMouse()

description:

shows the mouse on the screen

## HideMouse

syntax:

HideMouse()

description:

hides the mouse

## Joystick

You can use the native function of the FreeBasic language, see the doc file of the FreeBasic (GetJoystick()).

example:

Dim x as Single

Dim y as Single

Dim buttons as Integer

Dim result as Integer

......................................

in the main loop:

result = GetJoystick(JoystickID, buttons, x,y)

# Keyboard & Mouse

## Keyboard

KEY_LBUTTON

KEY_RBUTTON

KEY_CANCEL

KEY_MBUTTON

KEY_XBUTTON1

KEY_XBUTTON2

KEY_BACK

KEY_TAB

KEY_CLEAR

KEY_RETURN

KEY_SHIFT

KEY_CONTROL

KEY_MENU

KEY_PAUSE

KEY_CAPITAL

KEY_KANA

KEY_HANGUEL

KEY_HANGUL

KEY_JUNJA

KEY_FINAL

KEY_HANJA

KEY_KANJI

KEY_ESCAPE

KEY_CONVERT

KEY_NONCONVERT

KEY_ACCEPT

KEY_MODECHANGE

KEY_SPACE

KEY_PRIOR

KEY_NEXT

KEY_END

KEY_HOME

KEY_LEFT

KEY_UP

KEY_RIGHT

KEY_DOWN

KEY_SELECT

KEY_PRINT

KEY_EXECUT

KEY_SNAPSHOT

KEY_INSERT

KEY_DELETE

KEY_HELP

#define KEY_0

KEY_1

KEY_2

KEY_3

KEY_4

KEY_5

KEY_6

KEY_7

KEY_8

KEY_9

KEY_A

KEY_B

KEY_C

KEY_D

KEY_E

KEY_F

KEY_G

KEY_H

KEY_I

KEY_J

KEY_K

KEY_L

KEY_M

KEY_N

KEY_O

KEY_P

KEY_Q

KEY_R

KEY_S

KEY_T

KEY_U

KEY_V

KEY_W

KEY_X

KEY_Y

KEY_Z

KEY_LWIN

KEY_RWIN

KEY_APPS

KEY_SLEEP

KEY_NUMPAD0

KEY_NUMPAD1

KEY_NUMPAD2

KEY_NUMPAD3

KEY_NUMPAD4

KEY_NUMPAD5

KEY_NUMPAD6

KEY_NUMPAD7

KEY_NUMPAD8

KEY_NUMPAD9

KEY_MULTIPLY

KEY_ADD

KEY_SEPARATOR

KEY_SUBTRACT

KEY_DECIMAL

KEY_DIVIDE

KEY_F1

KEY_F2

KEY_F3

KEY_F4

KEY_F5

KEY_F6

KEY_F7

KEY_F8

KEY_F9

KEY_F10

KEY_F11

KEY_F12

KEY_F13

KEY_F14

KEY_F15

KEY_F16

KEY_F17

KEY_F18

KEY_F19

KEY_F20

KEY_F21

KEY_F22

KEY_F23

KEY_F24

KEY_NUMLOCK

KEY_SCROLL

KEY_LSHIFT

KEY_RSHIFT

KEY_LCONTROL

KEY_RCONTROL

KEY_LMENU

KEY_RMENU

KEY_PLUS

KEY_COMMA

KEY_MINUS

KEY_PERIOD

KEY_ATTN

KEY_CRSEL

KEY_EXSEL

KEY_EREOF

KEY_PLAY

KEY_ZOOM

KEY_PA1

KEY_OEM_CLEAR

KEY_CODES_COUNT

## Mouse

MOUSE_LEFT

MOUSE_MIDDLE

MOUSE_RIGHT

# 16.Lens Flare

## nCreateLensFlareNode

syntax:

nCreateLensFlareNode(texture)

where:

texture as nTexture

description:

create a lens flare, returns a pointer as nLensFlare

## nsetLensFlareScale

syntax:

nsetLensFlareScale(flare, source, optics)
where:

flare as nLensFlare,

source as Single,

optics as Single

description:

set lens flare

# 17.Light

## nCreateLight

syntax:

nCreateLight(mode)

where:

mode as LIGHT_TYPE

LGT_POINT = 0

LGT_SPOT = 1

LGT_DIRECTIONAL = 2

description:

create a light (point, spot or directional), returns a pointer as nLight

## nSetLightRadius

syntax:

nSetLightRadius(light, radius)

where:

light as nLight, radius as Single

description:

set the radius light

## nSetLightCastShadow

syntax:

nSetLightCastShadow(light)

where:

light as nLight

description:

set the light to cast shadow (later, must set mesh cast shadow)

## nSetLightColor

syntax:

nSetLightColor(light, R, G, B)

where:

light as nLight, R, G, B as UInteger (0-255)

description:

set the light color

## nSetLightFalloff

syntax:

nSetLightFalloff(light, falloff)

where:

light as nLight falloff as Single

description:

Changing the value of “falloff” can decrease the intensity between exterior and interior of the cone of the spot light

## nSetLightConeAngles

syntax:

nSetLightConeAngles(light, inner, outer)

where:

light as nLight, inner, outer as Single

description:

set the angles of the spot light

## nSetLightAttenuation

syntax:

nSetLightAttenuation(light, c, l, q)

where:

light as nLight, c, l, q as Single constant, linear, quadratic)

description:

set the light attenuation

## nSetLightDirection

syntax:

nSetLightDirection(light, dx, dy, dz)

where:

light as nLight, dx,dy,dz as Single

description:

set the light direction

# 18.Materials

# 18.1.For meshes

A mesh may have many materials on them and each material may have up to 4 texture layers, depends of the material type

## nSetMaterialType

syntax:

nSetMaterialType(entity, mat_num, mat_type)

where:

entity as nEntity, mat_num as UInteger, mat_type as MATERIAL_TYPE

mat_num is the number of the material (start with 0)

mat_type is the type of the material, see MATERIAL_TYPE list

description:

set the material type of the entity, one by one, individual

MATERIAL_TYPE:

EMT_SOLID = 0

EMT_LIGHTMAP = 1

EMT_LIGHTMAP_ADD = 2

EMT_LIGHTMAP_LIGHTING = 3

EMT_DETAIL_MAP = 4

EMT_SPHERE_MAP = 5

EMT_REFLECTION_2_LAYER = 6

EMT_TRANSPARENT_ADD_COLOR = 7

EMT_TRANSPARENT_ALPHA_CHANNEL = 8

EMT_TRANSPARENT_ALPHA_CHANNEL_REF = 9

EMT_TRANSPARENT_VERTEX_ALPHA = 10

EMT_TRANSPARENT_REFLECTION_2_LAYER = 11

EMT_NORMAL_MAP_SOLID = 12

EMT_PARALLAX_MAP_SOLID = 13

EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR = 14

EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA = 15

EMT_ONETEXTURE_BLEND = 16

## nSetMaterialFlag

syntax:

nSetMaterialFlag(entity, mat_num, mat_flag, mode)

where:

entity as nEntity, mat_num as UInteger, mat_flag as MATERIAL_FLAG, mode as Integer

mat_num is the number of the material (start with 0)

mat_flag is the flag of the material, see MATERIAL_FLAG list

mode can be 0 or 1, means off or on

description:

set the material flag of the entity, one by one, individual

MATERIAL_FLAG:

MF_WIREFRAME = 0

MF_POINTCLOUD = 1

MF_FLAT = 2

MF_FULLBRITGH = 3

MF_ZBUFFER = 4

MF_ZWRITER = 5

MF_BACKFACE = 6

MF_FRONTFACE = 7

MF_FOG = 8

MF_NORMALIZE = 9

MF_WRAP = 10

MF_COLOR_MASK = 11

MF_COLOR_MATERIAL = 12

## nSetMaterialTexture

syntax:

nSetMaterialTexture(entity, num_mat, texture, layer)

where:

entity as nEntity, num_mat as UInteger, texture as nTexture, layer as UInteger

description:

an entity can have more materials and each material can have up to 4 texture layers, depends by material type

set the texture for layer „layer” for material mat_num of the entity

## nSetMaterialColor

syntax:

nSetMaterialColor(entity, num_mat, R, G, B)

where:

entity as nEntity, num_mat as UInteger, R,G,B as UInteger (0-255)

description:

set the material color

## nSetMaterialEmissiveColor

syntax:

nSetMaterialEmissiveColor(entity, num_mat, R, G, B)

where:

entity as nEntity, num_mat as UInteger, R,G,B as UInteger (0-255)

description:

set the emissive color of the material

## nSetMaterialShininess

syntax:

nSetMaterialShininess(entity, num_mat, shininess)

where:

entity as nEntity, num_mat as UInteger, shininess as Single

description:

set the shininess of the material

## nSetMaterialAlpha

syntax:

nSetMaterialAlpha(entity, num_mat, level)

where:

entity as nEntity, num_mat as UInteger, level as UInteger

description:

set the alpha level of transparency for the material mat_num

## nSetMaterialTextureUV

syntax:

nSetMaterialTextureUV(entity, num_mat, layer, u,v)

where:

entity as nEntity, mat_num as UInteger, layer as UInteger, u,v as Single

description:

set the u,v coordinate of the texture

## nSetMaterialTextureAngle

syntax:

nSetMaterialTextureAngle(entity, num_mat, layer, angle)

where:

entity as nEntity, num_mat as UInteger, layer as UInteger, angle as Single

description:

set the angle of the texture

## nSetMaterialTextureScale

syntax:

nSetMaterialTextureScale(entity, num_mat, layer, sx,sy)

where:

entity as nEntity, num_mat as UInteger, layer as UInteger, sx,sy as Single

description:

scale the texture

## nGetMaterialCount

syntax:

nGetMaterialCount(entity)

where:

entity as nEntity

description:

gets the total number of materials of the entity, returns a value as UInteger

# 18.2.For Bodies

## nCreateBodyMaterial

syntax:

nCreateBodyMaterial()

description:

create a material for bodies, returns a pointer as nMaterial

## nSetBodyMaterial

syntax:

nSetBodyMaterial(body, material)

where:

body as nBody, material as nMaterial

description:

binds a body with material

## nSetBodyMaterialElasticity

syntax:

nSetBodyMaterialElasticity(material1, material2, elasticity)

where:

material1, material2 as nMaterial, elasticity as Single

description:

set the elasticity between 2 materials

## nSetBodyMaterialFriction

syntax:

nSetBodyMaterialFriction(material1, material2, friction)

where:

material1, material2 as nMaterial, friction as Single

description:

set the friction between 2 materials

## nSetBodyMaterialSoftness

syntax:

nSetBodyMaterialSoftness(material1, material2, softness)

where:

material1, material2 as nMaterial, softness as Single

description:

set the softness between 2 materials

## nSetBodyMaterialCollidable

syntax:

nSetBodyMaterialCollidable(material1, material2, mode)

where:

material1, material2 as nMaterial, mode as Integer

description:

set on(1) or off(0) if 2 materials are collidable

# 19.Maths

## nGetWrapValue

syntax:

nGetWrapValue(newvalue, oldvalue, increment)

where:

newvalue, oldvalue, increment as Single

description:

returns a calculated wrap value as Single, used with angles greater than 360

## nGetCurveValue

syntax:

nGetCurveValue(newvalue, oldvalue, nrsteps)

where:

newvalue, oldvalue, nrsteps as Single

description:

returns an interpolated value as Single

## nGetDistance2D

syntax:

nGetDistance2D(x1, y1, x2, y2)

where:

x1,y1,x2,y2 as Single

description:

returns the distance between 2 points in 2D as Single

## nGetDistance3D

syntax:

nGetDistance3D(x1, y1, z1, x2, y2, z2)

where:

x1,y1,z1,x2,y2,z2 as Single

description:

returns the distance between 2 points in 3D as Single

## nGetMin

syntax:

nGetMin(value1, value2)

where:

value1, value2 as Single

description:

returns the min value as Single

## nGetMax

syntax:

nGetMax(value1, value2)

where:

value1, value2 as Single

description:

returns the max value as Single

## nGetRand

syntax:

nGetRand(value1, value2)

where:

value1, value2 as Integer

description:

returns a random value between value1 and value2 as Integer

# 20.Mesh

## nCreateMeshNull

syntax:

nCreateMeshNull()

description:

create a meshnull, returns a pointer as nMesh

## nCreateMeshCube

syntax:

nCreateMeshCube()

description:

create a mesh cube, returns a pointer as nMesh

## nCreateMeshSphere

syntax:

nCreateMeshSphere(polycount)

where:

polycount as UInteger

description:

create a mesh sphere, returns a pointer as nMesh

## nCreateMeshCylinder

syntax:

nCreateMeshCylinder(polycount)

where:

polycount as UInteger

description:

create a mesh cylinder, returns a pointer as nMesh

## nCreateMeshCone

syntax:

nCreateMeshCone(polycount)

where:

polycount as UInteger

description:

create a mesh cone, returns a pointer as nMesh

## nCreateMeshPlane

syntax:

nCreateMeshPlane(size, tilecount)

where:

size as Single, tilecount as UInteger

description:

create a mesh plane, returns a pointer as nMesh

## nCreateMeshWater

syntax:

nCreateMeshWater(height, speed, lenght)

where:

height, speed, lenght as Single

description:

create a water node, returns a pointer as nEntity

## nLoadMesh

syntax:

nLoadMesh(file, toTangents)

where:

file as ZString Ptr, toTangents as VERTEX_TYPE

VERTEX_TYPE:

VT_TCOORS = 0

VT_TANGENTS = 1

description:

load a mesh as an animated scene node, returns a pointer as nMesh

## nSetMeshCastShadow

syntax:

nSetMeshCastShadow(mesh)

where:

mesh as nMesh

description:

set the mesh to cast shadow (before must set light cast shadow)

## nDrawOutlineMesh

syntax:

nDrawOutlineMesh(mesh, w, R, G, B)

where:

mesh as nMesh, w as Single (thickness), R, G, B as UInteger

description:

if call in main loop, draws outline mesh

## nSetMeshScale

syntax:

nSetMeshScale(mesh, sx, sy, sz)

where:

mesh as nMesh, sx,sy,sz as Single

description:

scale the mesh

## nAnimateMesh

syntax:

nAnimateMesh(mesh, looped, speed, begin, end, time)

where:

mesh as nMesh, looped as Integer, speed as Single, beginframe, endframe as Integer, time as Single

description:

set the animation parameters for a mesh

## nGetMeshesCollide

syntax:

nGetMeshesCollide(mesh1, mesh2)

where:

mesh1, mesh2 as nMesh

description:

returns 1 if mesh1 and mesh2 collided

## nGetVertexCount

syntax:

nGetVertexCount(mesh)

where:

mesh as nMesh

description:

returns the number of the vertices

## nGetCurrentFrame

syntax:

nGetCurrentFrame(mesh)

where:

mesh as nMesh

description:

returns the current frame as Integer

## nGetStartFrame

syntax:

nGetStartFrame(mesh)

where:

mesh as nMesh

description:

returns the start frame as Integer

## nGetEndFrame

syntax:

nGetEndFrame(mesh)

where:

mesh as nMesh

description:

returns the end frame as Integer

## nGetChildrenCount

syntax:

nGetChildrenCount(mesh)

where:

mesh as nMesh

description:

returns the children count of the mesh as UInteger

## nGetChildByName

syntax:

nGetChildByName(mesh, nameChild)

where:

mesh as nMesh, nameChild as ZString Ptr

description:

returns a pointer as nChild

## nGetChildByIndex

syntax:

nGetChildByIndex(mesh, indexChild)

where:

mesh as nMesh, indexChild as UInteger

description:

returns a pointer as nChild

## nGetChildName

syntax:

nGetChildName(child)

where:

child as nChild

description:

returns the name of the child as ZString Ptr

## nSetChildMode

syntax:

nSetChildMode(mesh, mode)

where:

mesh as nMesh, mode as Integer

mode:

C_NONE = 0

C_READ = 1

C_CONTROL = 2

C_COUNT = 3

description:

set the child mode

# 21.Particles

##

# 21.1.Particles

## nCreateParticle

syntax:

nCreateParticle()

description:

add a particle node to scene, returns a pointer as nParticle

## nSetParticleEndSize

syntax:

nSetParticleEndSize(particle, sx,sy)

where:

particle as nParticle, sx,sy as Single

description:

set the end size of the particle

## nSetParticleGravity

syntax:

nSetParticleGravity(particle, gx,gy,gz)

where:

particle as nParticle, gx,gy,gz as Single, the gravity on x,y,z directions

description:

set the gravity of the particles

# 21.2.Global emitter functions

## nSetEmitterDirection

syntax:

nSetEmitterDirection(emitter, dx,dy,dz)

where:

emitter as nEmitter, dx,dy,dz as single, the direction

description:

set the direction of the emitter

## nSetEmitterPPS

syntax:

nSetEmitterPPS(emitter, minpps, maxpps)

where:

emitter as nEmitter, minpps, maxpps as Integer

description:

set the min and the max particles per second

## nSetEmitterStartColor

syntax:

nSetEmitterStartColor(emitter, minR, minG, minB, maxR, maxG, maxB)

where:

emitter as nEmitter, minR, minG, minB, maxR, maxG, maxB as Integer (0-255)

description:

set the min and the max R,G,B color

## nSetEmitterStartSize

syntax:

nSetEmitterStartSize(emitter, minx, miny, maxx, maxy)

where:

emitter as nEmitter, minx,miny,maxx,maxy as Integer

description:

set the min and the max start size

# 21.3.Box Emitter

## nCreateBoxEmitter

syntax:

nCreateBoxEmitter(particle, minv, maxv)

where:

particle as nParticle, minv,maxv as UInteger

description:

create a box emitter associated with particle, returns a pointer as nEmitter

## nSetBoxEmitterSize

syntax:

nSetBoxEmitterSize(emitter, sx,sy,sz)

where:

emitter as nEmitter, sx,sy,sz as Single

description:

set the emitter size

# 21.4.Cylinder Emitter

## nCreateCylinderEmitter

syntax:

nCreateCylinderEmitter(particle, minv, maxv)

where:

particle as nParticle, minv, maxv as UInteger

description:

create a cylinder emitter associated with particle, returns a pointer as nEmitter

## nSetCylinderEmitterCenter

syntax:

nSetCylinderEmitterCenter(emitter, x,y,z)

where:

emitter as nEmitter, x,y,z as Single

description:

set the center of the cylinder emitter

## nSetCylinderEmitterRadius

syntax:

nSetCylinderEmitterRadius(emitter, radius)

where:

emitter as nEmitter, radius as Single

description:

set the radius of the cylinder emitter

## nSetCylinderEmitterLength

syntax:

nSetCylinderEmitterLength(emitter, length)

where:

emitter as nEmitter, length as Single

description:

set the length of the cylinder emitter

# 21.5.Mesh Emitter

## nCreateMeshEmitter

syntax:

nCreateMeshEmitter(particle, minv, maxv)

where:

particle as nParticle, minv, maxv as UInteger

description:

create a mesh emitter associated with particle, returns a pointer as nEmitter

## nSetMeshEmitterMesh

syntax:

nSetMeshEmitterMesh(emitter, mesh)

where:

emitter as nEmitter, mesh as nMesh

description:

bind the emitter with a mesh

## nSetMeshEmitterEveryVertex

syntax:

nSetMeshEmitterEveryVertex(emitter, EveryMeshVertex)

where:

emitter as nEmitter, EveryMeshVertex as Integer

description:

set on (1) or off (0) the flag EveryMeshVertex of the emitter

# 21.6.Ring Emitter

## nCreateRingEmitter

syntax:

nCreateRingEmitter(particle, minv, maxv)

where:

particle as nParticle, minv, maxv as UInteger

description:

create a ring emitter, returns a pointer as nEmitter

## nSetRingEmitterCenter

syntax:

nSetRingEmitterCenter(emitter, x,y,z)

where:

emitter as nEmitter, x,y,z as Single

description:

set the center of the ring emitter

## nSetRingEmitterRadius

syntax:

nSetRingEmitterRadius(emitter, radius)

where:

emitter as nEmitter, radius as Single

description:

set the radius of the ring emitter

## nSetRingEmitterThickness

syntax:

nSetRingEmitterThickness(emitter, thickness)

where:

emitter as nEmitter, thickness as Single

description:

set the thickness of the ring emitter

# 22.Physics

# 22.1.World

## nSetPhysicQuality

syntax:

nSetPhysicQuality(mode)

where:

mode as PHYSIC_QUALITY

PHYSIC_QUALITY:

Q_LINEAR = 0

Q_ADAPTATIVE = 1

Q_EXACT = 2

description:

set the physic quality

## nSetWorldGravity

syntax:

nSetWorldGravity(gx, gy, gz)

where:

gx,gy,gz as Single

description:

set the world gravity

## nSetWorldSize

syntax:

nSetWorldSize(sx,sy,sz)

where:

sx,sy,sz as Single

description:

set the world size

## nWorldMousePick

syntax:

nWorldMousePick(mousex,mousey,mouseLeftKey1)

where:

mousex,mousey,mouseLeftKey1 as Integer

description:

pick an entity with left click mouse at x,y mouse position

# 22.2.Body

## nCreateBodyNull

syntax:

nCreateBodyNull()

description:

returns a pointer as nBody

## nCreateBodyCube

syntax:

nCreateBodyCube(sx,sy,sz, mass)

where:

sx,sy,sz,mass as Single

description:

create a body cube with sx,sy,sz dimensions and a mass, returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodySphere

syntax:

nCreateBodySphere(sx,sy,sz,mass)

where:

sx,sy,sz,mass as Single

description:

create an elipsoid body with sx,sy,sz radius and a mass, returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodyCylinder

syntax:

nCreateBodyCylinder(radius, height, mass, offset)

where:

radius, height, mass as Single, offset as Integer

description:

create a sphere body, returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodyCone

syntax:

nCreateBodyCone(radius, height, mass, offset)

where:

radius, height, mass as Single, offset as Integer

description:

create a cone body , returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodyCapsule

syntax:

nCreateBodyCapsule(radius, height, mass, offset)

where:

radius, height, mass as Single, offset as Integer

description:

create a capsule body, returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodyHull

syntax:

nCreateBodyHull(mesh, mass)

where:

mesh as nMesh, mass as Single

description:

create o body around the mesh, returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodyTree

syntax:

nCreateBodyTree(mesh, mass)

where:

mesh as nMesh ( a complex mesh), mass as Single

description:

create a body tree for a complex mesh, returns a pointer as nBody

if mass = 0, then the body will be static

## nCreateBodyTreeBSP

syntax:

nCreateBodyTreeBSP(meshBSP, nodeMSP)

where:

meshBSP as UInteger Ptr, nodeBSP as UInteger Ptr

description:

create a body tree for a BSP level, returns a pointer as nBody

## nCreateBodyTerrain

syntax:

nCreateBodyTerrain(terrain, LOD)

where:

terrain as nTerrain, LOD as Integer

description:

create a body terrain, returns a pointer as nBody

## nCreateBodyWater

syntax:

nCreateBodyWater(sx,sy,sz, density, linviscozity, angviscozity)

where:

sx,sy,sz,density,linviscozity,angviscozity as Single

description:

create a body water, returns a pointer as nBody

## nSetAngularVelocity

syntax:

nSetAngularVelocity(body, vx, vy, vz)

where:

body as nBody, vx,vy,vz as Single

description:

set the angular velocity of the body

## nLinearVelocity

syntax:

nLinearVelocity(body, vx, vy, vz)

where:

body as nBody, vx,vy,vz as Single

description:

set the linear velocity of the body

## nSetLinearVelocity

syntax:

nSetLinearVelocity(body, xpos,ypos,zpos,xtarget,ytarget,ztarget,speed)

where:

body as nBody, xpos,ypos,zpos,xtarget,ytarget,ztarget,speed as Single

description:

set the linear velocity of the body toward a target

## nSetLinearDamping

syntax:

nSetLinearDamping(body, lindamping)

where:

body as nBody, lindamping as Single

description:

set the linear damping of the body

## nSetAngularDamping

syntax:

nSetAngularDamping(body, ax,ay,az)

where:

body as nBody, ax,ay,az as Single

description:

set the angular damping of the body

## nAddImpulse

syntax:

nAddImpulse(body, px,py,pz,x,y,z)

where:

px,py,pz as Single(impulse), x,y,z as Single (point of the body)

description:

add impulse at a specific point in the body

## nGetBodiesCollide

syntax:

nGetBodiesCollide(body1, body2)

where:

body1, body2 as nBody

description:

returns 1 if success

## nGetBodyCollX

syntax:

nGetBodyCollX(body1, body2)

where:

body1, body2 as nBody

description:

r eturn exact X-coordinate of the collision of the body with another body, as Single

## nGetBodyCollY

syntax:

nGetBodyCollY(body1, body2)

where:

body1, body2 as nBody

description:

r eturn exact Y-coordinate of the collision of the body with another body, as Single

## nGetBodyCollZ

syntax:

nGetBodyCollZ(body1, body2)

where:

body1, body2 as nBody

description:

r eturn exact Z-coordinate of the collision of the body with another body, as Single

## nGetBodyCollNX

syntax:

nGetBodyCollNX(body1, body2)

where:

body1, body2 as nBody

description:

r eturn exact X-angle of the collision of the body with another body, as Single

## nGetBodyCollNY

syntax:

nGetBodyCollNY(body1, body2)

where:

body1, body2 as nBody

description:

r eturn exact Y –angle of the collision of the body with another body, as Single

## nGetBodyCollNZ

syntax:

nGetBodyCollNZ(body1, body2)

where:

body1, body2 as nBody

description:

r eturn exact Z –angle of the collision of the body with another body, as Single

## nDrawBody

syntax:

nDrawBody(body)

where:

body as nBody

description:

make visible the edges of the body

## nSetBodyCenterOfMass

syntax:

nSetBodyCenterOfMass(body, x,y,z)

where:

body as nBody, x,y,z as Single

description:

set the center of mass of the body

## nRemoveBody

syntax:

nRemoveBody(body)

where:

body as nBody

description:

remove a body

## nSetBodyMass

syntax:

nSetBodyMass(body, mass)

where:

body as nBody, mass as Single

description:

set a new mass of the body

# 22.3.Joints

## nCreateJointBall

syntax:

nCreateJointBall(px,py,pz,vx,vy,vz,body1, body2)

where:

px,py,pz as Single (position), vx,vy,vz as Single (around x,y or z direction, only one of them must be 1, else 0)

body1, body2 as nBody

description:

create a jointball, returns a pointer as nJoint

## nCreateJointHinge

syntax:

nCreateJointHinge(px,py,pz,vx,vy,vz,body1,body2)

where:

px,py,pz as Single (position), vx,vy,vz as Single (around x,y or z direction, only one of them must be 1, else 0)

body1, body2 as nBody

description:

create a jointhinge, return a pointer as nJoint

## nCreateJointSlider

syntax:

nCreateJointSlider(px,py,pz,vx,vy,vz,body1,body2)

where:

px,py,pz as Single (position), vx,vy,vz as Single (around x,y or z direction, only one of them must be 1, else 0)

body1, body2 as nBody

description:

create a jointslider, return a pointer as nJoint

## nCreateJointUpVector

syntax:

nCreateJointUpVector(px,py,pz,body)

where:

px,py,pz as Single (position)

body as nBody

description:

create a jointupvector, return a pointer as nJoint

## nCreateJointCorkscrew

syntax:

nCreateJointCorkscrew(px,py,pz,vx,vy,vz,body1,body2)

where:

px,py,pz as Single (position), vx,vy,vz as Single (around x,y or z direction, only one of them must be 1, else 0)

body1, body2 as nBody

description:

create a jointcorkscrew, return a pointer as nJoint

## nCreateJointGear

syntax:

nCreateJointGear(gearRatio, childx, childy, childz, parentx, parenty, parentz, bodychild, bodyparent)

where:

gearRatio as Single

childx, childy, childz as Single – child rotation axe (only one of them must be 1, else 0)

parentx, parenty, parentz as Single – parent rotation axe (only one of them must be 1, else 0)

bodychild, bodyparent as nBody

description:

create a jointgear, return a pointer as nJoint

## nCreateJointWormGear

syntax:

nCreateJointWormGear(gearRatio, rotx, roty, rotz, lineardx, lineardy, lineardz, rotBody, linearBody)

where:

gearRatio as Single

rotx, roty, rotz as Single – rotation axe (only one of them must be 1, else 0)

lineardx,lineardy,lineardz as Single – linear direction (only one of them must be 1, else 0)

rotbody, linearbody as nBody

description:

create a jointwormgear, return a pointer as nJoint

## nRemoveJoint

syntax:

nRemoveJoint(joint)

where:

joint as nJoint

description:

remove a joint

## nSetJointCollisionState

syntax:

nSetJointCollisionState(joint, state)

where:

joint as nJoint

state as Integer

description:

set the collision state of the joint

## nSetBallLimits

syntax:

nSetBallLimits(jointball, maxconeangle, mintwistangle, maxtwistangle)

where:

jointball as nJoint

maxconeangle, mintwistangle, maxtwistangle as Single

description:

set the jointball limits

## nSetHingeLimits

syntax:

nSetHingeLimits(jointhinge, minangle, maxangle)

where:

jointhinge as nJoint

minangle, maxangle as Single

description:

set the jointhinge limits

## nSetSliderLimits

syntax:

nSetSliderLimits(jointslider, minDist, maxDist)

where:

jointslider as nJoint

minDist, maxDist as Single

description:

set the jointslider limits

## nSetCorkScrewLinearLimits

syntax:

nSetCorkScrewLinearLimits(joint, minDist, maxDist)

where:

joint as nJoint

minDist, maxDist as Single

description:

set the jointcorkscrew linear limits

## nSetCorkScrewAngularLimits

syntax:

nSetCorkScrewAngularLimits(joint, minangle, maxangle)

where:

joint as nJoint

minangle, maxangle as Single

description:

set the jointcorkscrew angular limits

# 22.4.Vehicle

## nCreateVehicle

syntax:

nCreateVehicle(dx,dy,dz, body)

where:

dx,dy,dz as Single – orientation (only one of them must be 1, else 0)

body as nBody

description:

create a vehicle, return a pointer as nJoint

## nGetVehicleSpeed

syntax:

nGetVehicleSpeed(vehicle)

where:

vehicle as nJoint

description:

return the vehicle speed as Single

## nAddTireVehicle

syntax:

nAddTireVehicle(vehicle, meshtire, x, y, z, mass, radius, width, friction, slenght, sspring, sdamper)

where:

vehicle as nJoint, meshtire as nMesh,

x,y,z as Single – position

mass, radius, width, friction, slenghtm sspring, sdamper as Single

description:

add tires to the vehicle

## nApplyBrakeVehicle

syntax:

nApplyBrakeVehicle(vehicle, wheel_index, brake_power)

where:

vehicle as nJoint

wheel_index as Integer (0 ,1 – front, 2,3 – back)

description:

apply brake to the vehicle

## nApplySteeringVehicle

syntax:

nApplySteeringVehicle(vehicle, wheel_index, rate)

where:

vehicle as nJoint

wheel_index as Integer

rate as Single

description:

apply steering

## nApplySteeringJoystickVehicle

syntax:

nApplySteeringJoystickVehicle(vehicle, wheel_index, rate, maxsteerangle)

where:

vehicle as nJoint

wheel_index as Integer

rate as Single

maxsteerangle as Single (at 1 value result a maxsterangle = 30)

description:

apply a variable steering

## nApplyTorqueVehicle

syntax:

nApplyTorqueVehicle(vehicle, wheel_index, torque)

where:

vehicle as nJoint

wheel_index as Integer

torque as Single

description:

apply torque

# 23.Shaders

## nLoadShader

syntax:

nLoadShader(VertexFileName, PixelFileName, selector)

where:

VertexFileName as ZString Ptr, PixelFileName as ZString Ptr, selector as Integer

selector:

GLSL1.1 = 0

HLSL 2.0 = 1

description:

create a shader manager, returns a pointer as nShader

## nApplyShadersEntity

syntax:

nApplyShadersEntity(shader, entity)

where:

shader as nShader, entity as nEntity

description:

apply shader to entity

## nApplyShadersMaterial

syntax:

nApplyShadersMaterial(shader, entity, mat_num)

where:

shader as nShader, entity as nEntity, mat_num as UInteger

description:

apply shader to one material of the entity

## nSetVertexShaderConstant

syntax:

nSetVertexShaderConstant(shader, namevar, cdata, count)

where:

shader as nShader, namevar as ZString Ptr, cdata as Single, count as Integer

description:

set the vertex shader constant

## nSetPixelShaderConstant

syntax:

nSetPixelShaderConstant(shader, namevar, cdata, count)

where:

shader as nShader, namevar as ZString Ptr, cdata as Single, count as Integer

description:

set the pixel shader constant

## nSetMatrixToVertexShaderConstant

syntax:

nSetMatrixToVertexShaderConstant(shader, matrixtype)

where:

shader as nShader, matrixtype as Integer

matrixtype in HLSL shaders:

0 = „matWorldViewProjection”

1 = „matWorldView”

2 = „matProj”

3 = „matView”

4 = „matWorld”

5 = „matInvWorld”

description:

passes matrix to vertex shader constant in HLSL

# 24.Sky

## nCreateSkyDome

syntax:

nCreateSkyDome(texture, radius)

where:

texture as nTexture, radius as Single

description:

create a sky dome, returns a pointer as nEntity

## nCreateSkyBox

syntax:

nCreateSkyBox(top, bottom, left, right, front, back)

where:

top, bottom, left, right, front, back as nTexture

description:

create a sky box from 6 textures, returns a pointer as nEntity

# 25.Sound

## nLoadSound

syntax:

nLoadSound(file)

where:

file as ZString Ptr

description:

load a sound from file, returns a pointer as nSound

## nSetSoundType

syntax:

nSetSoundType(sound, sound_type)

where:

sound as nSound, sound_type as Integer

sound_type:

2D sound = 1

3D sound = 2

description:

set the sound type

## nSetSoundVolume

syntax:

nSetSoundVolume(sound, volume)

where:

sound as nSound, volume as Single

description:

set the sound volume

## nSetSoundPitch

syntax:

nSetSoundPitch(sound, pitch)

where:

sound as nSound, pitch as Single

description:

set the sound pitch

## nPlaySound

syntax:

nPlaySound(sound)

where:

sound as nSound

description:

play the sound

## nStopSound

syntax:

nStopSound(sound)

where:

sound as nSound

description:

stop the sound

## nPauseSound

syntax:

nPauseSound(sound)

where:

sound as nSound

description:

pause the sound

## nLoopSound

syntax:

nLoopSound(sound)

where:

sound as nSound

description:

loop the sound

## nSetSoundPosition

syntax:

nSetSoundPosition(sound, x, y, z)

where:

sound as nSound; x, y, z as Single;

description:

set the sound 3D position;

## nSetSoundReferenceDistance

syntax:

nSetSoundReferenceDistance(sound, distance)

where:

sound as nSound, distance as Single

description:

determines the distance at wich the sound affects the listener

## nSetSoundRollOff

syntax:

nSetSoundRollOff(sound, value)

where:

sound as nSound, value as Single

description:

determines the rate of progression in wich the sound affects the listener

## nSetListenerPosition

syntax:

nSetListenerPosition(x,y,z)

where:

x,y,z as Single;

description:

set the listener position in 3D sound enviroment;

# 26.System

## nSetAppTitle

syntax:

nSetAppTitle(title)

where:

title as ZString Ptr

description:

set the application title in the title bar of the window

## nGetSupportGLSL

syntax:

nGetSupportGLSL()

description:

return 1 if support GLSL, as Integer

## nGetSupportHLSL

syntax:

nGetSupportHLSL()

description:

return 1 if support HLSL, as Integer

## nGetSupportHardwareTL

syntax:

nGetSupportHardwareTL()

description:

return 1 if support hardwareTL, as Integer

## nGetAvailableMemory

syntax:

nGetAvailableMemory()

description:

return available memory as UInteger

## nGetTotalMemory

syntax:

nGetTotalMemory()

description:

return total memory as UInteger

## nGetVideoModeCount

syntax:

nGetVideoModeCount()

escription:

return the videomode count as Integer

## nGetVideoModeDepth

syntax:

nGetVideoModeDepth()

description:

return the videomode depth as Integer

## nGetVideoModeResolutionWidth

syntax:

nGetVideoModeResolutionWidth()

description:

return videomoderesolution width, as Integer

## nGetVideoModeResolutionHeight

syntax:

nGetVideoModeResolutionHeight()

description:

return videomoderesolution height, as Integer

## nGetSupportStencilBuffer

syntax:

nGetSupportStencilBuffer()

description:

return 1 if support stencilbuffer, as Integer

## nGetSupportMultiTexture

syntax:

nGetSupportMultiTexture()

description:

return 1 if support multitexture, as Integer

## nGetSupportARB

syntax:

nGetSupportARB()

description:

return 1 if support ARB, as Integer

## nGetProcessorSpeed

syntax:

nGetProcessorSpeed()

description:

return the processor speed as UInteger

# 27.Terrain

## nLoadTerrain

syntax:

nLoadTerrain(heightmap_file, smooth, LOD, patchSize)

where:

hieghtmap as ZString Ptr, smooth as Integer, LOD as Integer, patchSize as IRR_TERRAIN_PATCH_SIZE

IRR_TERRAIN_PATCH_SIZE:

ETPS_9 = 9 patch size of 9, at most, use 4 levels of detail with this patch size.

ETPS_17 = 17 patch size of 17, at most, use 5 levels of detail with this patch size.

ETPS_33 = 33 patch size of 33, at most, use 6 levels of detail with this patch size.

ETPS_65 = 65 patch size of 65, at most, use 7 levels of detail with this patch size.

ETPS_129 = 129 patch size of 129, at most, use 8 levels of detail with this patch size.

description:

create a terrain loaded from an heightamp_file image

returns a pointer as nTerrain

## nSetScaleTerrainTexture

syntax:

nSetScaleTerrainTexture(terrain, sct, sdt)

where:

terrain as nTerrain, sct, sdt as Single

description:

scale color texture, scale detail texture of the terrain

## nGetTerrainHeight

syntax:

nGetTerrainHeight(terrain, x, z)

where:

terrain as nTerrain, x,z as Single

description:

get the height value (y) of terrain at x,z coordinates, returns y as Single

# 28.Texture

## nLoadTexture

syntax:

nLoadTexture(filename)

where:

filename as ZString Ptr

description:

load a texture in videomemory, returns a pointer as nTexture

## nCreateRTT

syntax:

nCreateRTT(w,h)

where:

w,h as Integer

description:

create a render target texture, returns a pointer as nTexture

## nSetRenderTarget

syntax:

nSetRenderTarget(texture)

where:

texture as nTexture

description:

set the active render target

## nSetColorKeyTexture

syntax:

nSetColorKeyTexture(texture, R, G, B)

where:

texture as nTexture, R,G,B as UInteger

description:

set a color key for a texture, this color will be transparent

## nFindTexture

syntax:

nFindTexture(file)

where:

file as ZString Ptr

description:

find a texture by its file name, returns a pointer as nTexture

## nGetTextureWidth

syntax:

nGetTextureWidth(texture)

where:

texture as nTexture

description:

returns the width of the texture, as Integer

## nGetTextureHeight

syntax:

nGetTextureHeight(texture)

where:

texture as nTexture

description:

returns the height of the texture, as Integer

## nLockTexture

syntax:

nLockTexture(texture)

where:

texture as nTexture

description:

locks the texture and returns a pointer to the 1st pixel of the texture

## nUnLockTexture

syntax:

nUnLockTexture(texture)

where:

texture as nTexture

description:

unlocks the texture

## nUnLockTextureNoMipMap

syntax:

nUnLockTextureNoMipMap(texture)

where:

texture as nTexture

description:

unlocks the texture but without regenerating the mipmap of texture

## nCreateTexture

syntax:

nCreateTexture(path, w, h, color_format)

where:

path as ZString Ptr, w,h as Integer, color_format as IRR_COLOR_FORMAT

A color format specifies how color information is stored:

ECF_A1R5G5B5 = 0 16 bit color format used by the software driver, and thus preferred by all other irrlicht engine video drivers. There are 5 bits for every color component, and a single bit is left for alpha information.

ECF_R5G6B5 = 1 Standard 16 bit color format.

ECF_R8G8B8 = 2 24 bit color, no alpha channel, but 8 bit for red, green and blue.

ECF_A8R8G8B8 = 3 Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.

description:

create a blank texture, returns a pointer as nTexture

## nRemoveTexture

syntax:

nRemoveTexture(texture)

where:

texture as nTexture

description:

remove a texture freeing its resources

## nMakeNormalMapTexture

syntax:

nMakeNormalMapTexture(texture, amplitude)

where:

texture as nTexture, amplitude as Single

description:

create a normal map from a grayscale heightmap texture

## nBlendTextures

syntax:

nBlendTextures(dest_texture, source_texture, x_offset, y_offset, operation)

where:

dest_texture, source_texture as nTexture, x_offset, y_offset, operation as Integer

operation:

BLEND_SCREEN = 0

BLEND_ADD = 1

BLEND_SUBTRACT = 2

BLEND_MULTIPLY = 3

BLEND_DIVIDE = 4

description:

blend the source texture into the destination texture to create a single texture, returns 1 if success

## nAlphaBlendTextures

syntax:

nAlphaBlendTextures(dest_texture, source_texture, alpha_texture, alpha_color_channel)

where:

dest_texture, source_texture, alpha_texture as nTexture

alpha_color_channel as ALPHA_CHANNEL_COLOR

ALPHA_CHANNEL_COLOR:

ALPHA_RED = 1

ALPHA_GREEN = 2

ALPHA_BLUE = 3

ALPHA_ALPHA = 4

description:

blend the source texture into the destination texture using a third alphamap with rgb channels to create a single texture

returns 1 if success

## nCreateTextureFromImage

syntax:

nCreateTextureFromImage(image)

where:

image as nImage

description:

create a texture in videomemory from a RAMimage, returns a pointer as nTexture

## nCreateImageFromTexture

syntax:

nCreateImageFromTexture(texture, originX, originY, w, h)

where:

texture as nTexture, origineX, origineY, w, h as Integer

description:

create image from texture or part of texture, returns a pointer as nImage

## nPaintTileTextureWithAlpha

syntax:

nPaintTileTextureWithAlpha(dest_texture, source_texture, xpos, ypos, radius, alphalevel)

where:

dest_texture, source_texture as nTexture, xpos,ypos, radius, alphalevel as Integer

description:

paint the destination(base) texture with a source texture using an alpha value at x,y position,

returns 1 if success

## nPaintTileTextureWithAlpha2

syntax:

nPaintTileTextureWithAlpha2(dest_texture, source_texture, xpos, ypos, radius, alphalevel)

where:

dest_texture, source_texture as nTexture, xpos,ypos, radius, alphalevel as Integer

description:

paint the destination(base) texture with a source texture using an alpha value at x,y position,

returns 1 if success

## nPaintTileTextureWithAlpha3

syntax:

nPaintTileTextureWithAlpha3(dest_texture, source_texture, pixeldeststart, pixelsrcstart, xpos, ypos, radius, alphalevel)

where:

dest_texture, source_texture as nTexture, pixeldeststart, pixelsrcstart as UInteger Ptr,

xpos,ypos,radius, alphalevel as Integer

description:

(optimized algorithm)

paint the destination(base) texture with a source texture using an alpha value at x,y position,

pixeldeststart and pixelsrcstart found before calling lock texture

returns 1 if success

# 29.Timer

## nCreateTimer

syntax:

nCreateTimer()

description:

create a timer, return a pointer as nTimer

## nTimerStart

syntax:

nTimerStart(timer)

where:

timer as nTimer

description:

start the timer

## nTimerStop

syntax:

nTimerStop(timer)

where:

timer as nTimer

description:

stop the timer (then must call timerstart to use this timer again)

## nSetTimerSpeed

syntax:

nSetTimerSpeed(timer, speed)

where:

timer as nTimer, speed as Single

description:

set the timer speed

## nGetTimerSpeed

syntax:

nGetTimerSpeed(timer)

where:

timer as nTimer

description:

return the timer speed as Single

## nSetCurrentTime

syntax:

nSetCurrentTime(timer, timevalue)

where:

timer as nTimer, timevalue as UInteger

description:

set the current timer time

## nGetCurrentTimeInMs

syntax:

nGetCurrentTimeInMs(timer)

where:

timer as nTimer

description:

return the current time in ms, as UInteger

## nGetCurrentTimeInSeconds

syntax:

nGetCurrentTimeInSeconds(timer)

where:

timer as nTimer

description:

return the current time in seconds, as Single

## nGetRealTimeInMs

syntax:

nGetRealTimeInMs(timer)

where:

timer as nTimer

description:

get the real time in ms, as UInteger

## nGetTimerIsStopped

syntax:

nGetTimerIsStopped(timer)

where:

timer as nTimer

description:

return 1 if timer is stopped, as Integer

## nTimerTick

syntax:

nTimerTick(timer)

where:

timer as nTimer

description:

update the timer in the main loop

# 30. ForceFeedback Joystick

## initforce

syntax:

initforce()

description:

init the direct input device (you must have Directx9.0c installed on Your computer)

## setjoy

syntax:

setjoy(id_joy)

where:

id_joy as UInteger (0 if you have only one joystick)

description:

set the active joystick

## runeff

syntax:

runeff(file_eff)

where:

file_eff as string (the file name with effect)

description:

run an effect directly from a file

## loadeff

syntax:

loadeff(file_eff)

where:

file_eff as string (the file name with effect)

description:

load an effect in memory, ready to be used

## runloadedeff

syntax:

runloadedeff()

description:

run the before loaded effect

## stopforce

syntax:

stopforce()

description:

stop an effect

## releaseforce

syntax:

releaseforce()

description:

close and release the device, freeing the memory

# 31. GUI

# 31.1. Button

## nCreateGUIButton

syntax:

nCreateGUIButton(x,y,w,h,text,parent)

where:

x,y – the coordinates of the screen in pixels as Integer; w,h – width, height of the button as Integer; text – the string text , as zString Ptr; parent – the parent of the burron, as UInteger Ptr;

description:

create a GUI button, returns a pointer as UInteger Ptr;

## nCreateGUIButtonToolTip

syntax:

nCreateGUIButtonToolTip(x,y,w,h,text,tooltiptext,parent)

where:

x,y – the coordinates of the screen in pixels as Integer; w,h – width, height of the button as Integer; text – the string text, as zString Ptr;tooltiptext – the tooltip string text,as zString Ptr; parent – the parent of the button, as UInteger Ptr;

description:

create a GUI button with tooltip text, returns a pointer as UInteger Ptr;

## nSetIsPushButton

syntax:

nSetIsPushButton(button, ispush)

where:

button – as UInteger Ptr; ispush – 0 or 1;

description:

sets if the button is push button;

## nSetPressed

syntax:

nSetPressed(button,press)

where:

button as UInteger Ptr; press – 0 or 1;

description:

set the button pressed;

## nSetButtonImageNormal

syntax:

nSetButtonImageNormal(button, texture, x,y,w,h)

where:

button as UInteger Ptr, texture as UInteger Ptr, x,y,w,h as Integer;

description:

set the texture as image for button in normal position;

## nSetButtonImagePressed

syntax:

nSetButtonImagePressed(button, texture, x,y,w,h)

where:

button as UInteger Ptr, texture as UInteger Ptr, x,y,w,h as Integer;

description:

set the texture as image for button in pressed position;

## nSetScaleImage

syntax:

nSetScaleImage(button, scaleflag)

where:

button as UInteger Ptr; scaleflag as Integer;

description:

set if button image is scaled (0 – no, 1 – yes)

## nGetButtonIsPressed

syntax:

nGetButtonIsPressed(button)

where:

button as UInteger Ptr; function returns a value as Integer;

description:

returns 1 if the button is pressed;

## nButtonDrawBorder

syntax:

nButtonDrawBorder(button, borderflag)

where:

button as UInteger Ptr; borderflag as Integer;

description:

sets if the button has border (0 - no, 1 – yes);

## nDeleteButton

syntax:

nDeleteButton(button)

where:

button as UInteger Ptr;

description:

delete the button;

# 31.2. ScrollBar

## nCreateGUIScrollBar

syntax:

nCreateGUIScrollBar(x,y,w,h,HorVertFlag,parent)

where:

x,y,w,h – as Integer, HorVertFlag as Integer; parent as UInteger Ptr;

description:

create a scrollbar ( horizontal if HorVertFlag =0, vertical if HorVertFlag =1)

returns a pointer as UInteger Ptr;

## nSetScrollBarPosition

syntax:

nSetScrollBarPosition(scrollbar, position)

where:

scrollbar as UInteger Ptr; position as Integer;

description:

set the position of the scrollbar;

## nSetScrollBarSmallStep

syntax:

nSetScrollBarSmallStep(scrollbar, step)

where:

scrollbar as UInteger Ptr; step as Integer;

description:

set the scrollbar as smallstep scrollbar and the step;

## nSetScrollBarLargeStep

syntax:

nSetScrollBarLargeStep(scrollbar, step)

where:

scrollbar as UInteger Ptr; step as Integer;

description:

set the scrollbar as largestep scrollbar and the step;

## nSetMaxScrollBar

syntax:

nSetMaxScrollBar(scrollbar, maxsbvalue)

where:

scrollbar as UInteger Ptr; maxsbvalue as Integer;

description:

set the max value of the scrollbar;

## nSetMinScrollBar

syntax:

nSetMinScrollBar(scrollbar, minsbvalue)

where:

scrollbar as UInteger Ptr; minsbvalue as Integer;

description:

set the min value of the scrollbar;

## nGetScrollBarXY

syntax:

nGetScrollBarXY(scrollbar)

where:

scrollbar as UInteger Ptr;

description:

returns the curent position of the scrollbar, as Integer;

## nDeleteScrollBar

syntax:

nDeleteScrollBar(scrollbar)

where:

scrollbar as UInteger Ptr;

description:

delete the scrollbar;

# 31.3. Window

## nCreateGUIWindow

syntax:

nCreateGUIWindow(x,y,w,h,text,modal,parent)

where:

x,y,w,h as Integer; text as zString Ptr; modal as Integer; parent as UInteger Ptr;

description:

create a window for GUI at x,y of the screen, with w width and h height, with text as caption, modal (0 – no, 1 – yes), having parent (0 – no parent)

returns a pointer as UInteger Ptr;

## nDeleteWindow

syntax:

nDeleteWindow(window)

where:

window as UInteger Ptr;

description:

delete the window;

# 31.4. FileOpenDialog

## nCreateFileOpenDialog

syntax:

nCreateFileOpenDialog(text, modal, parent)

where:

text as zString Ptr; modal as Integer; parent as UInteger Ptr;

description:

create a fileopendialg, returns a pointer as UInteger Ptr; (modal = 0 or 1)

## nGetFileNameFromDialog

syntax:

nGetFileNameFromDialog(fileopendialog)

where:

fileopendialog as UInteger Ptr;

description:

returns the file name as zString Ptr;

## nGetDirectoryNameFromDialog

syntax:

nGetDirectoryNameFromDialog(fileopendialog)

where:

fileopendialog as UInteger Ptr;

description:

returns the directory name as wString Ptr;

# 31.5. MessageBox

## nCreateGUIMessageBox

syntax:

nCreateGUIMessageBox(caption, flags, text, parent)

where:

caption as zString Ptr; flags as Integer; text as zString Ptr; parent as UInteger Ptr)

description:

create a message box; returns a pointer as UInteger Ptr;

# 31.6. CheckBox

## nCreateGUICheckBox

syntax:

nCreateGUICheckBox(x,y,w,h,text,parent)

where:

x,y,w,h as Integer; text as zString Ptr; parent as UInteger Ptr;

description:

create a check box, returns a pointer as UInteger Ptr;

## nSetCheckBoxEnable

syntax:

nSetCheckBoxEnable(checkbox, enableflag)

where:

checkbox as UInteger Ptr; enableflag as Integer (0 or 1);

description:

enables or disables a check box;

## nSetCheckBoxChecked

syntax:

nSetCheckBoxChecked(checkbox, checkedflag)

where:

checkbox as UInteger Ptr; checkedflag as Integer (0 or 1);

description:

check or uncheck a check box ;

## nGetCheckBoxIsChecked

syntax:

nGetCheckBoxIsChecked(checkbox)

where:

checkbox as UInteger Ptr; returns a value as Integer;

description:

returns 1 if the checkbox is checked, else returns 0;

# 31.7. EditBox

## nCreateEditBox

syntax:

nCreateEditBox(x,y,w,h,text,borderflag,parent)

where:

x,y,w,h as Integer; text as zString Ptr; borderflag as Integer (0 or 1); parent as UInteger Ptr;

description:

create an edit box, returns a pointer as UInteger Ptr;

## nSetTextEditBox

syntax:

nSetTextEditBox(edittext,text)

where:

edittext as UInteger Ptr; text as zString Ptr;

description:

set the text in the edit box;

## nGetTextEditBox

syntax:

nGetTextEditBox(edittext)

where:

edittext as UInteger Ptr;

description:

returns teh text in the edittext, as wString Ptr;

## nSetEditBoxTextAlignment

syntax:

nSetEditBoxTextAlignment(edittext,horflag,vertflag)

where:

edittext as UInteger Ptr; horflag, vertflag as Integer;

description:

set the alignment of the text in the edit text:

horflag = 0 left, horflag = 1 center, horflag = 2 right,

vertflag = 0 up, vertflag = 1 center, vertflag = 2 down

# 31.8. StaticText

## nAddStaticText

syntax:

nAddStaticText(text,x,y,w,h,borderflag, wrapflag,backgrd,parent)

where:

x,y,w,h as Integer; borderflag as Integer (0 or 1); wrapflag as Integer (0 or 1); backgrd as Integer (0 or 1); parent as UInteger Ptr;

description:

add a static text on the screen; returns a pointer as UInteger Ptr;

## nSetStaticTextAlignment

syntax:

nSetStaticTextAlignment(statictext,horflag,vertflag)

where:

statuctext as UInteger Ptr; horflag, vertflag as Integer;

description:

set the alignment:

horflag = 0 left, horflag = 1 center, horflag = 2 right,

vertflag = 0 up, vertflag = 1 center, vertflag = 2 down

# 31.9. Menu

## nAddMenu

syntax:

nAddMenu(parent)

where:

parent as UInteger Ptr;

description:

create a menu conteiner, returns a pointer as UInteger Ptr;

## nAddItemToMenu

syntax:

nAddItemToMenu(menu,text,commandId,hassubmenu)

where:

menu as UInteger Ptr; text as wString Ptr; commandId as Integer; hassubmenu as Integer (0 or 1)

description:

add an item to menu; returns an index as Integer;

## nAddSeparatorToMenu

syntax:

nAddSeparatorToMenu(menu)

where:

menu as UInteger Ptr;

description:

add a separator to menu

## nGetSelectedItem

syntax:

nGetSelectedItem(menu)

where:

menu as UInteger Ptr;

description:

returns the index of the selected item;

## nGetItemCommandId

syntax:

nGetItemCommandId(menu,idxItem)

where:

menu as UInteger Ptr; idxItem as Integer;

description:

returns the commandId for the item having index idxItem, as Integer;

## nGetSubMenu

syntax:

nGetSubMenu(menu,idxItem)

where:

menu as UInteger Ptr; idxItem as Integer;

description:

returns a pointer as UInteger Ptr to the submenu , having idxItem index;

## nAddContextMenu

syntax:

nAddContextMenu(parent,x,y,w,h)

where:

parent as UInteger Ptr; x,y,w,h as Integer;

description:

add a context menu, returns a pointer as UInteger Ptr;

## nSetVisibleContextMenu

syntax:

nSetVisibleContextMenu(contextmenu,visibleflag)

where:

contextmenu as UInteger Ptr; visibleflag as Integer( 0 or 1);

description:

set the visibility of the context menu ;

## nSetCloseHandlingContextMenu

syntax:

nSetCloseHandlingContextMenu(contextmenu,closebehavior)

where:

contextmenu as UInteger Ptr; closebehavior as Integer ( 0, 1 or 2)

description:

set the behavior of the context menu when closes;

# 31.10. ToolBar

## nAddToolBar

syntax:

nAddToolBar(parent)

where:

parent as UInteger Ptr;

description:

create a tool bar, returns a pointer as UInteger Ptr;

## nAddButtonToToolBar

syntax:

nAddButtonToToolBar(toolbar, text, tooltiptext, normalimage, pressedimage,isPushflag, useAlphaflag)

where:

toolbar as UInteger Ptr; text as wString Ptr; tooltiptext as wString Ptr; image as nTexture; pressedimage as nTexture; isPush as Integer (0 or 1); useAlpha as Integer (0 or 1);

description:

add a button to tool bar, returns a pointer as UInteger Ptr;

# 31.11. TabControl

## nAddTabControl

syntax:

nAddTabControl(x,y,w,h,parent,fillingbg,border)

where:

x,y,w,h as Integer; parent as UInteger Ptr; fillingbg as Integer (0 or 1); border as Integer (0 or 1);

description:

add a tab control, returns a pointer as UInteger Ptr;

## nAddTabInTabControl

syntax:

nAddTabInTabControl(tabcontrol, caption)

where:

tabcontrol as UInteger Ptr; caption as wString Ptr;

description:

add a tab to tab control; returns a pointer as UInteger Ptr;

## nGetNrTabsInTabControl

syntax:

nGetNrTabsInTabControl(tabcontrol)

where:

tabcontrol as UInteger Ptr;

description:

returns how many tabs in tab control are, as Integer;

## nGetActiveTabInTabControl

syntax:

nGetActiveTabInTabControl(tabcontrol)

where:

tabcontrol as UInteger Ptr;

description:

returns the index of the active tab in tab control, as Integer;

## nSetActiveTabByIndexInTabControl

syntax:

nSetActiveTabByIndexInTabControl(tabcontrol, index)

where:

tabcontrol as UInteger Ptr; index as Integer;

description:

set active tab by index;

## nSetActiveTabByNameInTabControl

syntax:

nSetActiveTabByNameInTabControl(tabcontrol, tabname)

where:

tabcontrol as UInteger Ptr; tabname as UInteger Ptr)

description:

set active tab by name ( its pointer)

## nGetPointToTabInTabControl

syntax:

nGetPointToTabInTabControl(tabcontrol, index)

where:

tabcontrol as UInteger Ptr; index as Integer;

description:

returns the pointer to the tab by its index; (as UInteger Ptr)

## nSetTabHeight

syntax:

nSetTabHeight(tabcontrol, height)

where:

tabcontrol as UInteger Ptr; height as Integer;

description:

set the height of the tabcontrol;

# 31.12. Image GUI

## nAddImageGUI

syntax:

nAddImageGUI(x,y,w,h,text,parent)

where:

x,y,w,h as Integer; text as wString Ptr;parent as UInteger Ptr;

description:

create a blank image to GUI, returns a pointer as UInteger Ptr;

## nSetImageGUI

syntax:

nSetImageGUI(imageGUI, texture)

where:

imageGui as UInteger Ptr; texture as UInteger Ptr;

description:

set a texture to the imageGUI;

## nSetColorImageGUI

syntax:

nSetColorImageGUI(imageGUI, r,g,b,a)

where:

imageGUI as UInteger Ptr; r,g,b,a as Integer;

description:

set the color of the imageGUI;

## nSetScaleImageGUI

syntax:

nSetScaleImageGUI(imageGUI, flagscale)

where:

imageGUI as UInteger Ptr; flagscale as Integer (0 or 1)

description:

set the flag of the scaling image when is texturing;

## nSetUseAlphaChannelImageGUI

syntax:

nSetUseAlphaChannelImageGUI(imageGUI, flagalpha)

where:

imageGUI as UInteger Ptr; flagalpha as Integer (0 or 1);

description:

set the flag if will be used the alpha channel of the texture;

# 31.13. ComboBox

## nAddComboBox

syntax:

nAddComboBox(x,y,w,h,parent)

where:

x,y,w,h as Integer; parent as UInteger Ptr;

description:

add a combo box, return a pointer as UInteger Ptr;

## nAddItemComboBox

syntax:

nAddItemComboBox(comboBox, text)

where:

comboBox as UInteger Ptr; text as wString Ptr;

description:

add an item to combo box, returns an index as Integer;

## nGetItemCountComboBox

syntax:

nGetItemCountComboBox(comboBox)

where:

combobox as UInteger Ptr;

description:

return the total items count of the combo box, as Integer;

## nGetStringItemComboBox

syntax:

nGetStringItemComboBox(comboBox, indexitem)

where:

comboBox as UInteger Ptr; indexItem as Integer;

description:

return the string of the item , as wString Ptr;

## nGetSelectedItemComboBox

syntax:

nGetSelectedItemComboBox(comboBox)

where:

comboBox as UInteger Ptr;

description:

return the index of the selected item, as Integer;

## nSetSelectedItemComboBox

syntax:

nSetSelectedItemComboBox(comboBox, indexitem)

where:

comboBox as UInteger Ptr; indexItem as Integer;

description:

set an item as selected by its index;

## nRemoveComboBox

syntax:

nRemoveComboBox(comboBox)

where:

comboBox as UInteger Ptr;

description:

remove a combo box;

# 31.14. Global GUI

## nSetTransparencyGUI

syntax:

nSetTransparencyGUI(alphavalue)

where:

alphavalue as Integer;

description:

set the transparency of the GUI;

## nSetVisibleGUIElement

syntax:

nSetVisibleGUIElement(element,visibleflag)

where:

element as UInteger Ptr; visibleflag as Integer (0 or 1)

description:

set the visibility of an element;

## nDrawGUI

syntax:

nDrawGUI ( )

description:

if is calling in the main loop, draws the GUI (it is not necesary this command, the engine has this command inside of the render step in the main loop)

# 32. Terrain Editor Commands

(used only with terrain editors)

## nWriteImageToFile

syntax:

nWriteImageToFile(image, extension)

where:

image as nImage, extension as Integer (0 – bmp, 1 – jpg)

description:

writes an image to a bmp or jpg file; is used in terrain editors to save the colormap and the heightmap;

## nWriteImageSplatToFile

syntax:

nWriteImageSplatToFile(image, nrsplat)

where:

image as nImage; nrsplat as Integer(1,2,3,4 for splat maps and 5 for lightmap);

description:

used in terrain splatting editor to save the splat map and the lightmap;

## nPaintSplatOGL

syntax:

nPaintSplatOGL(curentsplat, othersplata, othersplatb, othersplatc, stage, channelcolor, xpos, ypos, radius, alpha);

where:

curentsplat, othersplata, othersplatb, othersplatc as nTexture;

stage as Integer (1,2,3,4);

channelcolor as integer(1 – red, 2 – green, 3 – blue);

xpos, ypos as Integer – the tool center to paint;

radius as Integer – the tool radius;

alpha as Integer (0 to 255);

description:

paint the terrain in real time using texture splatting;

## nPaintLightMap

syntax:

nPaintLightMap(hm_terrain, lm_texture, sundistance, sunheight)

where:

hm_terrain as UInteger Ptr; lm_texture as nTexture; sundistance, sunheight as Integer;

description:

paint and save the lightmap;

## nInterpolateLightMap

syntax:

nInterpolateLightMap(lm_texture)

where:

lm_texture as nTexture;

description:

increase the quality of the lightmap;

## nClearLightMap

syntax:

nClearLightMap(lm_texture)

where:

lm_texture as nTexture;

description:

clear the lightmap;

## nCreateSplatManagerOGL

syntax:

nCreateSplatManagerOGL()

description:

create a splat manager in openGL; it is using GLSL shader;

return a pointer as UInteger Ptr;

## nBindSplatManagerOGLwithTerrain2

syntax:

nBindSplatManagerOGLwithTerrain2(splatmanagerOGL, terrain, splat1, splat2, splat3, splat4, splat_lm,

tile1_red, tile1_green, tile1_blue, tile2_red, tile2_green, tile2_blue, tile3_red, tile3_green, tile3_blue,

tile4_red, tile4_green, tile4_blue, tile_lm, nrpass, lum, anim)

where:

splatmanagerOGL as UInteger Ptr;

terrain as nTerrain;

splat1, splat2, splat3, splat4, splat_lm as nTexture;

tile1_red, tile1_green, tile1_blue, tile2_red, tile2_green, tile2_blue, tile3_red, tile3_green, tile3_blue,

tile4_red, tile4_green, tile4_blue, tile_lm as nTexture;

nrpass as Integer, how many stages;

lum as Integer, if is used lightmap (0 or 1);

anim as Integer (0 or 1 for animated texture, for now, use only 0)

description:

bind the splat manager in OpenGL with the terrain;

## nDrawSplatOGL

syntax:

nDrawSplatOGL(splatmanagerOGL)

where:

splatmanageOGL as UInteger Ptr;

description:

draw in the main loop making visible terrain texture splatting;

## nCreateSplatManagerDX9

syntax:

nCreateSplatManagerDX9()

description:

create a splat manager for DirectX 9.0c, with HLSL shader;

## nBindSplatManagerDX9withTerrain2

syntax:

nBindSplatManagerDX9withTerrain2(splatmanagerDX9, terrain, splat1, splat2, splat3, splat4, splat_lm, tile1_red, tile1_green, tile1_blue, tile2_red, tile2_green, tile2_blue, tile3_red, tile3_green, tile3_blue,

tile4_red, tile4_green, tile4_blue, tile_lm, nrpass, lum, anim)

where:

splatmanagerDX9 as UInteger Ptr;

terrain as nTerrain;

splat1, splat2, splat3, splat4, splat_lm as nTexture;

tile1_red, tile1_green, tile1_blue, tile2_red, tile2_green, tile2_blue, tile3_red, tile3_green, tile3_blue,

tile4_red, tile4_green, tile4_blue, tile_lm as nTexture;

nrpass as Integer, how many stages;

lum as Integer, if is used lightmap (0 or 1);

anim as Integer (0 or 1 for animated texture, for now, use only 0)

description:

bind the splat manager in DirectX9.0c with the terrain;

## nDrawSplatDX9

syntax:

nDrawSplatDX9(splatmanagerDX9)

where:

splatmanagerDX9 as UInteger Ptr;

description:

draw in the main loop making visible terrain texture splatting;

## nGetTerrainSelector

syntax:

nGetTerrainSelector(terrain)

where:

terrain as UInteger Ptr;

description:

return a pointer as UInteger Ptr to the triangle selector for terrain;

## nCreateArrow

syntax:

nCreateArrow()

description:

create a visible arrow for the terrain editor, return a pointer as UInteger Ptr;

## nGetXPoSArrow

syntax:

nGetXPoSArrow(terrain, arrow, selector, camera, scaleX, scaleZ, terrSize)

where:

terrain as nTerrain;

arrow as UInteger Ptr;

selector as UInteger Ptr;

camera as nCamera;

scaleX, scaleZ as Integer (the scale factor of the terrain);

terrSize as Integer – the initial size of the terrain;

description:

return the X position as Integer of the arrow;

## nGetZPoSArrow

syntax:

nGetZPoSArrow(terrain, arrow, selector, camera, scaleX, scaleZ, terrSize)

where:

terrain as nTerrain;

arrow as UInteger Ptr;

selector as UInteger Ptr;

camera as nCamera;

scaleX, scaleZ as Integer (the scale factor of the terrain);

terrSize as Integer – the initial size of the terrain;

description:

return the Z position as Integer of the arrow;

## nGetTerrainVerticesEntry

syntax:

nGetTerrainVerticesEntry(terrain)

where:

terrain as UInteger Ptr (or nTerrain);

description:

return a pointer as UInteger Ptr to the 1st vertex in the vertex buffer of the terrain;

## nSetHeightTerrainVerticesGroup2

syntax:

nSetHeightTerrainVerticesGroup2(terrain, radius, xpos, zpos, speed, updown, scaleXZ, scaleY, terrSize,

shape, verticesEntry)

where:

terrain as UInteger Ptr;

radius as Integer;

xpos, zpos as Integer;

speed as Single( >0);

updown as Integer (0 or 1)

scaleXZ as Integer, factor scale on XZ directions;

scaleY as Integer, factor scale on Y direction;

terrSize as Integer, the initial size of terrain;

shape as Integer, (0 or 1, for circle or square);

verticesEntry as UInteger Ptr;

## nSaveTerrainHM

syntax:

nSaveTerrainHM(terrain, terrsize)

where:

terrain as UInteger Ptr;

terrsize as Integer; (the initial size of terrain)

description:

save in a heightmap folder the heightmap as bmp file;

Clady3D – May - 2011