Leaked source code of windows server 2003
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.

66 lines
2.5 KiB

  1. //-----------------------------------------------------------------------------
  2. // File: eval.h
  3. //
  4. // Desc: EVAL class
  5. // Evaluator composed of one or more sections that are evaluated
  6. // separately with OpenGL evaluators
  7. //
  8. // Copyright (c) 1994-2000 Microsoft Corporation
  9. //-----------------------------------------------------------------------------
  10. #ifndef __EVAL_H__
  11. #define __EVAL_H__
  12. #define MAX_UORDER 5 // this is per section
  13. #define MAX_VORDER 5
  14. #define MAX_USECTIONS 4
  15. #define MAX_XC_PTS (MAX_UORDER * MAX_USECTIONS)
  16. #define TEX_ORDER 2
  17. #define EVAL_ARC_ORDER 4
  18. #define EVAL_CYLINDER_ORDER 2
  19. #define EVAL_ELBOW_ORDER 4
  20. // # of components (eg. arcs) to form a complete cross-section
  21. #define EVAL_XC_CIRC_SECTION_COUNT 4
  22. #define EVAL_XC_POINT_COUNT ( (EVAL_ARC_ORDER-1)*4 + 1 )
  23. #define EVAL_CIRC_ARC_CONTROL 0.56f // for r=1
  24. //-----------------------------------------------------------------------------
  25. // Name:
  26. // Desc:
  27. //-----------------------------------------------------------------------------
  28. class EVAL
  29. {
  30. public:
  31. int m_numSections; // number of cross-sectional sections
  32. int m_uOrder, m_vOrder;
  33. // assumed: all sections same order - uOrder is per
  34. // section; sections share vertex and texture control points
  35. int m_uDiv, m_vDiv; // figured out one level up ?
  36. D3DXVECTOR3* m_pts; // vertex control points
  37. // - texture always order 2 for s and t (linear mapping)
  38. BOOL m_bTexture;
  39. TEX_POINT2D* m_texPts; // texture control points
  40. EVAL( BOOL bTexture );
  41. ~EVAL();
  42. void Evaluate(); // evaluate/render the object
  43. void SetVertexCtrlPtsXCTranslate( D3DXVECTOR3 *pts, float length,
  44. XC *xcStart, XC *xcEnd );
  45. void SetTextureControlPoints( float s_start, float s_end,
  46. float t_start, float t_end );
  47. void ProcessXCPrimLinear( XC *xcStart, XC *xcEnd, float length );
  48. void ProcessXCPrimBendSimple( XC *xcCur, int dir, float radius );
  49. void ProcessXCPrimSingularity( XC *xcCur, float length,
  50. BOOL bOpening );
  51. };
  52. extern void ResetEvaluator( BOOL bTexture );
  53. #endif // __EVAL_H__