Base.h
上传用户:whgydz
上传日期:2007-01-12
资源大小:2259k
文件大小:1k
源码类别:

其他书籍

开发平台:

HTML/CSS

  1. // Base.h: interface for the CBase class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_)
  5. #define AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include <stdio.h>
  10. #include <stdarg.h>
  11. #include <d3dx8.h>
  12. #include <tlhelp32.h>
  13. #include <windows.h>
  14. #define SafeRelease(pInterface) if(pInterface != NULL) {pInterface->Release(); pInterface=NULL;}
  15. #define SafeDelete(pObject) if(pObject != NULL) {delete pObject; pObject=NULL;}
  16. class CBase  
  17. {
  18. private:
  19. static bool m_fEnableLogging;
  20. public:
  21. CBase();
  22. virtual ~CBase();
  23. D3DXVECTOR3 GetTriangeNormal(D3DXVECTOR3* vVertex1, D3DXVECTOR3* vVertex2, D3DXVECTOR3* vVertex3);
  24. static void StartLogging();
  25. static void StopLogging();
  26. static void LogError(char *lpszText, ...);
  27. static void LogInfo(char *lpszText, ...);
  28. static void LogWarning(char *lpszText, ...);
  29. static DWORD GetMemoryUsage();
  30. static void LogMemoryUsage();
  31. };
  32. #endif // !defined(AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_)