home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / graphics / gdi / gdidemo / poly.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  2.1 KB  |  75 lines

  1.  
  2. /******************************************************************************\
  3. *       This is a part of the Microsoft Source Code Samples. 
  4. *       Copyright (C) 1993-1997 Microsoft Corporation.
  5. *       All rights reserved. 
  6. *       This source code is only intended as a supplement to 
  7. *       Microsoft Development Tools and/or WinHelp documentation.
  8. *       See these sources for detailed information regarding the 
  9. *       Microsoft samples programs.
  10. \******************************************************************************/
  11.  
  12.  
  13. #ifdef WIN16
  14. #define APIENTRY FAR PASCAL
  15. typedef WORD WPARAM;
  16. //#else
  17. //typedef DWORD WPARAM;
  18. #endif
  19.  
  20.  
  21. #define POLYCLASS  "POLYDEMO"
  22.  
  23. #define MAX_BEZIER 80
  24. #define VELMAX     10
  25. #define VELMIN      2
  26. #define BEZ_CURVES  1              //Number of Curves in the Bezier
  27. #define BEZ_PTS    3*BEZ_CURVES+1  //Number of Points is the #Curves * 3 + 1 
  28.  
  29.  
  30. /*
  31. ** This structue defines a basic bezier curve.  It is intended to be used in
  32. ** an array of beziers.
  33. */
  34. typedef struct _BEZBUFFER
  35. {
  36.     POINT pPts[BEZ_PTS];
  37. } BEZBUFFER;
  38. typedef BEZBUFFER      *PBEZBUFFER;
  39. typedef BEZBUFFER NEAR *NPBEZBUFFER;
  40. typedef BEZBUFFER FAR  *LPBEZBUFFER;
  41.  
  42.  
  43. /*
  44. ** This is the main object for the polybezier window.  This structure defines
  45. ** a series of bezier curves and the distance between each curve.
  46. */
  47. typedef struct _POLYDATA
  48. {
  49.     int      nBezTotal;
  50.     int      nBezCurr;
  51.     int      nColor;
  52.     POINT    pVel[BEZ_PTS];
  53.     HANDLE   hBezBuffer;
  54. } POLYDATA;
  55. typedef POLYDATA      *PPOLYDATA;
  56. typedef POLYDATA NEAR *NPPOLYDATA;
  57. typedef POLYDATA FAR  *LPPOLYDATA;
  58.  
  59.  
  60. /*
  61. ** POLYBEZIER WINDOW ROUTINES (poly.c)
  62. */
  63. HWND  FAR      CreatePolyWindow(HWND,int);
  64. LONG  APIENTRY PolyProc(HWND,UINT,WPARAM,LONG);
  65. BOOL           PolyCreateProc(HWND);
  66. VOID           PolyDestroyProc(HWND);
  67. BOOL           PolyCommandProc(HWND,WPARAM,LONG);
  68. VOID           PolyPaintProc(HWND);
  69.  
  70.  
  71. VOID           PolyRedraw(HWND);
  72. int            PolyNewVel(int);
  73. VOID           PolyInitPoints(HWND);
  74. VOID           PolyDrawBez(HWND);
  75.