Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
3.5 KiB

  1. #define WFO_FAILURE FALSE
  2. #define WFO_SUCCESS TRUE
  3. #define PI 3.141592653589793
  4. #define TWO_PI 2.0*PI
  5. #define ZERO_EPS 0.00000001
  6. //#define VARRAY 1
  7. static const double CoplanarThresholdAngle = PI/180.0/2.0; // 0.5 degreees
  8. // outline prim types
  9. #define PRIM_LINE 3
  10. #define PRIM_CURVE 4
  11. typedef struct {
  12. FLOAT x,y;
  13. } POINT2D;
  14. typedef struct {
  15. FLOAT x,y,z;
  16. } POINT3D;
  17. typedef struct {
  18. DWORD primType;
  19. DWORD nVerts;
  20. DWORD VertIndex;// index into Loop's VertBuf
  21. POINT2D *pVert; // ptr to vertex list in Loop's VertBuf
  22. POINT3D *pFNorm; // face normals
  23. POINT3D *pVNorm; // vertex normals
  24. } PRIM;
  25. typedef struct {
  26. PRIM *PrimBuf; // array of prims
  27. DWORD nPrims;
  28. DWORD PrimBufSize;
  29. POINT2D *VertBuf; // buffer of vertices for the loop
  30. DWORD nVerts;
  31. DWORD VertBufSize;
  32. POINT3D *FNormBuf; // buffer of face normals
  33. POINT3D *VNormBuf; // buffer of vertex normals
  34. } LOOP;
  35. typedef struct {
  36. LOOP *LoopBuf; // array of loops
  37. DWORD nLoops;
  38. DWORD LoopBufSize;
  39. } LOOP_LIST;
  40. typedef struct {
  41. FLOAT zExtrusion;
  42. INT extrType;
  43. FLOAT* FaceBuf;
  44. DWORD FaceBufSize;
  45. DWORD FaceBufIndex;
  46. DWORD FaceVertexCountIndex;
  47. #ifdef VARRAY
  48. FLOAT* vaBuf;
  49. DWORD vaBufSize;
  50. #endif
  51. #ifdef FONT_DEBUG
  52. BOOL bSidePolys;
  53. BOOL bFacePolys;
  54. #endif
  55. GLenum TessErrorOccurred;
  56. } EXTRContext;
  57. // Memory pool for tesselation Combine callback
  58. #define POOL_SIZE 50
  59. typedef struct MEM_POOL MEM_POOL;
  60. struct MEM_POOL {
  61. int index; // next free space in pool
  62. POINT2D pool[POOL_SIZE]; // memory pool
  63. MEM_POOL *next; // next pool
  64. };
  65. typedef struct {
  66. GLenum TessErrorOccurred;
  67. FLOAT chordalDeviation;
  68. FLOAT scale;
  69. int format;
  70. UCHAR* glyphBuf;
  71. DWORD glyphSize;
  72. HFONT hfontOld;
  73. GLUtesselator* tess;
  74. MEM_POOL combinePool; // start of MEM_POOL chain
  75. MEM_POOL *curCombinePool; // currently active MEM_POOL
  76. EXTRContext *ec;
  77. } OFContext; // Outline Font Context
  78. extern EXTRContext* extr_Init( FLOAT extrusion,
  79. INT format );
  80. extern void extr_Finish( EXTRContext *ec );
  81. extern void extr_DrawLines( EXTRContext *ec,
  82. LOOP_LIST *pLoopList );
  83. extern BOOL extr_DrawPolygons( EXTRContext *ec,
  84. LOOP_LIST *pLoopList );
  85. #ifdef VARRAY
  86. extern void DrawFacePolygons( EXTRContext *ec,
  87. FLOAT z );
  88. #endif
  89. extern BOOL extr_PolyInit( EXTRContext *ec );
  90. extern void extr_PolyFinish( EXTRContext *ec );
  91. extern void CALLBACK extr_glBegin( GLenum primType,
  92. void *data );
  93. extern void CALLBACK extr_glVertex( GLfloat *v,
  94. void *data );
  95. extern void CALLBACK extr_glEnd( void );
  96. extern double CalcAngle( POINT2D *v1,
  97. POINT2D *v2 );