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.

60 lines
1.4 KiB

  1. #include "rgb_pch.h"
  2. #pragma hdrstop
  3. // #include <d3d8rgbrast.h>
  4. // Need to share some kind of header which has:
  5. // #ifndef __D3D8RGBRAST_H__
  6. // #define __D3D8RGBRAST_H__
  7. //
  8. // #ifdef __cplusplus
  9. // extern "C" {
  10. // #endif //__cplusplus
  11. //
  12. // extern void* D3D8RGBRasterizer;
  13. //
  14. // #ifdef __cplusplus
  15. // }
  16. // #endif //__cplusplus
  17. //
  18. // #endif //__D3D8RGBRAST_H__
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif //__cplusplus
  22. extern void* D3D8RGBRasterizer;
  23. #ifdef __cplusplus
  24. }
  25. #endif //__cplusplus
  26. namespace RGB_RAST_LIB_NAMESPACE
  27. {
  28. auto_ptr< CRGBDriver> g_pRGBDriver;
  29. HRESULT APIENTRY
  30. GetSWInfo( D3DCAPS8* pCaps, PD3D8_SWCALLBACKS pCallbacks,
  31. DWORD* pNumTextures, DDSURFACEDESC** ppTexList)
  32. {
  33. if( g_pRGBDriver.get()!= NULL)
  34. return g_pRGBDriver->GetSWInfo( *pCaps, *pCallbacks, *pNumTextures, *ppTexList);
  35. else
  36. {
  37. try {
  38. CRGBDriver::InitSupportedSurfaceArray();
  39. g_pRGBDriver= auto_ptr< CRGBDriver>( new CRGBDriver);
  40. } catch( ... )
  41. { }
  42. if( g_pRGBDriver.get()!= NULL)
  43. return g_pRGBDriver->GetSWInfo( *pCaps, *pCallbacks, *pNumTextures, *ppTexList);
  44. else
  45. return E_OUTOFMEMORY;
  46. }
  47. }
  48. }
  49. CRGBDriver* CRGBDriver::sm_pGlobalDriver= NULL;
  50. DX8SDDIFW::COSDetector DX8SDDIFW::g_OSDetector;
  51. void* D3D8RGBRasterizer= reinterpret_cast<void*>(RGB_RAST_LIB_NAMESPACE::GetSWInfo);