DDModeInfoObject.inl
上传用户:wymy58
上传日期:2007-01-07
资源大小:2086k
文件大小:1k
源码类别:

DirextX编程

开发平台:

Visual C++

  1. // Copyright (C) 1999 DXGuide.  All Rights Reserved.
  2. // File: DDModeInfoObject.inl
  3. // Inlines for CDDModeInfoObject
  4. inline DWORD CDDModeInfoObject::GetWidth(void) const
  5. {
  6. ASSERT(m_pDDSurfaceDesc->dwSize == sizeof(DDSURFACEDESC2));
  7. ASSERT((m_pDDSurfaceDesc->dwFlags & DDSD_WIDTH) != 0);
  8. return  m_pDDSurfaceDesc->dwWidth;
  9. }
  10. inline DWORD CDDModeInfoObject::GetHeight(void) const
  11. {
  12. ASSERT(m_pDDSurfaceDesc->dwSize == sizeof(DDSURFACEDESC2));
  13. ASSERT((m_pDDSurfaceDesc->dwFlags & DDSD_HEIGHT) != 0);
  14. return  m_pDDSurfaceDesc->dwHeight;
  15. }
  16. inline DWORD CDDModeInfoObject::GetBPP(void) const
  17. {
  18. ASSERT(m_pDDSurfaceDesc->dwSize == sizeof(DDSURFACEDESC2));
  19. // Check that Pixel format is valid
  20. ASSERT((m_pDDSurfaceDesc->dwFlags & DDSD_PIXELFORMAT) != 0);
  21. ASSERT(m_pDDSurfaceDesc->ddpfPixelFormat.dwSize == sizeof(DDPIXELFORMAT));
  22. // Assume it is RGB
  23. return  m_pDDSurfaceDesc->ddpfPixelFormat.dwRGBBitCount;
  24. }