unit uGlobal;

interface

uses VectorTypes;

type
  TFogMode = (fmLinear, fmExp, fmExp2);
  TAntiAliasing = (aaDefault, aaNone, aa2x, aa2xHQ, aa4x, aa4xHQ);
  TGLObjectType = (otRoot, otSprite, otHUDSprite, otPoints, otLines, otPlane, otCube, otSphere, otDisk, otCone, otCylinder, otModel, otTerrain, otSkyDome, otLensFlare);
  TMaterialFace = (mfFront, mfBack);
  TMaterialColor = (mcAmbient, mcDiffuse, mcEmission, mcSpecular);
  TPolygonMode = (pmFill, pmLines, pmPoints);
  TGUIType = ( gtForm, gtPanel, gtLabel, gtButton, gtCheckBox, gtEdit, gtScrollbar );
  TGUIEvent = (caOnClick, caOnChange, caOnMouseMove, caOnMouseEnter, caOnMouseLeave, caOnMouseUp, caOnMouseDown, caOnKeyDown, caOnKeyUp, caOnKeyPress);
  TPointStyle = (psSquare, psRound, psSmooth, psSmoothAdditive, psSquareAdditive);
  TBlendingMode = (bmOpaque, bmTransparency, bmAdditive, bmAlphaTest50, bmAlphaTest100, bmModulate);
  TTextureMode = (tmDecal, tmModulate, tmBlend, tmReplace);
	TTextureWrap = (twBoth, twNone, twVertical, twHorizontal);
  TTextureAlpha = (tiaDefault, tiaAlphaFromIntensity,
                           tiaSuperBlackTransparent, tiaLuminance,
                           tiaLuminanceSqrt, tiaOpaque,
                           tiaTopLeftPointColorTransparent,
                           tiaInverseLuminance, tiaInverseLuminanceSqrt,
                           tiaBottomRightPointColorTransparent);
  TTextureCompression = (tcDefault, tcNone, tcStandard, tcHighQuality, tcHighSpeed);
  TShaderType = (stCelShader, stGLSLShader);

  TDoubleArray = array of double;

  TTerrainStyle = (tsFullGeometry, tsTesselated);

  TMouseButton = (mbLeft, mbRight, mbMiddle);
  
var
  PluginLoad: function(FileName: string): boolean; stdcall;
  PluginLoaded: function(FileName: string): boolean; stdcall;
  Call: function(Func: string; Params: array of variant): variant; stdcall;
  //WndSize: array[0..1] of integer = (1024, 768);
  function WndSize: TVector2i;
  function floattostr(I: Double): string;
  function inttostr(I: Integer): string;

implementation

function WndSize: TVector2i;
var
  P: array of double;
begin
  P:=call('glWndSize', []);
  Result[0]:=round(P[0]);
  Result[1]:=round(P[1]);
end;

function floattostr(I: Double): string;
begin
  str(i, Result);
end;

function inttostr(I: Integer): string;
begin
  str(i, Result);
end;


end.
