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.

69 lines
1.8 KiB

  1. namespace RGB_RAST_LIB_NAMESPACE
  2. {
  3. class _multiple_inheritance CRGBContext;
  4. class _single_inheritance CRGBDriver;
  5. class _single_inheritance CRGBPerDDrawData;
  6. typedef CSurfDBEntryWPal<> TSurfDBEntry;
  7. typedef CSubPerDDrawData< CRGBPerDDrawData, CRGBDriver, TSurfDBEntry,
  8. static_hash_map< DWORD, TSurfDBEntry, 64> >
  9. TSubPerDDrawData;
  10. class CRGBPerDDrawData:
  11. public TSubPerDDrawData
  12. {
  13. public:
  14. CRGBPerDDrawData( TDriver& Driver, DDRAWI_DIRECTDRAW_LCL& DDLcl) throw()
  15. :TSubPerDDrawData( Driver, DDLcl)
  16. { }
  17. ~CRGBPerDDrawData() throw() { }
  18. };
  19. typedef CSubDriver< CRGBDriver, CRGBContext, CRGBSurfAllocator, CRGBPerDDrawData>
  20. TSubDriver;
  21. class CSupportedSurface
  22. {
  23. protected:
  24. DDSURFACEDESC m_SDesc;
  25. CRGBSurfAllocator::TCreateSurfFn m_CreateFn;
  26. public:
  27. CSupportedSurface() { }
  28. CSupportedSurface( DDSURFACEDESC SDesc, CRGBSurfAllocator::TCreateSurfFn CFn)
  29. : m_SDesc( SDesc), m_CreateFn( CFn)
  30. { }
  31. operator DDSURFACEDESC() const
  32. { return m_SDesc; }
  33. DDSURFACEDESC GetMatch() const
  34. {
  35. SPixelFormat PFmt(
  36. static_cast< D3DFORMAT>(m_SDesc.ddpfPixelFormat.dwFourCC));
  37. DDSURFACEDESC RetSDesc;
  38. ZeroMemory( &RetSDesc, sizeof(RetSDesc));
  39. RetSDesc.dwFlags= DDSD_PIXELFORMAT;
  40. RetSDesc.ddpfPixelFormat= PFmt;
  41. return RetSDesc;
  42. }
  43. operator CRGBSurfAllocator::TCreateSurfFn() const
  44. { return m_CreateFn; }
  45. };
  46. class CRGBDriver:
  47. public TSubDriver
  48. {
  49. private:
  50. static CSupportedSurface c_aSurfaces[];
  51. static const D3DCAPS8 c_D3DCaps;
  52. public:
  53. CRGBDriver();
  54. ~CRGBDriver()
  55. { }
  56. static const D3DCAPS8& GetCaps()
  57. { return c_D3DCaps; }
  58. static void InitSupportedSurfaceArray();
  59. };
  60. }