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.

72 lines
1.5 KiB

  1. /**********************************Module**********************************\
  2. *
  3. * geom.h
  4. *
  5. * 3D FlowerBox screen saver
  6. * Geometry 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 __GEOM_H__
  16. #define __GEOM_H__
  17. // Geometry of a shape
  18. // A side of a shape
  19. typedef struct _SIDE
  20. {
  21. // Number of triangle strips in this side
  22. int nstrips;
  23. // Number of vertices per strip
  24. int *strip_size;
  25. // Indices for each point in the triangle strips
  26. unsigned int *strip_index;
  27. // The number of elements for glDrawElements call
  28. int num_eles;
  29. // Index buffer for glDrawElements
  30. GLuint *dBuf;
  31. } SIDE;
  32. typedef struct _GEOMETRY
  33. {
  34. void (*init)(struct _GEOMETRY *geom);
  35. // Number of sides
  36. int nsides;
  37. // Sides
  38. SIDE sides[MAXSIDES];
  39. // Data for each vertex in the shape
  40. PT3 *pts, *npts;
  41. PT3 *normals;
  42. // Total number of vertices
  43. int total_pts;
  44. // Scaling control
  45. FLT min_sf, max_sf, sf_inc;
  46. // Initial scale factor setup control
  47. FLT init_sf;
  48. } GEOMETRY;
  49. #define GEOM_CUBE 0
  50. #define GEOM_TETRA 1
  51. #define GEOM_PYRAMIDS 2
  52. extern GEOMETRY *geom_table[];
  53. void InitVlen(GEOMETRY *geom, int npts, PT3 *pts);
  54. void UpdatePts(GEOMETRY *geom, FLT sf);
  55. void DrawGeom(GEOMETRY *geom);
  56. extern void DrawWithVArrays (GEOMETRY *geom);
  57. #endif // __GEOM_H__