#ifndef CAMERAH
#define CAMERAH
 
 
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
 
#include "util.h"
 
typedef struct GLI_tdstCamera_
{
  long lSizeOfThis;
  long lTypeOfThis;
  long lCameraMode;
  POS_tdstCompletePosition stMatrix;
  MTH_tdxReal xAlphaX;
  MTH_tdxReal xAlphaY;
  GLI_tdxValue xNear;
  GLI_tdxValue xFar;
  GLI_tdxValue xScreen;
  GLI_tdst2DVertex stScale;
  GLI_tdst2DVertex stTrans;
  long lVptInitialHeight;
  long lVptInitialWidth;
  MTH3D_tdstVector stNormPlaneLeft;
  MTH_tdxReal xDistPlaneLeft;
  MTH3D_tdstVector stNormPlaneRight;
  MTH_tdxReal xDistPlaneRight;
  MTH3D_tdstVector stNormPlaneUp;
  MTH_tdxReal xDistPlaneUp;
  MTH3D_tdstVector stNormPlaneDown;
  MTH_tdxReal xDistPlaneDown;
  MTH_tdxReal xRatio ;
}
GLI_tdstCamera ;
 
 
/* For DLL using these function :*/
#include "cpa_expt.h" 
 
#define GLI_C_lIsoCamWithDistorsion     100
#define GLI_C_lIsoCamWithoutDistorsion  101
#define GLI_C_lPersCamWithDistorsion    102
#define GLI_C_lPersCamWithoutDistorsion 103
 
#define GLI_C_xZClippingNear GLI_M_FloatToValue ( 0.25f )
 
 
 
extern CPA_EXPORT void 
GLI_xCreateCamera ( struct GLI_tdstCamera_ **h_stCam ,
                    long lCameraMode ) ;
 
extern CPA_EXPORT void 
GLI_xSetCameraNearFar ( struct GLI_tdstCamera_ *p_stCam ,
                        MTH_tdxReal xNear ,
                        MTH_tdxReal xFar );
extern CPA_EXPORT void 
GLI_xGetCameraNearFar ( struct GLI_tdstCamera_ *p_stCam ,
                        GLI_tdxValue *p_xNear ,
                        GLI_tdxValue *p_xFar );
                       
extern CPA_EXPORT void 
GLI_xGetCameraMatrix ( struct GLI_tdstCamera_ *p_stCam ,
                       struct POS_stCompletePosition *p_stMatrix ) ;
 
extern CPA_EXPORT void 
GLI_xSetCameraMatrix ( struct GLI_tdstCamera_ *p_stCam ,
                       struct POS_stCompletePosition *p_stMatrix ) ;
 
extern CPA_EXPORT void 
GLI_xSetViewportCamera ( GLD_tdhDevice, GLD_tdhViewport,
                         struct GLI_tdstCamera_ * ) ;
 
extern CPA_EXPORT void 
GLI_xGetViewportCamera ( GLD_tdhDevice hDevice,
                         GLD_tdhViewport hViewport,
                         struct GLI_tdstCamera_ **p_stCam );
 
extern CPA_EXPORT void 
GLI_xSetCameraAspectAndRatio ( struct GLI_tdstCamera_ *p_stCam ,
                               MTH_tdxReal xAlphaX ,
                               MTH_tdxReal xRatio ) ;
 
extern CPA_EXPORT void 
GLI_xGetCameraAspectAndRatio ( struct GLI_tdstCamera_ *p_stCam ,
                               MTH_tdxReal *p_xAlphaX ,
                               MTH_tdxReal *p_xRatio ) ;
extern CPA_EXPORT void 
GLI_xSetCameraRatio ( struct GLI_tdstCamera_ *p_stCam ,
                      MTH_tdxReal xRatio ) ;
 
extern CPA_EXPORT void 
GLI_xGetCameraRatio ( struct GLI_tdstCamera_ *p_stCam ,
                      MTH_tdxReal *p_xRatio ) ;
 
extern CPA_EXPORT void
GLI_xGetCameraMode ( struct GLI_tdstCamera_ *p_stCam , long *p_lMode);
 
extern CPA_EXPORT void
GLI_xSetCameraMode ( struct GLI_tdstCamera_ *p_stCam , long lMode);
 
extern CPA_EXPORT void 
GLI_xAdjustCameraToViewport ( GLD_tdhDevice hDevice,
                              GLD_tdhViewport hViewport,
                              struct GLI_tdstCamera_ *p_stCam ) ;
extern CPA_EXPORT void 
GLI_xAdjustCameraToViewport2 ( GLD_tdstDeviceAttributes *p_stDev, 
                               GLD_tdstViewportAttributes *p_stVpt, 
                               GLI_tdstCamera *p_stCam ) ;
extern CPA_EXPORT void 
GLI_vCopyCamera ( struct GLI_tdstCamera_ *p_stCamDest ,struct GLI_tdstCamera_ *p_stCamSource );
 
extern CPA_EXPORT struct GLI_tdstCamera_ *
GLI_xDuplicateCamera ( struct GLI_tdstCamera_ *p_stCamSource );
 
extern CPA_EXPORT void   GLI_xGetCameraTransXY(struct GLI_tdstCamera_ *p_stCam , MTH_tdxReal *p_xX , MTH_tdxReal *p_xY);
extern CPA_EXPORT void   GLI_xSetCameraTransXY(struct GLI_tdstCamera_ *p_stCam , MTH_tdxReal *p_xX , MTH_tdxReal *p_xY);
extern CPA_EXPORT void   GLI_xMulCameraScale(struct GLI_tdstCamera_ *p_stCam , MTH_tdxReal xCoef);
extern CPA_EXPORT MTH_tdxReal GLI_xGetCameraFocalizationPoint(struct GLI_tdstCamera_ *p_stCam , MTH_tdxReal xDistanceZ);
extern CPA_EXPORT MTH_tdxReal GLI_xGetCameraFocalizationPlane(struct GLI_tdstCamera_ *p_stCam );
 
/*ANNECY JMD 24/02/98{*/
extern CPA_EXPORT void GLI_vGet3DVertexFromScreenPos ( GLD_tdstViewportAttributes *p_stVpt,MTH3D_tdstVector *p_stVertex,MTH_tdxReal xX, MTH_tdxReal xY, MTH_tdxReal xSize ) ;
/*ENDANNECY JMD }*/
 
#ifdef __cplusplus
};
#endif /* __cplusplus */
 
#endif
