type CPrimitive = Pointer<'PRIMITIVE'>;
type CCamera = Pointer<'CAMERA'>;
type CShader = Pointer<'SHADER'>;
type CTexture = Pointer<'TEXTURE'>;

////////////////////////////////////////////////////////////////////////////////

declare function primitiveCreate():CPrimitive;

declare function primitiveInit(
  primitive:CPrimitive, verticeCount:number, indiceCount:number
):void;

declare function primitiveDraw(
  primitive:CPrimitive, start:number, count:number
):void;

declare function primitiveDispose(primitive:CPrimitive):void;

declare function quadInit(primitive:CPrimitive, z:number,
  x0:number, y0:number, u0:number, v0:number,
  x1:number, y1:number, u1:number, v1:number
):void;

////////////////////////////////////////////////////////////////////////////////

declare function cameraCreate():CCamera;

declare function cameraLookAt(camera:CCamera,
  x:number, y:number, z:number,
  lookX:number, lookY:number, lookZ:number
):void;

declare function cameraLook(camera:CCamera,
  x:number, y:number, z:number,
  pitch:number, yaw:number, roll:number
):void;

declare function cameraPerspective(camera:CCamera,
  fov:number, aspect:number, near:number, far:number
):void;

declare function cameraOrtho(camera:CCamera,
  left:number, right:number, bottom:number, top:number, near:number, far:number
):void;

declare function cameraDispose(camera:CCamera):void;

////////////////////////////////////////////////////////////////////////////////

declare function shaderCreate():CShader;

declare function shaderInit(shader:CShader, vert:string, frag:string):void;

declare function shaderDispose(shader:CShader):void;

declare function shaderUse(shader:CShader):void;

declare function shaderUseTexture(shader:CShader, texture:CTexture):void;

declare function shaderUseCamera(shader:CShader, camera:CCamera):void;

declare function shaderUsePosition(shader:CShader,
  x:number, y:number, z:number,
  pitch:number, yaw:number, roll:number
):void;

declare function shaderUsePositionAndScale(shader:CShader,
  x:number, y:number, z:number,
  pitch:number, yaw:number, roll:number,
  sx:number, sy:number, sz:number
):void;

////////////////////////////////////////////////////////////////////////////////

declare function textureCreate():CTexture;

declare function textureDispose(texture:CTexture):void;