/* Include this file in your C/C++ source file if you intend to use GDI3D DLL Copyright: Pasi Paavola 1993 */ #ifndef __GDI3D__ #define __GDI3D__ #ifndef _INC_WINDOWS #include #endif #define G3CLASSNAME "g3wnd" #ifdef __cplusplus extern "C" { #endif #ifdef __DLL__ extern HINSTANCE DLL_G_hInstance; #define WINAPI_LIB WINAPI _export #else /* ei DLL */ #define WINAPI_LIB WINAPI #endif /* Data types */ typedef struct tagG3POINT { double x, y, z; } G3POINT; typedef G3POINT FAR * NPG3POINT; typedef G3POINT FAR * LPG3POINT; typedef G3POINT G3VECTOR; typedef G3VECTOR NEAR * NPG3VECTOR; typedef G3VECTOR FAR * LPG3VECTOR; typedef struct tagG3BOX { /* A box with all edges parallel with some axis */ double x1, x2; /* boundaries in x direction */ double y1, y2; /* boundaries in y direction */ double z1, z2; /* boundaries in x direction */ } G3BOX; typedef G3BOX NEAR * NPG3BOX; typedef G3BOX FAR * LPG3BOX; typedef struct tagG3TRMAT { /* Transformation matrix, always applied from left */ double M11, M12, M13, M14; /* First row */ double M21, M22, M23, M24; /* Second row */ double M31, M32, M33, M34; /* Third row */ } G3TRMAT; typedef G3TRMAT NEAR * NPG3TRMAT; typedef G3TRMAT FAR * LPG3TRMAT; typedef double (CALLBACK * LPFNWIRES) (double x, double y); /* Functions */ int WINAPI_LIB G3GetVersion(); int WINAPI_LIB G3GetLastError(HWND hWnd); HDC WINAPI_LIB G3GetDC(HWND hWnd); HANDLE WINAPI_LIB G3ReleaseDC(HWND hWnd, HDC hDC); DWORD WINAPI_LIB G3MoveTo(LPG3POINT lpG3Point); BOOL WINAPI_LIB G3LineTo(LPG3POINT lpG3Point); VOID WINAPI_LIB G3Box(double x1, double x2, double y1, double y2, double z1, double z2); int WINAPI_LIB G3SetViewpoint(LPG3POINT pPt); VOID WINAPI_LIB G3GetViewpoint(LPG3POINT pPt); int WINAPI_LIB G3G3ToViewport(LPG3POINT lpG3Points, LPPOINT lpVPPoints, int nPoints); int WINAPI_LIB G3Histogram(double FAR *lpdHeights, COLORREF FAR * lpColors, int nItems, int nCategories, double dBarWidth, double dBarDepth, double dDist); int WINAPI_LIB G3WireSurface(LPFNWIRES lpfnF, double dMinX, double dMaxX, double dMinY, double dMaxY, int nXDivs, int nYDivs); int WINAPI_LIB G3SetViewport(int iCenterX, int iCenterY, int iHalfWidth, int iHalfHeight); int WINAPI_LIB G3SetPicturePlaneParams(double dDist, double dHalfWidth, double dHalfHeight); VOID WINAPI_LIB G3GetPicturePlaneParams(double FAR * LPdDist, double FAR * LPdHalfWidth, double FAR * LPdHalfHeight); int WINAPI_LIB G3Polygon(LPG3POINT lpG3Points, int nPoints); VOID WINAPI_LIB G3RemoveTransformations(void); VOID WINAPI_LIB G3SetTranslation(double x, double y, double z); VOID WINAPI_LIB G3SetScale(double Scx, double Scy, double Scz); LPG3VECTOR WINAPI_LIB G3Normalize(LPG3VECTOR lpG3Vector); double WINAPI_LIB G3VectorLength(LPG3VECTOR lpG3Vector); VOID WINAPI_LIB G3SetRotate(LPG3VECTOR lpRotAxis, double theta); int WINAPI_LIB Init3DWndClass(HINSTANCE hInst); /* Error constants */ #define G3ERR_ERROR -1 #define G3ERR_INVHANDLE -3 #define G3ERR_INVPOINT -4 #define G3ERR_GETDC -5 #define G3ERR_MEM -6 #define G3ERR_INVPAR -7 #define G3ERR_POLYGON -8 #define G3ERR_RELDC -9 #define G3ERR_CREATEMETA -10 #define G3ERR_CLOSEMETA -11 /* Special G3 window styles */ #define GS_METAFILE 0x00000001L /* Macros */ #define _PI (3.1415926535897932384626433832795028841971693993751) #define G3DEG2RAD(x) ((_PI/180.0) * (x)) #ifdef __cplusplus } #endif #endif // __GDI3D__