Engine 3D - N3XTD

BlitzMax Forums/BlitzMax Programming/Engine 3D - N3XTD

Szafirek(Posted 2009) [#1]
TMyke creates a new 3D engine based on IrrLicht.

http://www.n3xt-d.org/_site/news.php

Written by someone can mod the engine for BlitzMax?

(Google translator)


byo(Posted 2009) [#2]
Actually I am working on a wrapper for this engine.
I'm in the process of converting the examples.
I'll post what I have soon so people can help improve/correct bugs and mistakes. :)


Szafirek(Posted 2009) [#3]
Well, I look forward to the results :)


byo(Posted 2009) [#4]
I wonder if anyone could point me in the right direction here. I understand that the whole engine uses functions with pointers being passed as parameters (ie. *IMesh, *IMaterial).

In Blitzmax I have successfully converted all of those pointers to structures to Byte Ptrs. But the problem is that the original parameter loses its readability because every function will now use a Byte Ptr instead of its pointer to a type, for instance.

Is there a way to make a pointer to a type in Blitzmax?

Some examples are working ok while others are not, specially the particle emitter ones. I'm not sure what's wrong but maybe it's because of pointers or some of my own messups when covnerting it.

Here's the original PB import source code:




byo(Posted 2009) [#5]
And here is the Blitzmax converted source (incomplete of course):

'
' ------------------------------------------------------------
'
'   Blitzmax - n3xt-D 1.0 version
'
' revision 001 date: 08-mars-09 by TMyke
' ------------------------------------------------------------
'
' 
'

Module tmyke.n3xtd

Import ".\inc\n3xtD_Constantes.bmx"
Import ".\inc\n3xtD_Math.bmx"
Import ".\inc\n3xtD_Vector2.bmx"
Import ".\inc\n3xtD_Vector3.bmx"
Import ".\inc\n3xtD_Plan.bmx"
Import ".\inc\n3xtD_Matrix.bmx"
Import ".\inc\n3xtD_AABB.bmx"
Import ".\inc\n3xtD_Structure.bmx"

Strict

?Win32
	Import ".\lib\n3xtD.lib"
?Not Win32
	Import "-lGL"
	Import "-lXxf86vm"
	Import "-lX11"
	Import "-lNewton"
	Import "-lstdc++"
	Import "-lN3xtD"
?


Extern
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- Global application v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iSetAntiAlias(value:Int=False)
	Function iSetInputEvent(value:Int=False)
	Function iInitEngine()
	Function iCreateScreen:Byte Ptr(dType:Int, dwWidth:Int, dwHeight:Int, VSync:Byte=True, Depth:Int=32, fullscreen:Byte=False, stencil:Byte=True, physic:Byte=True)
	Function iCreateEngineGadget(hWnd:Int, dType:Int, dwWidth:Int, dwHeight:Int, VSync:Byte=True, stencil:Byte=False, physic:Byte=True)
	Function iFreeEngine()
	Function iBeginScene:Int(Red:Byte=0,  Green:Byte=0,  Blue:Byte =0, Alpha:Byte=255, backbuffer:Byte=True,  zbuffer:Byte=True)
	Function iDrawScene()
	Function iDrawGUI()
	Function iEndScene()
	Function iSendLog(logtext:Byte Ptr)
	Function iLogFile(flag:Int=True)
	Function iFPS:Int()
	Function iRenderTarget:Int(target:ITexture Var , clearBackBuffer:Byte=True,  clearZBuffe:Byte=True,  color:Int=0)
	Function iSetViewPort(x:Int,  y:Int,  dx:Int,  dy:Int )
	Function iTextureCreation(flag:Int, enabled:Byte )
	Function iClipPlane:Int(index:Int, iplane:PLANE Var, enable:Byte=True)
	Function iEnableClipPlane(index:Int,  enable:Byte=True)
	Function iGetProjectionTransform(mat:MATRIX Var)
	Function iGetViewTransform(mat:MATRIX Var)
	Function iGetWorldTransform(mat:MATRIX Var)
	Function iQueryFeature(feature:Int )
	Function iRegisterNodeForRendering(node:INode Var , pass:Int )
	Function iFog(color:Int=$00ffffff, linearFog:Byte=True,  start:Float=50.0, FEnd:Float=100.0,  density:Float=0.01,  pixelFog:Byte=False,  rangeFog:Byte=False )
	Function iShadowColor(color:Int=$96000000)
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- NODE Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iPositionNode(node:Byte Ptr,  x:Float,  y:Float,  z:Float)
	Function iXNode(node:Byte Ptr,  x:Float)
	Function iYNode(node:Byte Ptr,  y:Float)
	Function iZNode(node:Byte Ptr,  z:Float)
	Function iRotateNode(node:Byte Ptr, x:Float,  y:Float,  z:Float)
	Function iScaleNode(node:Byte Ptr, x:Float,  y:Float,  z:Float)
	Function iTurnNode(node:Byte Ptr, x:Float,  y:Float,  z:Float)
	Function iTranslateNode(node:Byte Ptr, x:Float,  y:Float,  z:Float)
	Function iMoveNode(node:Byte Ptr, x:Float,  y:Float,  z:Float)
	Function iAddChildNode(node:Byte Ptr, child:Byte Ptr)
	Function iCloneNode:Int(node:Byte Ptr, parent:Byte Ptr=Null)  ' return *INode
	Function iNodePosition(node:Byte Ptr, vect:Byte Ptr)
	Function iNodeRotation(node:Byte Ptr, vect:Byte Ptr)
	Function iNodeAbsoluteRotation(node:Byte Ptr, vect:Byte Ptr)
	Function iNodeScale(node:Byte Ptr, vect:Byte Ptr)
	Function iNodeX:Float(node:Byte Ptr)
	Function iNodeY:Float(node:Byte Ptr)
	Function iNodeZ:Float(node:Byte Ptr)
	Function iNodeTransformation(node:Byte Ptr, mat:Byte Ptr)
	Function iNodeChildren:Int(node:Byte Ptr, num:Int=0) ' return *INode
	Function iNodeFindChildren:Int(node:Byte Ptr, child:Byte Ptr) ' return bool
	Function iNodeNumChildren:Int(node:Byte Ptr)
	Function iNodeNumMaterial:Int(node:Byte Ptr)
	Function iNodeMaterial:Byte Ptr(node:Byte Ptr,  num:Int=0)
	Function iNodeParent:Int(node:Byte Ptr)
	Function iNodeBoundingBox(node:Byte Ptr,  box:Byte Ptr)
	Function iNodeTransformedBoundingBox(node:Byte Ptr,  box:Byte Ptr)
	Function iNodeType:Int(node:Byte Ptr)
	Function iNodeVisible:Int(node:Byte Ptr)
	Function iVisibleNode(node:Byte Ptr,  flag:Byte=True)
	Function iNodeBoxIsVisible:Int(node:Byte Ptr, cam:Byte Ptr)
	Function iFreeNode(node:Byte Ptr)
	Function iFreeAllChildrenNode(node:Byte Ptr)
	Function iFreeChildrenNode(node:Byte Ptr, child:Byte Ptr)
	Function iRenderNode(node:Byte Ptr)
	Function iDebugModeNode(node:Byte Ptr,  state:Int)
	Function iMaterialFlagNode(node:Byte Ptr,  Flag:Int,  newvalue:Int=True)
	Function iMaterialTextureNode(node:Byte Ptr, texture:Byte Ptr, Layer:Int=0)
	Function iParentNode(node:Byte Ptr, parent:Byte Ptr)
	Function iUpdateAbsolutePositionNode(node:Byte Ptr)
	Function iSpecularColorNode(node:Byte Ptr, color:Int)
	Function iAmbientColorNode(node:Byte Ptr, color:Int)
	Function iDiffuseColorNode(node:Byte Ptr, color:Int)
	Function iEmissiveColorNode(node:Byte Ptr, color:Int)
	Function iGlobalColorNode(node:Byte Ptr, color:Int)
	Function iLoadTextureNode:Int(node:Byte Ptr, filename:Byte Ptr, num:Int=0,  layer:Int=0) ' return ITexture*  
	Function iProjectedX:Int(node:Byte Ptr, camera:Byte Ptr=Null)
	Function iProjectedY:Int(node:Byte Ptr, camera:Byte Ptr=Null)
	Function iMaterialTypeNode(node:Byte Ptr,  nType:Int )
	Function iPointNode(node:Byte Ptr, target:Byte Ptr,  roll:Float=0)
	Function iPointTargetNode(node:Byte Ptr, px:Float=0, py:Float=0, pz:Float=0,  roll:Float=0)
	Function iTurnAirNode(node:Byte Ptr, px:Float=0, py:Float=0, pz:Float=0)
	Function iAutomaticCullingNode(state:Int=EAC_BOX)
	Function iNodeRootScene:Int()
	Function iNodeDirection(node:Byte Ptr, vect:Byte Ptr)
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- Object Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iLoad3DObject:Byte Ptr(filename:Byte Ptr) ' return *IObjet
	Function iObjectGeometry(obj:Byte Ptr, frame:Int=0, detail:Int=0, startFrameloop:Int=-1,  endFrameLoop:Int=-1)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- COLLIDE Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iOverPickCamera:Int(camera:Byte Ptr)
	Function iPickCamera:Int(camera:Byte Ptr, mx:Int,  my:Int, pickType:Int=ENT_PICKBOX, distance:Float=5000.0 )
	Function iCollisionPoint:Int(sx:Float, sy:Float, sz:Float, ex:Float, ey:Float, ez:Float, mesh:Byte Ptr)
	Function iCollisionPointNode:Int(sx:Float, sy:Float, sz:Float, ex:Float, ey:Float, ez:Float, pickType:Int=ENT_PICKBOX)
	
	Function iPickedPosition(pos:Float Ptr)
	Function iPickedNormal(norm:Float Ptr)
	Function iPickedtriangle(triangles:Float Ptr)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- OCTREE  Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iSetPolysPerNode(num:Int=256)
	Function iCreateMeshInOctree:Int(model:Byte Ptr,  parent:Int Ptr=Null, frame:Int=0, detail:Int=0, startFrameloop:Int=-1, endFrameLoop:Int=-1) ' return *IMesh
	
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- MESH Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateMesh:Byte Ptr(model:Byte Ptr,  parent:Int Ptr=Null, frame:Int=0, detail:Int=0, startFrameloop:Int=-1, endFrameLoop:Int=-1) ' return *IMesh
	Function iCreateCube:Byte Ptr( ssize:Float=1.0, parent:Int Ptr=Null) ' return *INode
	Function iCreateSphere:Byte Ptr(radius:Float=1.0,  polyCount:Int=16, parent:Int Ptr=Null) ' return *INode
	Function iCreateEmptyMesh:Byte Ptr(parent:Int Ptr=Null)
	Function iCreateCylinder:Byte Ptr(radius:Float=1.0, length:Float=5.0, color:Int=$ffffffff, tesselation:Int=8, closeTop:Byte=True,  oblique:Float=0, parent:Int Ptr=Null)
	Function iCreateCone:Byte Ptr(radius:Float=1.0, length:Float=5.0, colorTop:Int=$ffffffff, colorBottom:Int=$ffffffff, tesselation:Int=8,  oblique:Float=0, parent:Int Ptr=Null)
	Function iCreateArrow:Byte Ptr(tesselationCylinder:Int=4, tesselationCone:Int=8, height:Float=1.0, cylinderHeight:Float=0.6, width0:Float=0.05, width1:Float=0.3, vtxColor0:Int=$ffffffff, vtxColor1:Int=$ffffffff , parent:Int Ptr=Null)
	Function iCreateHillPlane:Byte Ptr(tileSizeW:Float=10.0, tileSizeH:Float=10.0, tileCountW:Int=10, tileCountH:Int=10, material:Byte Ptr=Null,	 hillHeight:Float=0, countHillsW:Float=0, countHillsH:Float=0, textureRepeatCountW:Float=1, textureRepeatCountH:Float=1,	parent:Int Ptr=Null)
	Function iCreateText:Byte Ptr(font:Byte Ptr, text:Byte Ptr, color:Int=$ffffffff, parent:Int Ptr=Null)
	Function iCreateMeshCopy:Byte Ptr(mesh:Byte Ptr)
	Function iCloneMesh:Byte Ptr(mesh:Byte Ptr)
	Function iCreateMeshWithTangents:Byte Ptr(mesh:Byte Ptr,  recalculateNormals:Byte=False,  smooth:Byte=False,  angleWeighted:Byte=False)
	Function iCreateMeshWith2TCoords:Byte Ptr(mesh:Byte Ptr)
	Function iMeshGeometry:Byte Ptr(mesh:Byte Ptr)
	Function iDrawIndexedTriangleList(vertices:Int Ptr, vertexCount:Int, indexList:Int Ptr,  triangleCount:Int)
	Function iDrawIndexedTriangleList2T(vertices:Int Ptr, vertexCount:Int, indexList:Int Ptr,  triangleCount:Int)
	Function iDrawIndexedTriangleListTan(vertices:Int Ptr, vertexCount:Int, indexList:Int Ptr,  triangleCount:Int)
	' 
	Function iAddBufferMesh(mesh:Byte Ptr,  vertex_type:Int=0)
	Function iAddVertexMesh:Int(mesh:Byte Ptr,  x:Float,  y:Float,  z:Float, color:Int,  u:Float,  v:Float ,  num_buffer:Int=0)
	Function iAddFaceMesh:Int(mesh:Byte Ptr,  p1:Int,  p2:Int,  p3:Int , num_buffer:Int=0)
	Function iAddCVertexMesh:Int(mesh:Byte Ptr, buf:Int Ptr , num_buffer:Int=0)
	Function iAddMVerticesMesh(mesh:Byte Ptr, buf:Int Ptr,  numVert:Int, num_buffer:Int=0)
	Function iAddMFacesMesh(mesh:Byte Ptr, id:Int Ptr,  numId:Int, num_buffer:Int=0)
	' geometry instructions change
	Function iMeshBufferNumBuffer:Int(mesh:Byte Ptr)
	Function iMeshBufferVertexType:Int(mesh:Byte Ptr,  num_buffer:Int=0)
	Function iFlipSurfacesMeshBuffer(mesh:Byte Ptr )
	Function iVertexColorAlphaMeshBuffer(mesh:Byte Ptr,  Alpha:Int)
	Function iCalculateNormalsMeshBuffer(mesh:Byte Ptr,  smooth:Byte=False,  angleWeighted:Byte=False)
	Function iTransformMeshBuffer(mesh:Byte Ptr, mat:Byte Ptr)
	Function iScaleMeshBuffer(mesh:Byte Ptr, factorx:Float, factory:Float, factorz:Float)
	Function iRotateMeshBuffer(mesh:Byte Ptr, rotx:Float, roty:Float, rotz:Float)
	Function iTranslateMeshBuffer(mesh:Byte Ptr, tx:Float, ty:Float, tz:Float)
	Function iScaleTCoordsMeshBuffer(mesh:Byte Ptr, factorx:Float, factory:Float, layer:Int=0)
	Function iPlanarTextureMappingMeshBuffer(mesh:Byte Ptr,  resolution:Float=0.01 )
	Function iHardwareMapMeshBuffer(mesh:Byte Ptr, NewMappingHint:Int=EHM_STATIC)
	Function iDirtyMeshBuffer(mesh:Byte Ptr,  BufferType:Int=EBT_VERTEX_AND_INDEX)
	'Function iMeshBuffer:Int(mesh:Byte Ptr,  num_buffer:Int=0)
	Function iMeshBufferNumVertex:Int(mesh:Byte Ptr,  num_buffer:Int=0)
	Function iMeshBufferVertex(mesh:Byte Ptr, vert:Byte Ptr,  num_vert:Int=0, num_buffer:Int=0)
	Function iVertexMeshBuffer(mesh:Byte Ptr, x:Float ,y:Float ,z:Float,  num_vert:Int=0, num_buffer:Int=0)
	Function iMeshBufferNormal(mesh:Byte Ptr, norm:Byte Ptr,  num_vert:Int=0, num_buffer:Int=0)
	Function iNormalMeshBuffer(mesh:Byte Ptr, x:Float ,y:Float ,z:Float,  num_vert:Int=0, num_buffer:Int=0)
	Function iVertexColorMeshBuffer(mesh:Byte Ptr, color:Int,  num_vert:Int=0, num_buffer:Int=0)
	Function iMeshBufferTexCoord(mesh:Byte Ptr, tex:Byte Ptr,  num_vert:Int=0, num_buffer:Int=0)
	Function iTexCoordMeshBuffer(mesh:Byte Ptr, u:Float, v:Float,  num_vert:Int=0, num_buffer:Int=0)
	Function iMeshBufferTexCoord2(mesh:Byte Ptr, tex:Byte Ptr,  num_vert:Int=0, num_buffer:Int=0)
	Function iTexCoord2MeshBuffer(mesh:Byte Ptr, u:Float, v:Float,  num_vert:Int=0, num_buffer:Int=0)
	Function iMeshBufferVerticesBuffer:Int(mesh:Byte Ptr, num_buffer:Int=0)
	Function iMeshBufferVertexColor(mesh:Byte Ptr, color:Int Ptr,  num_vert:Int=0, num_buffer:Int=0)
	Function iMeshBufferIndicesBuffer:Int(mesh:Byte Ptr, num_buffer:Int=0)
	Function iMeshBufferFace(mesh:Byte Ptr, numface:Int, v0:Int Ptr, v1:Int Ptr,  v2:Int Ptr, num_buffer:Int=0)
	Function iMeshBufferPolyCount:Int(mesh:Byte Ptr,  num_buffer:Int=0)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- SPRITE3D Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateSprite3D:Int( texturename:Byte Ptr, ssize:Float=1.0, color:Int=$ffffffff, parent:Int Ptr=Null) ' return ISpriteSceneNode
	Function iOrientationSprite3D(sp:Byte Ptr, Orientation:Int=0)
	Function iCenterSprite3D(sp:Byte Ptr,  x:Float=0,  y:Float=0,  z:Float=0) 
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- PIVOT Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreatePivot:Int(parent:Int Ptr=Null)
	
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- SKY/BOLT/WATER Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateSkybox:Byte Ptr(top:Byte Ptr,bottom:Byte Ptr,	Left:Byte Ptr,	Right:Byte Ptr,front:Byte Ptr,back:Byte Ptr, parent:Int Ptr=Null)
	Function iCreateSkydome:Byte Ptr(texture:Byte Ptr, horiRes:Int=16, vertRes:Int=8, texturePercentage:Float=0.9,  spherePercentage:Float=2.0, parent:Int Ptr=Null)
	Function iCreateBolt:Byte Ptr(filename:Byte Ptr, startx:Float,  starty:Float, startz:Float, endx:Float,  endy:Float,  endz:Float,  updateTime:Int=300,  height:Int=10,  parts:Int=10,  bolts:Int=1,  steddyend:Byte=True,  thick:Float=5.0,  col:Int=$ffff0000, parent:Int Ptr=Null)  ' return IBolt*
	Function iCreateWater:Byte Ptr(  waveHeight:Float=2.0,   waveSpeed:Float=300.0,   waveLength:Float=10.0, parent:Int Ptr=Null)
	Function iSetWater( tileSizeX:Float=20.0,  tileSizeY:Float=20.0, tileCountX:Int=40, tileCountY:Int=40,	 countHillsX:Float=0, countHillsY:Float=0, textureRepeatCountX:Float=10.0, textureRepeatCountY:Float=10.0 )
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- BILLBOARD Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateBillboard:Byte Ptr(  sizex:Float=10.0, sizey:Float=10.0, colorTop:Int=$ffffffff, colorBottom:Int=$ffffffff, parent:Int Ptr=Null) ' return *IBillboard
	Function iBillboardColor(bill:Byte Ptr, colorTop:Int Ptr,  colorBottom:Int Ptr)
	Function iColorBillboard(bill:Byte Ptr,  colorTop:Int, colorBottom:Int)
	Function iBillboardSize(bill:Byte Ptr,  xx:Float,  yy:Float Ptr)
	Function iSizeBillboard(bill:Byte Ptr,  xx:Float,  yy:Float)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- TERRAIN Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateTerrain:Byte Ptr(filename:Byte Ptr, scale:Float=1.5, numQuads:Int=8, numFaces:Int=8, sizeTerrain:Int=1024, parent:Int Ptr=Null)
	Function iLoadTextureTerrain:Int(terrain:Byte Ptr, filename:Byte Ptr, textureLayer:Int=0)
	Function iMaterialTypeTerrain(terrain:Byte Ptr, newType:Int)
	Function iMaterialTextureTerrain(terrain:Byte Ptr, texture:Byte Ptr, Layer:Int=0 )
	Function iMaterialFlagTerrain(terrain:Byte Ptr, Flag:Int,  newvalue:Byte)
	Function iFreeTerrain(terrain:Byte Ptr)
	Function iTerrainBoundingBox(terrain:Byte Ptr, box:Byte Ptr)
	Function iTerrainHeight:Float(terrain:Byte Ptr,  x:Float,  z:Float)
	Function iTerrainQuadNode:Byte Ptr(terrain:Byte Ptr, num:Int)    ' return IQuadNode* 
	Function iTerrainQuadNodeXZ:Byte Ptr(terrain:Byte Ptr,  x:Int,  z:Int)    ' return IQuadNode* 
	Function iTextureMappingTerrain(terrain:Byte Ptr,  nquad:Int,  layer:Int,  n:Int,  texture:Byte Ptr)
	Function iTerrainPickedPosition(terrain:Byte Ptr, posVector:Byte Ptr)
	Function iTerrainPickedNormal(terrain:Byte Ptr, norm:Byte Ptr)
	Function iTerrainPickedQuad:Int(terrain:Byte Ptr)
	Function iTerrainPickedtriangle(terrain:Byte Ptr, triangles:Float Ptr)
	Function iPickTerrain:Int(terrain:Byte Ptr, x:Int, y:Int,  DistBase:Int)
	Function iHeightTerrain(terrain:Byte Ptr, x:Int, y:Int,  hh:Float)
	Function iTerrainTransformation(terrain:Byte Ptr,  mat:Byte Ptr)
	Function iHardwareMapTerrain(terrain:Byte Ptr, NewMappingHint:Int=EHM_STATIC)
	Function iDirtyTerrain(terrain:Byte Ptr,  BufferType:Int=EBT_VERTEX_AND_INDEX)
	' for debug
	Function iTerrainNQuad:Int(terrain:Byte Ptr)
	Function iQuadDebugTerrain(terrain:Byte Ptr, quaddebug:Byte=True)
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- PRIMITIVES 3D Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iDrawTriangle3D(tri:Float Ptr,  color:Int=$ffffffff)
	Function iDrawBox3D(box:Byte Ptr, color:Int=$ffffffff)
	Function iDrawLine3D(startx:Float,  starty:Float,  startz:Float,  endx:Float,  endy:Float,  endz:Float, color:Int=$ffffffff)
	Function iSituatePrimitive3D( px:Float=0,  py:Float=0,  pz:Float=0,  rx:Float=0,  ry:Float=0,  rz:Float=0)
	Function iMatrixPrimitive3D( mdraw:Byte Ptr )
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- MATERIAL Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateMaterial:Byte Ptr(flag:Int=Null) ' return IMaterial
	Function iMaterialFlag:Int(material:Byte Ptr, flag:Int) 
	Function iMaterialTexture:Byte Ptr(material:Byte Ptr,  i:Int) ' return ITexture*
	Function iMaterialTextureMatrix(material:Byte Ptr,  i:Int, matrix:Byte Ptr) 
	Function iMaterialTransparent:Int(material:Byte Ptr) 
	Function iFlagMaterial(material:Byte Ptr, flag:Int,  value:Byte) 
	Function iTextureMaterial(material:Byte Ptr,  i:Int, tex:Byte Ptr) 
	Function iTextureMatrixMaterial(material:Byte Ptr, i:Int,  matrix:Byte Ptr) 
	Function iMaterialAmbientColor:Int(material:Byte Ptr) 
	Function iAmbientColorMaterial(material:Byte Ptr,  col:Int) 
	Function iMaterialDiffuseColor:Int(material:Byte Ptr) 
	Function iDiffuseColorMaterial(material:Byte Ptr,  col:Int) 
	Function iMaterialEmissiveColor:Int(material:Byte Ptr) 
	Function iEmissiveColorMaterial(material:Byte Ptr,  col:Int) 
	Function iMaterialBackfaceCulling:Int(material:Byte Ptr) 
	Function iMaterialFogEnable:Int(material:Byte Ptr) 
	Function iMaterialFrontfaceCulling:Int(material:Byte Ptr) 
	Function iMaterialGouraudShading:Int(material:Byte Ptr) 
	Function iMaterialShininess:Float(material:Byte Ptr) 
	Function iShininessMaterial(material:Byte Ptr,  shin:Float) 
	Function iMaterialSpecularColor:Int(material:Byte Ptr) 
	Function iSpecularColorMaterial(material:Byte Ptr,  col:Int) 
	Function iMaterialThickness:Float(material:Byte Ptr) 
	Function iThicknessMaterial(material:Byte Ptr, thick:Float) 
	Function iTypeParamMaterial(material:Byte Ptr, param:Float) 
	Function iTypeParam2Material(material:Byte Ptr, param:Float) 
	Function iTypeMaterial(material:Byte Ptr,  matType:Int) 
	Function iSetMaterial(material:Byte Ptr) 
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- LIGHT Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateLight:Byte Ptr(  col:Int=$ffffffff, radius:Float=20, parent:Byte Ptr=Null) ' return *ILight
	Function iCastShadowLight( light:Byte Ptr, flag:Byte=True)
	Function iLightType:Int( light:Byte Ptr)
	Function iTypeLight( light:Byte Ptr, lType:Int)
	Function iLightRadius:Float( light:Byte Ptr)
	Function iRadiusLight( light:Byte Ptr,  radius:Float=100)
	Function iAmbientColorLight( light:Byte Ptr, col:Int)
	Function iLightAmbientColor:Int( light:Byte Ptr)
	Function iSpecularColorLight( light:Byte Ptr,  col:Int)
	Function iLightSpecularColor:Int( light:Byte Ptr)
	Function iDiffuseColorLight( light:Byte Ptr,  col:Int)
	Function iLightDiffuseColor:Int( light:Byte Ptr)
	Function iAttenuationLight( light:Byte Ptr,  constant:Float,  linear:Float,  quadratic:Float)
	Function iLightAttenuation( light:Byte Ptr, ret:Byte Ptr)
	Function iLightDirection( light:Byte Ptr, ret:Byte Ptr)
	Function iFalloffLight( light:Byte Ptr,  falloff:Float)
	Function iLightFalloff:Float( light:Byte Ptr)
	Function iInnerConeLight( light:Byte Ptr,  InnerCone:Float )
	Function iLightInnerCone:Float( light:Byte Ptr)
	Function iOuterConeLight( light:Byte Ptr, OuterCone:Float )
	Function iLightOuterCone:Float( light:Byte Ptr)
	Function iAmbientLight( color:Int=$ffffffff)
	Function iLightAmbient:Int()
	Function iCreateVolumeLight:Int( tailcolor:Int=$0, footcolor:Int=$3300f090,  subdivU:Int=32, subdivV:Int=32, parent:Int Ptr=Null )' return *IVolumeLight
	Function iParametersVolumeLight( vlight:Byte Ptr, tailcolor:Int=0, footcolor:Int=$3300f090,  subdivU:Int=32,  subdivV:Int=32)
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- TEXTURE Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iTextureColorFormat:Int( tex:Byte Ptr) 
	Function iTextureOriginalSize(tex:Byte Ptr,  width:Byte Ptr,  height:Byte Ptr) 
	Function iTexturePitch:Int(tex:Byte Ptr) 
	Function iTextureSize(tex:Byte Ptr, width:Byte Ptr,  height:Byte Ptr) 
	Function iTextureMipMaps:Int(tex:Byte Ptr) 
	Function iTextureRenderTarget:Int(tex:Byte Ptr) 
	Function iLockTexture:Int(tex:Byte Ptr,  readonly:Byte=False) 
	Function iUnlockTexture(tex:Byte Ptr) 
	Function iMipMapLevelTexture(tex:Byte Ptr) 
	Function iCreateRenderTargetTexture:Byte Ptr( width:Int, height:Int)  ' return ITexture*
	Function iCreateTexture:Byte Ptr( width:Int,  height:Int,  format:Int)   ' return ITexture*
	Function iCreateTextureWithImage:Byte Ptr( name:Byte Ptr, img:Byte Ptr)   ' return ITexture*
	Function iFindTexture:Int(name:Byte Ptr)   ' return ITexture*
	Function iLoadTexture:Byte Ptr(name:Byte Ptr)  ' return ITexture* 
	Function iTextureCount:Int() 
	Function iColorKeyTexture(tex:Byte Ptr,  col:Int) 
	Function iNormalMapTexture(tex:Byte Ptr,  ampli:Float= 1.0) 
	Function iFreeTexture(tex:Byte Ptr) 
	Function iFlagCreationTexture( flag:Int,    enabled:Byte) 
	Function iCreateListTexture:Int(filename:Byte Ptr,  width:Int, height:Int) 
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- TEXTURE ANIMATOR Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateTextureAnimator:Byte Ptr( texArray:Byte Ptr,  timePerFrame:Int,  Loop:Byte=True) ' return *INodeAnimator
	Function iAddAnimatorTexture(node:Byte Ptr, anim:Byte Ptr)
	Function iFreeAnimatorTexture(node:Byte Ptr, anim:Byte Ptr)
	Function iAnimatorTextureIndex:Int(anim:Byte Ptr)
	Function iAnimatorTextureStartTime:Int(anim:Byte Ptr)
	Function iAnimatorTextureEndTime:Int(anim:Byte Ptr)
	Function iAnimatorTextureSize:Int(anim:Byte Ptr)
	Function iNodeAnimators:Int(node:Byte Ptr,  num:Int=0)
	Function iRemoveAnimatorNode(node:Byte Ptr,  anim:Byte Ptr)
	Function iRemoveAnimatorsNode(node:Byte Ptr)
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- IMAGES Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iLoadImage:Int( filename:Byte Ptr )
	Function iFreeImage( img:Byte Ptr )
	Function iCreateSubImage:Byte Ptr( srcImage:Byte Ptr,  posx:Int,  posy:Int, sizex:Int,  sizey:Int )
	Function iCreateEmptyImage:Byte Ptr( format:Int, sizex:Int,  sizey:Int )
	Function iCreateScreenShot:Int()
	Function iSaveImage:Int( img:Byte Ptr, filename:Byte Ptr,  param:Int=0)
	Function iCopyRecImage( srcImage:Byte Ptr, targetImage:Byte Ptr,  posx:Int,  posy:Int,  orx:Int,  ory:Int,  w:Int,  h:Int)
	Function iCopyImage( srcImage:Byte Ptr, targetImage:Byte Ptr)
	Function iCopyWithAlphaImage( srcImage:Byte Ptr, targetImage:Byte Ptr, posx:Int,  posy:Int,  orx:Int,  ory:Int,  w:Int,  h:Int, color:Int=$ffffffff)
	Function iFillImage( img:Byte Ptr,  color:Int)
	Function iImageAlphaMask:Int( img:Byte Ptr)
	Function iImageBitsPerPixel:Int( img:Byte Ptr)
	Function iImageBytesPerPixel:Int( img:Byte Ptr)
	Function iImageBlueMask:Int( img:Byte Ptr)
	Function iImageGreenMask:Int( img:Byte Ptr)
	Function iImageRedMask:Int( img:Byte Ptr)
	Function iImageColorFormat:Int( img:Byte Ptr)
	Function iImageDimension( img:Byte Ptr,  w:Int Ptr,  h:Int Ptr)
	Function iImageSize:Int( img:Byte Ptr)
	Function iImageSizeInPixels:Int( img:Byte Ptr)
	Function iImagePitch:Int( img:Byte Ptr)
	Function iImagePixel:Int( img:Byte Ptr,  x:Int,  y:Int)
	Function iPixelImage( img:Byte Ptr,  x:Int,  y:Int,  color:Int=$ffffffff)
	Function iLockImage:Int( img:Byte Ptr)
	Function iUnlockImage( img:Byte Ptr)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- ANIMATION Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateAnimation:Byte Ptr(model:Byte Ptr, parent:Int Ptr=Null) ' return *IAnimatedMesh
	Function iSpeedAnimation(animMesh:Byte Ptr,  speed:Float )
	Function iAnimateJointAnimation(animMesh:Byte Ptr, CalculateAbsolutePositions:Byte=True )
	Function iCloneAnimation:Byte Ptr(animMesh:Byte Ptr, parent:Int Ptr=Null) ' return *IAnimatedMesh
	Function iAnimationEndFrame(animMesh:Byte Ptr)
	Function iAnimationFrameNumber:Float(animMesh:Byte Ptr)
	Function iFrameLoopAnimation(animMesh:Byte Ptr,  Fbegin:Int=0, Fend:Int=0)
	Function iAnimationJointCount:Int(animMesh:Byte Ptr)
	Function iAnimationJointNode:Byte Ptr(animMesh:Byte Ptr, jointID:Int=0) ' return *IBoneNode
	Function iAnimationJointNodebyName:Int(animMesh:Byte Ptr, name:Byte Ptr)
	Function iAnimationStartFrame:Int(animMesh:Byte Ptr)
	Function iCurrentFrameAnimation(animMesh:Byte Ptr,  frame:Float)
	Function iJointModeAnimation(animMesh:Byte Ptr, Mode:Int=EJUOR_NONE )
	Function iLoopModeAnimation(animMesh:Byte Ptr, Mode:Byte=True)
	Function iRenderFromIdentityAnimation(animMesh:Byte Ptr, Mode:Byte=True)
	Function iTransitionTimeAnimation(animMesh:Byte Ptr,  TTime:Float)
	' shadowVolume
	Function iShadowVolumeAnimation:Int(animMesh:Byte Ptr,  zfailmethod:Byte=True, infinity:Float=10000.0 )
	Function iUpdateShadowVolume(shadVol:Byte Ptr)
	' Bones 
	Function iBoneAnimationMode:Int(bone:Byte Ptr)
	Function iBoneIndex:Int(bone:Byte Ptr)
	Function iBoneName:Byte Ptr(bone:Byte Ptr) ' return char*
	Function iBoneBoundingBox(bone:Byte Ptr, boundBox:Byte Ptr)
	Function iBoneSkinningSpace:Int(bone:Byte Ptr)
	Function iOnAnimateBone(bone:Byte Ptr, timeMS:Int)
	Function iAnimationModeBone(bone:Byte Ptr, Mode:Int)
	Function iSkinningSpaceBone(bone:Byte Ptr, space:Int)
	Function iUpdateAbsolutePositionOfAllChildrenBone(bone:Byte Ptr)
	Function iBonePositionHint:Int(bone:Byte Ptr)
	Function iBoneScaleHint:Int(bone:Byte Ptr)
	Function iBoneRotationHint:Int(bone:Byte Ptr)
	Function iBoneAnimationParent:Int(bone:Byte Ptr)
	' MD2
	Function iAnimationMD2(animMesh:Byte Ptr,  aType:Int=EMAT_STAND )
	Function iAnimationMD2byName(animMesh:Byte Ptr,  animationName:Byte Ptr )
	Function iMD2AnimationCount:Int(animMesh:Byte Ptr)
	Function iMD2AnimationName:Int(animMesh:Byte Ptr, nr:Int=0) ' return char*
	Function iMD2FrameLoopName(animMesh:Byte Ptr, name:Byte Ptr, outBegin:Int Ptr,outEnd:Int Ptr, outFPS:Int Ptr)   
	Function iMD2FrameLoopType(animMesh:Byte Ptr, flType:Int, outBegin:Int Ptr, outEnd:Int Ptr, outFPS:Int Ptr)   
	' MD3
	Function iInterpolationShiftMD3(animMesh:Byte Ptr,  shift:Int,  loopMode:Int)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- CAMERA Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateCamera:Byte Ptr(parent:Int Ptr=Null) ' return *ICamera
	Function iCameraTarget(cam:Byte Ptr, res:Float Ptr)
	Function iTargetCamera(cam:Byte Ptr,  x:Float,  y:Float,  z:Float)
	Function iTargetAndRotationCamera(cam:Byte Ptr, flag:Byte=True)
	Function iCameraAspectRatio:Float(cam:Byte Ptr )
	Function iCameraFarValue:Float(cam:Byte Ptr )
	Function iCameraNearValue:Float(cam:Byte Ptr )
	Function iCameraFOV:Float(cam:Byte Ptr )
	Function iCameraProjectionMatrix(cam:Byte Ptr, mat:Byte Ptr)
	Function iCameraUpVector(cam:Byte Ptr, vect:Byte Ptr )
	Function iCameraViewMatrix(cam:Byte Ptr, mat:Byte Ptr)
	Function iAspectRatioCamera(cam:Byte Ptr, aspect:Float)
	Function iFarValueCamera(cam:Byte Ptr,  farv:Float)
	Function iFOVCamera(cam:Byte Ptr,  fov:Float)
	Function iNearValueCamera(cam:Byte Ptr,  nearv:Float)
	Function iUpVectorCamera(cam:Byte Ptr,   x:Float,  y:Float,  z:Float)
	Function iCameraBoxInside(cam:Byte Ptr,  box:Byte Ptr)
	Function iActiveCamera(cam:Byte Ptr)
	Function iCameraActive:Int()
	Function iProjectionMatrixCamera(cam:Byte Ptr,  projection:Byte Ptr,  isOrthogonal:Byte=False)
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- PARTICLE Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateParticleSystem:Byte Ptr( withDefaultEmitter:Int=False, parent:Byte Ptr=Null )
	Function iCreateParticleBoxEmitter:Byte Ptr(part:Byte Ptr, dirx:Float=0, diry:Float=0.03, dirz:Float=0, minParticlesPerSecond:Int=5, maxParticlesPerSecond:Int=10, mnStartColor:Int=$ff000000, mxStartColor:Int=$ffffffff, lifeTimeMin:Int=2000, lifeTimeMax:Int=4000, maxAngleDegrees:Int=0,  dimminx:Float=5.0, dimminy:Float=5.0, dimmaxx:Float=5.0, dimmaxy:Float=5.0, bbox:Byte Ptr) ' return IParticleBox*
	Function iCreateParticleCylinderEmitter:Byte Ptr(part:Byte Ptr, centerx:Float,  centery:Float,  centerz:Float, radius:Float, normalx:Float, normaly:Float, normalz:Float, length:Float, outlineOnly:Byte=False, dirx:Float=0, diry:Float=0.03, dirz:Float=0, minParticlesPerSecond:Int=5, maxParticlesPerSecond:Int=10, minStartCol:Int=$ff000000, maxStartCol:Int=$ffffffff,lifeTimeMin:Int=2000, lifeTimeMax:Int=4000, maxAngleDegrees:Int=0, minStartSx:Float=5.0, minStartSy:Float=5.0, maxStartSx:Float=5.0,  maxStartSy:Float=5.0) 
	Function iCreateParticleSphereEmitter:Byte Ptr(part:Byte Ptr, centerx:Float,  centery:Float,  centerz:Float, radius:Float,  dirx:Float=0, diry:Float=0.03, dirz:Float=0, minParticlesPerSecond:Int=5, maxParticlesPerSecond:Int=10, minStartCol:Int=$ff000000, maxStartCol:Int=$ffffffff,lifeTimeMin:Int=2000, lifeTimeMax:Int=4000, maxAngleDegrees:Int=0, minStartSx:Float=5.0, minStartSy:Float=5.0, maxStartSx:Float=5.0,  maxStartSy:Float=5.0) 
	Function iCreateParticleMeshEmitter:Byte Ptr(part:Byte Ptr, mesh:Byte Ptr, useNormalDirection:Int=True, dirx:Float=0, diry:Float=0.03, dirz:Float=0, normalDirectionModifier:Float=100.0, mbNumber:Int=-1, everyMeshVertex:Byte = False,minParticlesPerSecond:Int=5, maxParticlesPerSecond:Int=10, minStartCol:Int=$ff000000, maxStartCol:Int=$ffffffff,lifeTimeMin:Int=2000, lifeTimeMax:Int=4000, maxAngleDegrees:Int=0, minStartSx:Float=5.0, minStartSy:Float=5.0, maxStartSx:Float=5.0,  maxStartSy:Float=5.0) 																			 
																 
	Function iScaleParticleSystem(part:Byte Ptr, spx:Float=1.0, spy:Float=1.0)
	Function iRotationParticleSystem(part:Byte Ptr, spx:Float=5.0,  spy:Float=5.0, spz:Float=5.0, px:Float=0, py:Float=0, pz:Float=0)
	Function iAttractionParticleSystem(part:Byte Ptr, pointx:Float, pointy:Float, pointz:Float, speed:Float=1.0, attract:Byte=True,  affectX:Byte=True,  affectY:Byte=True,  affectZ:Byte=True )
	Function iAddEmitterParticleSystem(part:Byte Ptr, em:Byte Ptr )
	Function iFadeOutParticleSystem(part:Byte Ptr,  targetColor:Int=0,   timeNeededToFadeOut:Int=1000 )
	Function iParticleSystemEmitter:Int(part:Byte Ptr)
	Function iGlobalParticleSystem(part:Byte Ptr, Glob:Byte=True)
	Function iParticleSizeParticleSystem(part:Byte Ptr, sx:Float=1.0, sy:Float=1.0)
	' IParticle functions
	Function iMinStartSizeParticle(em:Byte Ptr,  dimx:Float,  dimy:Float  )
	Function iMaxStartSizeParticle(em:Byte Ptr,  dimx:Float,  dimy:Float  )
	Function iParticleDirection(em:Byte Ptr,  dirx:Float Ptr,  diry:Float Ptr,  dirz:Float Ptr  )
	Function iParticleMaxPerSecond:Int(em:Byte Ptr)
	Function iParticleMinPerSecond:Int(em:Byte Ptr )
	Function iDirectionParticle(em:Byte Ptr,  dirx:Float, diry:Float, dirz:Float  )
	Function iMinPerSecondParticle(em:Byte Ptr,  minPPS:Int )
	Function iMaxPerSecondParticle(em:Byte Ptr,  maxPPS:Int )
	Function iParticleType:Int(em:Byte Ptr )
	Function iParticleMaxStartColor:Int(em:Byte Ptr)
	Function iParticleMinStartColor:Int(em:Byte Ptr )
	Function iParticleMaxStartSize(em:Byte Ptr,  dimx:Float Ptr,  dimy:Float Ptr )
	Function iParticleMinStartSize(em:Byte Ptr,  dimx:Float Ptr,  dimy:Float Ptr )
	Function iMaxStartColorParticle(em:Byte Ptr,  col:Int )
	Function iMinStartColorParticle(em:Byte Ptr,  col:Int )
	
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- FileSystem Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iAddZipFileArchive(filename:Byte Ptr)
	Function iAddFolderFileArchive(filename:Byte Ptr,  ignoreCase:Byte=True,   ignorePaths:Byte=True)  
	Function iAddPakFileArchive(filename:Byte Ptr, ignoreCase:Byte=True,   ignorePaths:Byte=True)  
	Function iChangeWorkingDirectory(filename:Byte Ptr) 
	Function iCreateAndOpenFile:Int(filename:Byte Ptr) 
	Function iCreateAndWriteFile:Int(filename:Byte Ptr, append:Byte=False)
	Function iCreateFileList:Int()  
	Function iFreeFileList(fileList:Byte Ptr)  
	Function iCreateMemoryReadFile(memory:Int Ptr, mLen:Int, fileName:Byte Ptr, deleteMemoryWhenDropped:Byte=False) 
	Function iExistFile(fileName:Byte Ptr)  
	Function iWorkingDirectory:Int() ' return char *
	' IReadFile
	Function iReadFileFileName:Int(ReadFile:Byte Ptr) ' return char *  
	Function iReadFilePos:Int(ReadFile:Byte Ptr)  
	Function iReadFileSize:Int(ReadFile:Byte Ptr)  
	Function iReadFileRead:Int(ReadFile:Byte Ptr, buffer:Int Ptr, sizeToRead:Int)  
	Function iReadFileSeek:Int(ReadFile:Byte Ptr, finalPos:Int,  relativeMovement:Byte=False) 
	' IWriteFile
	Function iWriteFileName:Int(WriteFile:Byte Ptr)  ' return char *  
	Function iWriteFilePos:Int(WriteFile:Byte Ptr) 
	Function iWriteFileSeek:Int(WriteFile:Byte Ptr, finalPos:Int,  relativeMovement:Byte=False) 
	Function iWriteFileWrite:Int(WriteFile:Byte Ptr, buffer:Int Ptr, sizeToWrite:Int)  
	' IFileList
	Function iFileListCount:Int(fileList:Byte Ptr)  
	Function iFileListName:Int(fileList:Byte Ptr, index:Int)  
	Function iFileListFullName:Int(fileList:Byte Ptr, index:Int)  
	Function iFileListisDirectory:Int(fileList:Byte Ptr, index:Int)  
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- 2D Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iDrawLine2D(sx:Int,  sy:Int, ex:Int,  ey:Int,  color:Int=$ffffffff)
	Function iDrawPolygon2D(sx:Int,  sy:Int, radius:Float,  color:Int=$ffffffff,  vertexcount:Int=10)
	Function iDrawRectangle2D(sx:Int,  sy:Int, ex:Int,  ey:Int,  colorLUp:Int=$ffffffff,  colorRUp:Int=$ffffffff,  colorLDown:Int=$ffffffff,  colorRDown:Int=$ffffffff, clip:Int Ptr=Null)
	Function iDrawRect2D(sx:Int,  sy:Int, ex:Int,  ey:Int,  color:Int=$ffffffff,  clip:Int Ptr=Null)
	Function iDrawSubRectImage2D(tex:Byte Ptr ,destx:Int,  desty:Int, destex:Int,  destey:Int, srcx:Int,  srcy:Int, srcex:Int,  srcey:Int,  color:Int Ptr=Null,  clip:Int Ptr=Null, useAlphaChannelOfTexture:Byte=False )
	Function iDrawRectImage2D(tex:Byte Ptr ,posx:Int,  posy:Int, srcx:Int,  srcy:Int, srcex:Int,  srcey:Int,  color:Int=$ffffffff,  clip:Int Ptr=Null, useAlphaChannelOfTexture:Byte=False )
	Function iDrawImage2D(tex:Byte Ptr ,posx:Int,  posy:Int)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- GUI Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iTextGUI(gui:Byte Ptr, text:Byte Ptr)
	Function iToolTipTextGUI(gui:Byte Ptr, text:Byte Ptr)
	Function iVisibleGUI(gui:Byte Ptr, flag:Byte)
	Function iRelativePositionGUI(gui:Byte Ptr, posx:Int,  posy:Int)
	Function iRelativeRectGUI(gui:Byte Ptr, posx:Int,  posy:Int,  ox:Int,  oy:Int)
	Function iGUIAbsoluteRect(gui:Byte Ptr, posx:Byte Ptr,  posy:Byte Ptr,  ox:Int Ptr,  oy:Int Ptr)
	Function iGUIAbsoluteClippingRect(gui:Byte Ptr, posx:Byte Ptr,  posy:Byte Ptr,  ox:Int Ptr,  oy:Int Ptr)
	Function iGUIChildren:Int(gui:Byte Ptr,  num:Int=0)
	Function iChildrenGUI(gui:Byte Ptr, childGui:Byte Ptr)
	Function iBringToFrontGUI:Int(gui:Byte Ptr)
	Function iGUIElementFromId:Int(gui:Byte Ptr,  Id:Int, searchchildren:Byte=False)
	Function iGUIID:Int(gui:Byte Ptr)
	Function iGUIParent:Int(gui:Byte Ptr)
	Function iGUIType:Int(gui:Byte Ptr)
	Function iGUIisEnabled:Int(gui:Byte Ptr)
	Function iGUIisPointInside:Int(gui:Byte Ptr,  posx:Int,  posy:Int)
	Function iGUIVisible:Int(gui:Byte Ptr)
	Function iMoveGUI(gui:Byte Ptr,  posx:Int,  posy:Int)
	Function iFreeGUI(gui:Byte Ptr)
	Function iFreeChildGUI(gui:Byte Ptr, childGui:Byte Ptr)
	Function iEnabledGUI(gui:Byte Ptr,  enable:Byte=True)
	Function iIDGUI(gui:Byte Ptr,  ID:Int=-1)
	Function iMaxSizeGUI(gui:Byte Ptr, posx:Int,  posy:Int)
	Function iMinSizeGUI(gui:Byte Ptr, posx:Int,  posy:Int)
	Function iGUIText:Int(gui:Byte Ptr)
	Function iGUIEventCallBack(procedureGUIEventCallBack:Int Ptr)
	Function iGUIColor:Int( index:Int)
	Function iColorGUI(index:Int, color:Int)
	
	' text and font
	Function iAddStaticText:Int(text:Byte Ptr,  x:Int,  y:Int,  rx:Int,  ry:Int, border:Byte=False, wordWrap:Byte=True, fillBackground:Byte=False, parent:Int Ptr=Null, id:Int=-1)
	Function iLoadFont(filename:Byte Ptr)
	Function iGetFont:Byte Ptr()
	Function iDrawText(font:Byte Ptr, text:Byte Ptr,  x:Int,  y:Int,  rx:Int,  ry:Int, color:Int=$ff9999ff)
	Function iGUIText_EnableOverrideColor(text:Byte Ptr, enable:Byte)
	Function iGUIText_OverrideColor:Int(text:Byte Ptr)
	Function iGUIText_OverrideFont:Int(text:Byte Ptr)  ' return IGUIFont*
	Function iGUIText_Height:Int(text:Byte Ptr)
	Function iGUIText_Width:Int(text:Byte Ptr)
	Function iBackgroundColor_GUIText(text:Byte Ptr, color:Int=$ffffffff)
	Function iDrawBackground_GUIText(text:Byte Ptr,  draw:Byte)
	Function iDrawBorder_GUIText(text:Byte Ptr,  draw:Byte)
	Function iOverrideColor_GUIText(text:Byte Ptr,  color:Int=$ffffffff)
	Function iOverrideFont_GUIText(text:Byte Ptr, font:Byte Ptr)
	Function iAlignment_GUIText(text:Byte Ptr, h:Int, v:Int)
	Function iWordWrap_GUIText(text:Byte Ptr,  enable:Byte)
	' button
	Function iAddButtonGUI:Int(orx:Int, ory:Int, sx:Int, sy:Int,  text:Byte Ptr, tooltiptext:Byte Ptr=Null, parent:Byte Ptr=Null , id:Int=-1  )
	Function iGUIButton_AlphaChannel:Int(button:Byte Ptr )
	Function iGUIButton_DrawingBorder:Int(button:Byte Ptr )
	Function iGUIButton_Pressed:Int(button:Byte Ptr )
	Function iGUIButton_PushButton:Int(button:Byte Ptr )
	Function iDrawBorder_GUIButton(button:Byte Ptr, border:Byte=True)
	Function iImage_GUIButton(button:Byte Ptr, imageTex:Byte Ptr=Null)
	Function iPushButton_GUIButton(button:Byte Ptr, isPushButton:Byte=False )
	Function iOverrideFont_GUIButton(button:Byte Ptr, font:Byte Ptr  )
	Function iPressed_GUIButton(button:Byte Ptr,  pressed:Byte=True  )
	Function iPressedImage_GUIButton(button:Byte Ptr,  imageTex:Byte Ptr=Null)
	Function iSprite_GUIButton(button:Byte Ptr, state:Int, index:Int, color:Int=$ffffffff, Loop:Byte=False )
	Function iSpriteBank_GUIButton(button:Byte Ptr,  bank:Byte Ptr )
	Function iAlphaChannel_GUIButton(button:Byte Ptr,  useAlphaChannel:Byte=False )
	' CursorControl
	Function iCursorControlPosition( posx:Byte Ptr, posy:Byte Ptr)
	Function iCursorControlRelativePosition( posx:Float Ptr, posy:Float Ptr)
	Function iCursorControlVisible:Int()
	Function iPositionCursorControl( x:Int, y:Int)
	Function iReferenceRectCursorControl( orx:Int, ory:Int, sx:Int, sy:Int)
	Function iVisibleCursorControl( visible:Byte=True )
	' CheckBox
	Function iAddCheckBoxGUI:Int( checked:Byte, orx:Int, ory:Int, sx:Int, sy:Int,  text:Byte Ptr, parent:Byte Ptr=Null , id:Int=-1  )
	Function iGUICheckBox_Check:Int( check:Byte Ptr )
	Function iCheck_GUICheckBox(check:Byte Ptr , checked:Byte=True  )
	' EditBox
	Function iAddEditBox:Int(text:Byte Ptr, x:Int,  y:Int,  rx:Int,  ry:Int, border:Byte=True, parent:Byte Ptr=Null , id:Int=-1  )
	Function iEnableOverrideColor_GUIEditBox(guiEditBox:Byte Ptr , enable:Byte)
	Function iGUIEditBox_Max:Int(guiEditBox:Byte Ptr)
	Function iGUIEditBox_AutoScrollEnabled:Int(guiEditBox:Byte Ptr)
	Function iGUIEditBox_TextDimension(guiEditBox:Byte Ptr, dimx:Int Ptr, dimy:Int Ptr)
	Function iGUIEditBox_MultiLineEnabled:Int(guiEditBox:Byte Ptr)
	Function iAutoScroll_GUIEditBox(guiEditBox:Byte Ptr, enable:Byte=True)
	Function iDrawBorder_GUIEditBox(guiEditBox:Byte Ptr, enable:Byte=True)
	Function iMax_GUIEditBox(guiEditBox:Byte Ptr, mm:Int=128)
	Function iMultiline_GUIEditBox(guiEditBox:Byte Ptr, enable:Byte=True)
	Function iOverrideColor_GUIEditBox(guiEditBox:Byte Ptr, color:Int=$ffffffff)
	Function iOverrideFont_GUIEditBox(guiEditBox:Byte Ptr, font:Byte Ptr )
	Function iTextAlignment_GUIEditBox(guiEditBox:Byte Ptr, h:Int, v:Int)
	' GUI Image
	Function iAddImageGUI:Int(img:Byte Ptr, posx:Int, posy:Int, useAlphaChannel:Byte=True, text:Byte Ptr, parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddEmptyImageGUI:Int(posx:Int, posy:Int, osx:Int, osy:Int, text:Byte Ptr, parent:Byte Ptr=Null , id:Int=-1 )
	Function iGUIImage_AlphaChannelUsed:Int( img:Byte Ptr )
	Function iGUIImage_ImageScaled:Int(img:Byte Ptr)
	Function iColor_GUIImage(img:Byte Ptr, color:Int=$ffffffff )
	Function iImage_GUIImage(img:Byte Ptr,  imageTex:Byte Ptr )
	Function iScale_GUIImage(img:Byte Ptr, enable:Byte )
	Function iAlphaChannel_GUIImage(img:Byte Ptr, enable:Byte=True )
	' ComboBox
	Function iAddComboBoxGUI:Int( x:Int,  y:Int,  rx:Int,  ry:Int, parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddItem_GUIComboBox:Int( combo:Byte Ptr, text:Byte Ptr)
	Function iClear_GUIComboBox(combo:Byte Ptr)
	Function iGUIComboBox_Item:Int(combo:Byte Ptr,  idx:Int=0)
	Function iGUIComboBox_ItemCount:Int(combo:Byte Ptr)
	Function iGUIComboBox_Selected:Int(combo:Byte Ptr)
	Function iRemoveItem_GUIComboBox(combo:Byte Ptr, idx:Int=0)
	Function iSelected_GUIComboBox(combo:Byte Ptr, idx:Int=0)
	Function iTextAlignment_GUIComboBox(combo:Byte Ptr, h:Int, v:Int)
	' ContextMenu
	Function iAddContexMenuGUI:Int(x:Int,  y:Int,  rx:Int,  ry:Int, parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddItem_GUIContexMenu:Int(menu:Byte Ptr, text:Byte Ptr, commandId:Int=-1, enable:Byte=True, hasSubMenu:Byte=False , checked:Byte=False )
	Function iAddSeparator_GUIContexMenu(menu:Byte Ptr)
	Function iGUIContexMenu_ItemCommandId:Int(menu:Byte Ptr, idx:Int=0)
	Function iGUIContexMenu_ItemCount:Int(menu:Byte Ptr)
	Function iGUIContexMenu_ItemText:Int(menu:Byte Ptr, idx:Int=0)
	Function iGUIContexMenu_ItemSelected:Int(menu:Byte Ptr)
	Function iGUIContexMenu_SubMenu:Int(menu:Byte Ptr, idx:Int=0)
	Function iGUIContexMenu_ItemChecked:Int(menu:Byte Ptr, idx:Int=0)
	Function iGUIContexMenu_ItemEnabled:Int(menu:Byte Ptr, idx:Int=0)
	Function iRemoveAll_GUIContexMenu(menu:Byte Ptr)
	Function iRemoveItem_GUIContexMenu(menu:Byte Ptr, idx:Int=0)
	Function iItemChecked_GUIContexMenu(menu:Byte Ptr, idx:Int=0, enable:Byte=True)
	Function iItemCommanId_GUIContexMenu(menu:Byte Ptr, idx:Int=0, id:Int=-1)
	Function iItemEnabled_GUIContexMenu(menu:Byte Ptr, idx:Int=0, enable:Byte=True)
	Function iItemText_GUIContexMenu(menu:Byte Ptr, idx:Int, text:Byte Ptr)
	' Sprite Bank
	Function iAddEmptySpriteBankGUI:Int(name:Byte Ptr)
	Function iAddTexture_GUISpriteBank( sp:Byte Ptr,  texture:Byte Ptr  )
	Function iDraw2D_GUISpriteBank( sp:Byte Ptr, index:Int, posx:Int, posy:Int, color:Int=$ffffffff, starttime:Int=0,	CurrentTime:Int=0, Loop:Byte=True, center:Byte=False, clipox:Int Ptr=Null ) 
	Function iGUISpriteBank_Texture( sp:Byte Ptr, idx:Int=0)
	Function iGUISpriteBank_TextureCount( sp:Byte Ptr)
	Function iTexture_GUISpriteBank( sp:Byte Ptr, idx:Int, texture:Byte Ptr)
	' FileOpenDialog
	Function iAddFileOpenDialogGUI( title:Byte Ptr, modal:Byte=True, parent:Byte Ptr=Null , id:Int=-1 )
	Function iGUIFileOpenDialog_FileName:Int( dial:Byte Ptr )
	' InOutFader
	Function iAddInOutFaderGUI:Byte Ptr(rect:Int Ptr, parent:Byte Ptr=Null , id:Int=-1 )' return IGUIInOutFader*
	Function iFadeIn_GUIInOutFader( inout:Byte Ptr,  time:Int)
	Function iFadeOut_GUIInOutFader(inout:Byte Ptr, time:Int)
	Function iGUIInOutFader_Color:Int(inout:Byte Ptr)
	Function iGUIInOutFader_Ready:Int(inout:Byte Ptr)
	Function iColor_GUIInOutFader(inout:Byte Ptr,  color:Int=$ffffffff)
	' ListBox
	Function iAddListBoxGUI:Int( orx:Int,  ory:Int,  sx:Int,  sy:Int,  drawBackground:Byte=True, parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddItem_GUIListBox(lbox:Byte Ptr, item:Byte Ptr, icon:Int=-1)
	Function iClear_GUIListBox(lbox:Byte Ptr)
	Function iClearItemOverrideColor_GUIListBox(lbox:Byte Ptr,  idx:Int)
	Function iGUIListBox_Icon:Int(lbox:Byte Ptr,  idx:Int)
	Function iGUIListBox_ItemCount:Int(lbox:Byte Ptr)
	Function iGUIListBox_ItemDefaultColor:Int(lbox:Byte Ptr,  colorType:Int )
	Function iGUIListBox_ItemOverrideColor:Int(lbox:Byte Ptr,  idx:Int,  colorType:Int )
	Function iGUIListBox_ListItem:Int(lbox:Byte Ptr,  idx:Int)
	Function iGUIListBox_Selected:Int(lbox:Byte Ptr)
	Function iGUIListBox_HasItemOverrideColor:Int(lbox:Byte Ptr,  idx:Int,  colorType:Int )
	Function iInsertItem_GUIListBox:Int(lbox:Byte Ptr,  idx:Byte Ptr, item:Byte Ptr,  icon:Int )
	Function iGUIListBox_AutoScrollEnabled:Int(lbox:Byte Ptr)
	Function iRemoveItem_GUIListBox(lbox:Byte Ptr,  idx:Int)
	Function iAutoScrollEnabled_GUIListBox(lbox:Byte Ptr,  scroll:Byte=True)
	Function iItem_GUIListBox(lbox:Byte Ptr,  idx:Int, item:Byte Ptr,  icon:Int )
	Function iItemOverrideColor_GUIListBox(lbox:Byte Ptr,  idx:Int,  colorType:Int,  color:Int )
	Function iSelected_GUIListBox(lbox:Byte Ptr,  idx:Int)
	Function iSpriteBank_GUIListBox(lbox:Byte Ptr,   bank:Byte Ptr  )
	Function iSwapItems_GUIListBox(lbox:Byte Ptr,  idx1:Int,  idx2:Int)
	' Menu
	Function iAddMenuGUI:Int(parent:Byte Ptr=Null , id:Int=-1 )
	' messagebox
	Function iAddMessageBoxGUI:Int(caption:Byte Ptr, text:Byte Ptr, modal:Byte=True, flag:Int=EMBF_OK, parent:Byte Ptr=Null , id:Int=-1 )
	Function iGUIMessageBox_CloseButton:Int(mb:Byte Ptr)
	Function iGUIMessageBox_MaximizeButton:Int(mb:Byte Ptr)
	Function iGUIMessageBox_MinimizeButton:Int(mb:Byte Ptr)
	' modal screen
	Function iAddModalScreenGUI:Int(parent:Byte Ptr=Null)
	' scroll bar
	Function iAddScrollBarGUI:Int( horizontal:Byte, orx:Int,  ory:Int,  sx:Int,  sy:Int, parent:Byte Ptr=Null , id:Int=-1 )
	Function iGUIScrollBar_LargeStep:Int(sb:Byte Ptr)
	Function iGUIScrollBar_Max:Int(sb:Byte Ptr)
	Function iGUIScrollBar_Pos:Int(sb:Byte Ptr)
	Function iGUIScrollBar_SmallStep:Int(sb:Byte Ptr)
	Function iLargeStep_GUIScrollBar(sb:Byte Ptr,  value:Int)
	Function iMax_GUIScrollBar(sb:Byte Ptr,  value:Int)
	Function iPos_GUIScrollBar(sb:Byte Ptr,  value:Int)
	Function iSmallStep_GUIScrollBar(sb:Byte Ptr,  value:Int)
	' spin box
	Function iAddSpinBoxGUI:Int(text:Byte Ptr, orx:Int,  ory:Int,  sx:Int,  sy:Int, parent:Byte Ptr=Null , id:Int=-1 )
	Function iGUISpinBox_EditBox:Int(spb:Byte Ptr)
	Function iGUISpinBox_Max:Float(spb:Byte Ptr)
	Function iGUISpinBox_Min:Float(spb:Byte Ptr)
	Function iGUISpinBox_StepSize:Float(spb:Byte Ptr)
	Function iGUISpinBox_Value:Float(spb:Byte Ptr)
	Function iDecimalPlaces_GUISpinBox(spb:Byte Ptr, value:Int)
	Function iRange_GUISpinBox(spb:Byte Ptr,  rMin:Float,  rMax:Float)
	Function iStepSize_GUISpinBox(spb:Byte Ptr, sStep:Float)
	Function iValue_GUISpinBox(spb:Byte Ptr, value:Float)
	' tabcontrol 
	Function iAddTabControlGUI(orx:Int,  ory:Int,  sx:Int,  sy:Int, fillbackground:Byte=False,	border:Byte=True, parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddTab_GUITabControl:Int(tabc:Byte Ptr, caption:Byte Ptr, id:Int=-1)
	Function iGUITabControl_ActiveTab:Int(tabc:Byte Ptr)
	Function iGUITabControl_Tab:Int(tabc:Byte Ptr, idx:Int=-1)
	Function iGUITabControl_TabCount:Int(tabc:Byte Ptr)
	Function iGUITabControl_TabExtraWidth:Int(tabc:Byte Ptr)
	Function iGUITabControl_TabHeight:Int(tabc:Byte Ptr)
	Function iGUITabControl_TabVerticalAlignment:Int(tabc:Byte Ptr)
	Function iActiveTab_GUITabControl:Int(tabc:Byte Ptr, tab:Byte Ptr )
	Function iActiveTabId_GUITabControl:Int(tabc:Byte Ptr, idx:Int=0 )
	Function iTabExtraWidth_GUITabControl(tabc:Byte Ptr,  extraWidth:Int  )
	Function iTabHeight_GUITabControl(tabc:Byte Ptr, height:Int )
	Function iTabVerticalAlignment_GUITabControl(tabc:Byte Ptr, align:Int )
	' tab functions
	Function iAddTabGUI(orx:Int,  ory:Int,  sx:Int,  sy:Int, parent:Byte Ptr=Null , id:Int=-1 )
	Function iBackgroundColor_GUITab( tab:Byte Ptr, color:Int=$ffffffff)
	Function iGUITab_BackgroundColor:Int(tab:Byte Ptr)
	Function iGUITab_Number:Int(tab:Byte Ptr)
	Function iGUITab_TextColor:Int(tab:Byte Ptr)
	Function iGUITab_isDrawingBackground:Int(tab:Byte Ptr)
	Function iDrawBackground_GUITab(tab:Byte Ptr, flag:Byte=True)
	Function iTextColor_GUITab(tab:Byte Ptr,  color:Int=$ffffffff)
	' Table
	Function iAddTableGUI:Int(orx:Int,  ory:Int,  sx:Int,  sy:Int, drawBackground:Byte=True, parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddColumn_GUITable(table:Byte Ptr, caption:Byte Ptr, columnIndex:Int=-1 )
	Function iAddRow_GUITable(table:Byte Ptr,  rowIndex:Int )
	Function iClear_GUITable(table:Byte Ptr)
	Function iClearRows_GUITable(table:Byte Ptr)
	Function iGUITable_ActiveColumn:Int(table:Byte Ptr)
	Function iGUITable_ActiveColumnOrdering:Int(table:Byte Ptr)
	Function iGUITable_CellData:Int(table:Byte Ptr,  rowIndex:Int,  columnIndex:Int)
	Function iGUITable_CellText:Int(table:Byte Ptr,  rowIndex:Int,  columnIndex:Int)
	Function iGUITable_ColumnCount:Int(table:Byte Ptr)
	Function iGUITable_DrawFlags:Int(table:Byte Ptr)
	Function iGUITable_RowCount:Int(table:Byte Ptr)
	Function iGUITable_Selected:Int(table:Byte Ptr)
	Function iGUITable_hasResizableColumns:Int(table:Byte Ptr)
	Function iOderRows_GUITable(table:Byte Ptr,  columnindex:Int=-1, Mode:Int=EGOM_NONE ) 
	Function iRemoveColumn_GUITable(table:Byte Ptr, columnindex:Int=-1)
	Function iRemoveRow_GUITable(table:Byte Ptr, columnindex:Int=-1)
	Function iActiveColumn_GUITable(table:Byte Ptr,  index:Int,  doOrder:Byte=False)
	Function iCellColor_GUITable(table:Byte Ptr, rowindex:Int, columnindex:Int, color:Int=$ffffffff)
	Function iCellData_GUITable(table:Byte Ptr, rowindex:Int, columnindex:Int, ddata:Int Ptr)
	Function iCellText_GUITable(table:Byte Ptr, rowindex:Int, columnindex:Int, text:Byte Ptr, color:Int=$ffffffff)
	Function iColumnOrdering_GUITable(table:Byte Ptr, columnindex:Int, Mode:Int=EGCO_NONE  ) 
	Function iColumnWidth_GUITable(table:Byte Ptr, columnindex:Int,  width:Int) 
	Function iDrawFlags_GUITable(table:Byte Ptr, flag:Int)
	Function iResizableColumns_GUITable(table:Byte Ptr, flag:Byte)
	Function iSwapRows_GUITable(table:Byte Ptr, rowindexA:Int, rowindexB:Int)
	' ToolBar
	Function iAddToolBarGUI:Int(parent:Byte Ptr=Null , id:Int=-1 )
	Function iAddButton_GUIToolBar(tb:Byte Ptr, text:Byte Ptr, tooltiptext:Byte Ptr, img:Byte Ptr=Null,pressedimg:Byte Ptr=Null,  isPushButton:Byte=False,  useAlphaChannel:Byte=False, id:Int=-1)
	' GUI Window
	Function iAddWindowGUI:Int(orx:Int,  ory:Int,  sx:Int,  sy:Int, text:Byte Ptr, modal:Byte=False, parent:Byte Ptr=Null , id:Int=-1 )
	Function iGUIWindow_CloseButton:Int( win:Byte Ptr )
	Function iGUIWindow_MaximizeButton:Int( win:Byte Ptr )
	Function iGUIWindow_MinimizeButton:Int( win:Byte Ptr )
	' GUI Environement, to be continued....
	Function iSetSkinGUI:Int( sType:Int )
	Function iClearGUI()
	Function iGUI_BuiltInFont:Int()
	Function iGUI_Focus:Int()
	Function iGUI_SpriteBank:Int(filename:Byte Ptr)
	Function iGUI_VideoDriver:Int()
	Function iFocus_GUI:Int( element:Byte Ptr )
	Function iGUI_HasFocus:Int( element:Byte Ptr )
	Function iLoad_GUI:Int( filename:Byte Ptr, parent:Byte Ptr=Null )
	Function iSave_GUI:Int( filename:Byte Ptr, start:Byte Ptr=Null  )
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- Event Input Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iGetKeyDown:Byte Ptr( keyCode:Int)
	Function iGetKeyUp:Byte Ptr( keyCode:Int)
	Function iGetMouseX:Int()
	Function iGetMouseY:Int()
	Function iGetDeltaMouseX:Int()
	Function iGetDeltaMouseY:Int()
	Function iGetMouseEvent:Byte Ptr(event:Int)
	Function iGetLastKey:Byte Ptr()
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'-CORE Utils Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iCreateArray:Byte Ptr() ' return IArray
	Function iPushbackArray( array:Byte Ptr,  el:Int Ptr) 
	Function iPushfrontArray( array:Byte Ptr,  el:Int Ptr) 
	Function iArrayElement:Int( array:Byte Ptr,  i:Int)
	Function iArraySize:Int( array:Byte Ptr )  
	Function iFreeArray( array:Byte Ptr) 
	Function iProjectionMatrixOrthoLH(w:Float,  h:Float, projection:Byte Ptr, zNear:Float=0.1,  zFar:Float=100.0)
	Function iProjectionMatrixOrthoRH(w:Float,  h:Float, projection:Byte Ptr, zNear:Float=0.1,  zFar:Float=100.0)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- SHADER Functions v1.0
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	Function iVersionShader(VSType:Int=EVST_VS_1_1, PSType:Int=EPST_PS_1_1)
	Function iCreateShaderHighLevel:Int(vsFileName:Byte Ptr, EntryNameVS:Byte Ptr, psFileName:Byte Ptr, EntryNamePS:Byte Ptr, videottype:Int, constantshaderFnt:Int Ptr, materialshaderFnt:Int Ptr )
	Function iCreateShader:Int(vsFileName:Byte Ptr, psFileName:Byte Ptr, videottype:Int, constantshaderFnt:Int Ptr, materialshaderFnt:Int Ptr)
	
	Function iBasicRenderStatesMaterialServices(services:Byte Ptr, material:Byte Ptr, lastMaterial:Byte Ptr,   resetAllRenderstates:Byte  )
	Function iPixelShaderConstantMaterialServices(services:Byte Ptr, fData:Float Ptr,  startRegister:Int,   constantAmount:Int=1  )
	Function iPixelShaderConstantNMaterialServices(services:Byte Ptr,	name:Byte Ptr,  fFloat:Float Ptr,   count:Int)
	Function iVertexShaderConstantMaterialServices(services:Byte Ptr,	fData:Float Ptr,  startRegister:Int,   constantAmount:Int=1  )
	Function iVertexShaderConstantNMaterialServices(services:Byte Ptr, name:Byte Ptr,  fFloat:Float Ptr,   count:Int)
	
	
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	'- PHYSIC 
	' ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
	
	Function iFreePhysic()
	Function iInitPhysic()
	Function iUpdatePhysic(timer:Float=60.0)
	Function iSetWorldSize(minx:Float, miny:Float, minz:Float, maxx:Float, maxy:Float, maxz:Float)
	Function iGravityForce(x:Float, y:Float, z:Float)
	Function iSetCollideForm(form:Int=1)
	Function iTimerUpdatePhysic(timer:Float = 60.0)
	' rigid body
	Function iCreateBody:Int(ent:Byte Ptr, dynamique:Byte=True, vx:Float=0, vy:Float=0, vz:Float=0, mass:Float=1.0)
	Function iCreateTerrainBody:Int(terrain:Byte Ptr)
	Function iBodyRestoreCallbacks(ebody:Byte Ptr) 
	Function iFreeBody(ebody:Byte Ptr)
	'iCoriolisForcesModeBody(ebody:Byte Ptr, value:Byte) 
	Function iMatrixBody(ebody:Byte Ptr, mat:Float Ptr)
	Function iMomentOfInertiaBody(ebody:Byte Ptr, x:Float, y:Float, z:Float) 
	'iAutoFreezeBody(ebody:Byte Ptr,  value:Byte)
	Function iMassCenterBody(ebody:Byte Ptr, x:Float, y:Float, z:Float)
	Function iBodyCentreOfMass(ebody:Byte Ptr, mass_center:Float Ptr) 
	Function iMassBody(ebody:Byte Ptr,  mass:Float)
	Function iLinearDampingBody(ebody:Byte Ptr, value:Float)
	Function iBodyMomentOfInertia(ebody:Byte Ptr, res:Float Ptr) 
	'iFreezeBody(ebody:Byte Ptr,  value:Byte)
	Function iBodyMass:Float(ebody:Byte Ptr)
	Function iAddForceBody(ebody:Byte Ptr, x:Float, y:Float, z:Float)
	Function iForceBody(ebody:Byte Ptr, x:Float, y:Float, z:Float)
	Function iAddDirectForceBody(body:Int Ptr, x:Float, y:Float, z:Float)
	Function iDirectForceBody(body:Int Ptr, x:Float, y:Float, z:Float)
	Function iAddForceContinuousBody(ebody:Byte Ptr, x:Float, y:Float, z:Float) 
	Function iAddTorqueBody(ebody:Byte Ptr, x:Float, y:Float, z:Float)
	Function iTorqueBody(ebody:Byte Ptr, x:Float, y:Float, z:Float)
	Function iOmegaBody(ebody:Byte Ptr, x:Float, y:Float, z:Float) 
	Function iVelocityBody(ebody:Byte Ptr, x:Float, y:Float, z:Float) 
	Function iCalculateMomentOfInertiaBody(ebody:Byte Ptr) 
	Function iPositionBody(ebody:Byte Ptr, posx:Float, posy:Float, posz:Float) 
	Function iBodyX:Float(ebody:Byte Ptr) 
	Function iBodyY:Float(ebody:Byte Ptr) 
	Function iBodyZ:Float(ebody:Byte Ptr) 
	Function iTranslateBody(ebody:Byte Ptr, posx:Float, posy:Float, posz:Float) 
	Function iRotateBody(ebody:Byte Ptr, rotx:Float, roty:Float, rotz:Float) 
	Function iBodyOmega(ebody:Byte Ptr, omega:Float Ptr) 
	Function iAngularDampingBody(ebody:Byte Ptr, x:Float, y:Float, z:Float)
	Function iBodyVelocity(ebody:Byte Ptr, velocity:Float Ptr) 
	Function iContinuousCollisionModeBody(ebody:Byte Ptr,  value:Byte) 
	Function iBodyContinuousCollisionMode:Int(ebody:Byte Ptr) 
	Function iBodyPosition(ebody:Byte Ptr, pos:Float Ptr) 
	Function iBodyRotation(ebody:Byte Ptr, rot:Float Ptr) 
	Function iPulseBody(ebody:Byte Ptr, delta_velocityx:Float, delta_velocityy:Float, delta_velocityz:Float, impulse_centerx:Float=0,  impulse_centery:Float=0,  impulse_centerz:Float=0)
	'iFreezeTresholdBody(ebody:Byte Ptr,  freezeSpeedMag2:Float,	 freezeOmegaMag2:Float,	 framesCount:Int)
	'iBodyFreezeTreshold(ebody:Byte Ptr,	*freezeSpeedMag2:Float,	*freezeOmegaMag2:Float) 
	Function iCollisionBody(ebody:Byte Ptr, newCollision:Int Ptr) 
	Function iBodyNode:Int(ebody:Byte Ptr)
	Function iApplyForceAndTorqueBody(ebody:Byte Ptr, callback:Int Ptr)
	Function iBodyIBodySceneNode:Int(body:Int Ptr)
	Function iBodyCollideBody:Int(ebody:Byte Ptr)
	Function iBodyNumCollideBody:Int(ebody:Byte Ptr)
	Function iCalculateAABBBody(ebody:Byte Ptr, box:Byte Ptr) 
	' collision instruction
	Function iCollideNodeType(ent:Byte Ptr,  cType:Int,  vx:Float=0, vy:Float=0, vz:Float=0)
	Function iCollideTerrainType(terrain:Byte Ptr, cType:Int)
	Function iNodeCollide:Int(entA:Byte Ptr, entB:Byte Ptr)
	Function iNodeCollideAll:Int(ent:Byte Ptr)
	Function iCollidePointDistance:Int(ent:Byte Ptr, x:Float, y:Float, z:Float)
	Function iCollideRayCast:Float(ent:Byte Ptr, x:Float, y:Float, z:Float, dx:Float, dy:Float, dz:Float, cType:Int=1)
	Function iCollideRayCastAll:Int( x:Float, y:Float, z:Float, dx:Float, dy:Float, dz:Float, cType:Int, dist:Float Ptr)
	Function iCollidePoint(tri:Float Ptr,  index:Int)
	Function iCollideNormal(tri:Float Ptr,  index:Int)
	Function iCollideNode:Int(index:Int=0)
	' material
	Function iCreatePhysicMaterial:Int()
	Function iCreatePhysicMaterialPair:Int( mat1:Int,  mat2:Int)
	Function iElasticityPhysicMaterial(matPair:Byte Ptr , val:Float)
(...)



Gabriel(Posted 2009) [#6]
I usually do something like


Type TWrapperObject
   Field WrapperHandle:Byte Ptr
End Type


Type TLight Extends TWrapperObject
   Method SetPosition(X:Float,Y:Float,Z:Float)
      TLight_SetPosition(Self.WrapperHandle,X,Y,Z)
   End Method
End Type



Brucey(Posted 2009) [#7]
Does using Self.xxx generate more code (asm) than without?
(Yes, I know... I should try it out for myself... but it's Sunday night and I'm tired :-p )


Brucey(Posted 2009) [#8]
In Blitzmax I have successfully converted all of those pointers to structures to Byte Ptr

Your users don't want to know anything about Byte Ptrs if you can help it.
Something similar to what Gabriel mentions is one way to hide the details.

If a function also takes a pointer to another "object", you should wrap those too.
Of course, it involves a lot more work than simply creating a list of functions, like you have done. But it's better for the end-user :-)


plash(Posted 2009) [#9]
Does using Self.xxx generate more code (asm) than without?
No it does not.




byo(Posted 2009) [#10]
Thank you, Gabriel and Brucey.

That's very helpful. Although I think that if I do like Gabriel posted I'll have to rewrite the n3xt-d commands as OOP and the engine functions are not OOP. They just take a pointer to an object in the first parameter:

iImageBlueMask.l( *img.IImage)
iImageGreenMask.l( *img.IImage)
iImageRedMask.l( *img.IImage)


Do you guys think it would be better using a type thus converting it to OOP like:

Local img:IImage

DebugLog img.BlueMask()
DebugLog img.GreenMask()
DebugLog img.RedMask()


The problem I have with this approach is that everytime the original code changes the maintenance would be more difficult. But it could be done. :)

What do you guys think?


Brucey(Posted 2009) [#11]
Do you guys think it would be better using a type thus converting it to OOP

Well, it's a personal preference. For me, yes. (All my modules are done this way).

But a lot of people still like a flat, procedural style interface, for whatever reason.


byo(Posted 2009) [#12]
Indeed. That's what I'm concerned.
But maybe having both options are the way to go since the procedural functions are inevitable because they will be imported and will appear in the autocomplete list.


Ian Thompson(Posted 2009) [#13]
I converted the Ninfa3D headers using a flat non-oop design, once in this form its pretty easy to create your own derived oop header in a style that each user will be comfortable with. OOP can be very subjective in this way IMHO. Don't get me wrong, if the original headers are OOP then sticking as close to the original design, keeping it oop, is nearly always a good idea.


Szafirek(Posted 2009) [#14]
When can we expect the finished wrapper?


byo(Posted 2009) [#15]
The problem is I have two jobs right now and one of them is getting too demanding these last weeks. Maybe someone can work on this... because as far as I want it finished I don't think it will be soon. I'm sleeping 5 hours a day. :/


Szafirek(Posted 2009) [#16]
Waiting patiently:)


Szafirek(Posted 2009) [#17]
Are there any progress?