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. #include <d3dx8.h>
  15. #include <dinput.h>
  16. #include <dmusici.h>
  17. #include <dsound.h>
  18. #include <dshow.h>
  19. #define SafeRelease(pInterface) if(pInterface != NULL) {pInterface->Release(); pInterface=NULL;}
  20. #define SafeDelete(pObject) if(pObject != NULL) {delete pObject; pObject=NULL;}
  21. #define KEYDOWN(name, key) (name[key] & 0x80) 
  22. #define MOUSEBUTTONDOWN(key) (key & 0x80)
  23. //Mouse buttons
  24. #define MOUSEBUTTON_LEFT 0
  25. #define MOUSEBUTTON_RIGHT 1
  26. #define MOUSEBUTTON_MIDDLE 2
  27. class CBase  
  28. {
  29. private:
  30. static bool m_fEnableLogging;
  31. public:
  32. CBase();
  33. virtual ~CBase();
  34. D3DXVECTOR3 GetTriangeNormal(D3DXVECTOR3* vVertex1, D3DXVECTOR3* vVertex2, D3DXVECTOR3* vVertex3);
  35. static void StartLogging();
  36. static void StopLogging();
  37. static void LogError(char *lpszText, ...);
  38. static void LogInfo(char *lpszText, ...);
  39. static void LogWarning(char *lpszText, ...);
  40. static DWORD GetMemoryUsage();
  41. static void LogMemoryUsage();
  42. };
  43. #endif // !defined(AFX_BASE_H__19BD59EB_1A65_420F_B8CC_09F798CE485C__INCLUDED_)