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.

101 lines
2.3 KiB

  1. /**********************************Module**********************************\
  2. *
  3. * ssflwbox.h
  4. *
  5. * 3D FlowerBox screen saver
  6. * Base header file
  7. *
  8. * History:
  9. * Wed Jul 19 14:50:27 1995 -by- Drew Bliss [drewb]
  10. * Created
  11. *
  12. * Copyright (c) 1995 Microsoft Corporation
  13. *
  14. \**************************************************************************/
  15. #ifndef __SSFLWBOX_H__
  16. #define __SSFLWBOX_H__
  17. #ifndef PI
  18. #define PI 3.14159265358979323846
  19. #endif
  20. // Minimum and maximum number of side subdivisions
  21. #define MINSUBDIV 2
  22. #define MAXSUBDIV 10
  23. // Maximum values allowed
  24. #define MAXSIDES 8
  25. #define MAXSPTS ((MAXSUBDIV+1)*(MAXSUBDIV+1))
  26. #define MAXPTS (MAXSIDES*MAXSPTS)
  27. #define MAXSFACES (MAXSUBDIV*MAXSUBDIV)
  28. #define MAXFACES (MAXSIDES*MAXSFACES)
  29. #define MAXFPTS 4
  30. // Number of colors used in checkerboarding
  31. #define NCCOLS 2
  32. // Allow floating point type configurability
  33. typedef GLfloat FLT;
  34. typedef struct
  35. {
  36. FLT x, y, z;
  37. } PT3;
  38. // Configurable options
  39. typedef struct _CONFIG
  40. {
  41. BOOL smooth_colors;
  42. BOOL triangle_colors;
  43. BOOL cycle_colors;
  44. BOOL spin;
  45. BOOL bloom;
  46. int subdiv;
  47. int color_pick;
  48. int image_size;
  49. int geom;
  50. int two_sided;
  51. } CONFIG;
  52. extern CONFIG config;
  53. extern GLfloat checker_cols[MAXSIDES][NCCOLS][4];
  54. extern GLfloat side_cols[MAXSIDES][4];
  55. extern GLfloat solid_cols[4];
  56. #if defined(assert)
  57. #undef assert
  58. #endif
  59. #if DBG
  60. #define dprintf(args) dprintf_out args
  61. void dprintf_out(char *fmt, ...);
  62. #define assert(e) if (!(e)) assert_failed(__FILE__, __LINE__, #e); else 0
  63. void assert_failed(char *file, int line, char *msg);
  64. #else
  65. #define dprintf(args)
  66. #define assert(e)
  67. #endif
  68. #define DIMA(a) (sizeof(a)/sizeof(a[0]))
  69. /******************************Public*Routine******************************\
  70. *
  71. * Basic vector math macros
  72. *
  73. * History:
  74. * Wed Jul 19 14:49:49 1995 -by- Drew Bliss [drewb]
  75. * Created
  76. *
  77. \**************************************************************************/
  78. #define V3Sub(a, b, r) \
  79. ((r)->x = (a)->x-(b)->x, (r)->y = (a)->y-(b)->y, (r)->z = (a)->z-(b)->z)
  80. #define V3Add(a, b, r) \
  81. ((r)->x = (a)->x+(b)->x, (r)->y = (a)->y+(b)->y, (r)->z = (a)->z+(b)->z)
  82. #define V3Cross(a, b, r) \
  83. ((r)->x = (a)->y*(b)->z-(b)->y*(a)->z,\
  84. (r)->y = (a)->z*(b)->x-(b)->z*(a)->x,\
  85. (r)->z = (a)->x*(b)->y-(b)->x*(a)->y)
  86. extern FLT V3Len(PT3 *v);
  87. #endif // __SSFLWBOX_H__