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.

84 lines
2.3 KiB

  1. //-----------------------------------------------------------------------------
  2. // File: Pipes.h
  3. //
  4. // Desc:
  5. //
  6. // Copyright (c) 2000 Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #ifndef _PIPES_H
  9. #define _PIPES_H
  10. #define MAX_DEVICE_OBJECTS 10
  11. struct DeviceObjects
  12. {
  13. STATE* m_pState;
  14. };
  15. struct CONFIG
  16. {
  17. BOOL bMultiPipes;
  18. DWORD nJointType;
  19. BOOL bTextured;
  20. BOOL bDefaultTexture;
  21. TCHAR strTextureName[MAX_PATH][MAX_TEXTURES];
  22. DWORD dwSpeed;
  23. BOOL bFlexMode;
  24. DWORD dwTesselFact;
  25. };
  26. //-----------------------------------------------------------------------------
  27. // Name:
  28. // Desc:
  29. //-----------------------------------------------------------------------------
  30. class CPipesScreensaver : public CD3DScreensaver
  31. {
  32. protected:
  33. DeviceObjects m_DeviceObjects[MAX_DEVICE_OBJECTS];
  34. DeviceObjects* m_pDeviceObjects;
  35. int m_iRenderUnit;
  36. D3DXCOLOR m_col3;
  37. protected:
  38. virtual HRESULT RegisterSoftwareDevice();
  39. virtual VOID DoConfig();
  40. virtual VOID ReadSettings();
  41. VOID WriteSettings();
  42. virtual VOID DoPaint( HWND hwnd, HDC hdc );
  43. virtual VOID SetDevice( UINT iDevice );
  44. virtual HRESULT Render();
  45. virtual HRESULT FrameMove();
  46. virtual HRESULT RestoreDeviceObjects();
  47. virtual HRESULT InvalidateDeviceObjects();
  48. VOID Randomize( INT* piNum, INT iMax );
  49. public:
  50. CPipesScreensaver();
  51. CONFIG m_Config;
  52. D3DSURFACE_DESC* GetSurfaceDesc() { return &m_d3dsdBackBuffer; };
  53. BOOL SelectTextureFile( HWND hDlg, TCHAR* origPathName );
  54. VOID ss_ReadSettings();
  55. BOOL ss_RegistrySetup( int section, int file );
  56. int ss_GetRegistryInt( int name, int iDefault );
  57. VOID ss_GetRegistryString( int name, LPTSTR lpDefault, LPTSTR lpDest, int bufSize );
  58. // Override from CD3DScreensaver
  59. INT_PTR CALLBACK ConfigureDialogProc( HWND hwndDlg, UINT uMsg,
  60. WPARAM wParam, LPARAM lParam );
  61. static int iRand( int max );
  62. static int iRand2( int min, int max );
  63. static FLOAT fRand( FLOAT min, FLOAT max );
  64. static VOID RandInit();
  65. };
  66. #endif